[tests] Add edge case coverage for CopyIncludePaths in Paths.cpp#862
[tests] Add edge case coverage for CopyIncludePaths in Paths.cpp#862voyager-jhk wants to merge 14 commits intocompiler-research:mainfrom
Conversation
7a0aaec to
6ded7c3
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #862 +/- ##
==========================================
+ Coverage 79.75% 79.90% +0.14%
==========================================
Files 11 11
Lines 4031 4031
==========================================
+ Hits 3215 3221 +6
+ Misses 816 810 -6 see 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
@mcbarton @aaronj0 Looks like the linker errors only happen on cling native builds and Emscripten (WASM DCE). All clang-repl native builds are green. Since CopyIncludePaths seems unavailable in those environments, should I just guard this test in CMake/macros, or rewrite it to hit those branches indirectly via the public Interpreter API? |
|
@voyager-jhk to fix the Emscripten linker errors like the one in the ci, you need to work out what make use of the cppinterop_api annotation. It should be obvious how to use it looking at the source code. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
lib/CppInterOp/Paths.h
Outdated
| /// "-nostdinc". | ||
| /// | ||
| void CopyIncludePaths(const clang::HeaderSearchOptions& Opts, | ||
| CPPINTEROP_API void CopyIncludePaths(const clang::HeaderSearchOptions& Opts, |
There was a problem hiding this comment.
warning: unknown type name 'CPPINTEROP_API' [clang-diagnostic-error]
CPPINTEROP_API void CopyIncludePaths(const clang::HeaderSearchOptions& Opts,
^|
clang-tidy review says "All clean, LGTM! 👍" |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
clang-tidy review says "All clean, LGTM! 👍" |
Description
This PR improves the test coverage for the internal utility function
CopyIncludePathslocated inlib/CppInterOp/Paths.cpp.Previously, several edge-case flag branches (such as
-fmodule-cache-path,-nostdinc,-stdlib=libc++, and-v) lacked test coverage.I have:
PathsTest.cpptest suite.PathsTest.CopyIncludePathsEdgeCasesto specifically target and validate these uncovered branches.unittests/CppInterOp/CMakeLists.txtto properly link the new test file.Contributes to #541
Type of change
Please tick all options which are relevant.
Testing
Please describe the test(s) that you added and ran to verify your changes.
CppInterOpTeststarget locally using CMake../unittests/CppInterOp/bin/Release/CppInterOpTests --gtest_filter="PathsTest.*"Checklist