What are the possible reasons for xcrun llvm-cov show command to return error: Failed to load coverage: No such file or directory?
I have an iOS lib. The result of the lib build is *.a binary file. I have a scheme in the project which also contains GTest unit tests.
So I execute:
xcodebuild test \
-sdk iphonesimulator \
-destination "$DESTINATION" \
-derivedDataPath "$ROOT"/DerivedData \
-scheme unitTestsTarget \
-project "$ROOT"/libProject.xcodeproj \
-enableCodeCoverage YES
After that
xcrun llvm-profdata merge .../Coverage.profdata .../EA8FF09E-3BFE-42D2-BFA7-A39D69E7F688-45921.profraw -output ./merged.profdata
And
xcrun llvm-cov show -format=html -use-color=true -output-dir=./coverage-html -instr-profile ./merged.profdata -object ./DerivedData/Build/Products/Debug-iphonesimulator/myLib.a -ignore-filename-regex='\''.*\.h'\'''
And the last command gives me
error: ./myLib.a: Failed to load coverage: No such file or directory
I have 3 modules of a similar structure and one of them works fine and the other 2 give me this error.
I'd really appreciate is someone can give a hint on the possible reasons for this error and possible solutions to try.