Skip to content

Commit a6976c0

Browse files
authored
Improve unittest cmake and gitignore (#453)
1 parent d858914 commit a6976c0

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

.github/workflows/Ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ jobs:
411411
cmake --build . --target sphinx-cppinterop --parallel ${{ env.ncpus }}
412412
else
413413
cmake --build . --target check-cppinterop --parallel ${{ env.ncpus }}
414-
valgrind --show-error-list=yes --track-origins=yes --error-exitcode=1 unittests/CppInterOp/CppInterOpTests
414+
valgrind --show-error-list=yes --track-origins=yes --error-exitcode=1 unittests/CppInterOp/CppInterOpTests/unittests/bin/${{ env.BUILD_TYPE }}/CppInterOpTests
415415
fi
416416
cd ..
417417
# We need CB_PYTHON_DIR later

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,9 @@ install
3333

3434
# CLion files
3535
.idea
36+
37+
# VSCode files
38+
.vscode
39+
40+
# Default Virtual Environments
41+
.venv

unittests/CppInterOp/CMakeLists.txt

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(LLVM_LINK_COMPONENTS
22
Support
3-
)
3+
)
44

55
add_cppinterop_unittest(CppInterOpTests
66
CUDATest.cpp
@@ -12,21 +12,27 @@ add_cppinterop_unittest(CppInterOpTests
1212
TypeReflectionTest.cpp
1313
Utils.cpp
1414
VariableReflectionTest.cpp
15-
)
15+
)
16+
1617
target_link_libraries(CppInterOpTests
1718
PRIVATE
1819
clangCppInterOp
19-
)
20+
)
21+
22+
set_output_directory(CppInterOpTests
23+
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/CppInterOpTests/unittests/bin/$<CONFIG>/
24+
LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/CppInterOpTests/unittests/bin/$<CONFIG>/
25+
)
2026

2127
if(NOT WIN32)
2228
set_source_files_properties(VariableReflectionTest.cpp PROPERTIES COMPILE_FLAGS
2329
"-Wno-pedantic"
24-
)
30+
)
2531
endif()
2632

2733
set_source_files_properties(InterpreterTest.cpp PROPERTIES COMPILE_DEFINITIONS
2834
"LLVM_BINARY_DIR=\"${LLVM_BINARY_DIR}\""
29-
)
35+
)
3036
export_executable_symbols(CppInterOpTests)
3137

3238
unset(LLVM_LINK_COMPONENTS)
@@ -35,10 +41,12 @@ add_cppinterop_unittest(DynamicLibraryManagerTests DynamicLibraryManagerTest.cpp
3541
target_link_libraries(DynamicLibraryManagerTests
3642
PRIVATE
3743
clangCppInterOp
38-
)
39-
40-
set_output_directory(DynamicLibraryManagerTests BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/TestSharedLib/unittests/bin/$<CONFIG>/)
44+
)
4145

46+
set_output_directory(DynamicLibraryManagerTests
47+
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/TestSharedLib/unittests/bin/$<CONFIG>/
48+
LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/TestSharedLib/unittests/bin/$<CONFIG>/
49+
)
4250
add_dependencies(DynamicLibraryManagerTests TestSharedLib)
4351
#export_executable_symbols_for_plugins(TestSharedLib)
4452
add_subdirectory(TestSharedLib)

0 commit comments

Comments
 (0)