Skip to content

Commit

Permalink
Tests: Append CMAKE_BINARY_DIR to PATH on Windows
Browse files Browse the repository at this point in the history
Avoids copying objc.dll to the tests directory.
  • Loading branch information
qmfrederik authored and davidchisnall committed Dec 30, 2023
1 parent 32c09c0 commit d34e066
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ jobs:
shell: cmd
working-directory: build
run: |
copy /y objc.dll Test
ctest -j 4 --output-on-failure -T test
Expand Down
6 changes: 0 additions & 6 deletions README.windows
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,3 @@ The runtime can build on Windows with Ninja:
> cmake .. -G Ninja -DCMAKE_C_COMPILER=path/to/clang.exe -DCMAKE_CXX_COMPILER=path/to/clang.exe
> ninja
```

Debugging
---------

The tests will all fail on Windows because they will not find objc.dll.
To fix this, copy objc.dll into the `Tests` build directory.
3 changes: 3 additions & 0 deletions Test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ function(addtest_flags TEST_NAME FLAGS TEST_SOURCE)
set_property(TEST ${TEST_NAME} PROPERTY
ENVIRONMENT "LD_LIBRARY_PATH=" "LLVM_PROFILE_FILE=${TEST_NAME}.profraw"
)
if(WIN32)
set_property(TEST ${TEST_NAME} PROPERTY ENVIRONMENT_MODIFICATION "PATH=path_list_append:${CMAKE_BINARY_DIR}")
endif()
target_link_libraries(${TEST_NAME} objc)
endfunction(addtest_flags)

Expand Down

0 comments on commit d34e066

Please sign in to comment.