Let's say I have a local package Foo
, Bar
and Baz
.
Foo
has Bar
and Baz
as dependency and has test target,FooTests
.
Below is the Package.swift
manifest that describes package Foo
.
import PackageDescription
let packages: [Package.Dependency] = [
.package(path: "../Bar"),
.package(path: "../Baz"),
]
let products: [Target.Dependency] = [
.product(name: "Bar", package: "Bar"),
.product(name: "Baz", package: "Baz"),
]
let package = Package(
name: "Foo",
platforms: [
.iOS(.v16),
],
products: [
.library(
name: "Foo",
targets: ["Foo"]
),
],
dependencies: packages,
targets: [
.target(
name: "Foo",
dependencies: products,
path: "Sources"
),
.testTarget(
name: "FooTests",
dependencies: [.target(name: "Foo")],
path: "Tests",
swiftSettings: swiftSettings
),
]
)
Bar
and Baz
is also local packages.
Due to the limitations of the project, Baz
has sources with symbolic links instead of exact directories, and these sources are what FooTests
will test.
If I run FooTests
, test succeed with proper logs indicating that all test methods are run correctly, but test coverage says that Baz
's coverage is 0% and there is no executable lines unlike the Bar
which is not what be tested.
Is there any way to fix this problem?