Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Tests/CMakeLib/CMakeLists.txt
5024 views
1
# Render the header file with source path macro
2
configure_file(testConfig.h.in testConfig.h @ONLY)
3
4
set(CMakeLib_TESTS
5
testAssert.cxx
6
testArgumentParser.cxx
7
testCTestBinPacker.cxx
8
testCTestResourceAllocator.cxx
9
testCTestResourceSpec.cxx
10
testCTestResourceGroups.cxx
11
testDateTime.cxx
12
testDebug.cxx
13
testDocumentationFormatter.cxx
14
testGccDepfileReader.cxx
15
testGeneratedFileStream.cxx
16
testJSONHelpers.cxx
17
testRST.cxx
18
testRange.cxx
19
testOptional.cxx
20
testPathResolver.cxx
21
testSpdxSerializer.cxx
22
testStdIo.cxx
23
testString.cxx
24
testStringAlgorithms.cxx
25
testSystemTools.cxx
26
testUTF8.cxx
27
testXMLParser.cxx
28
testXMLSafe.cxx
29
testFindPackageCommand.cxx
30
testUVHandlePtr.cxx
31
testUVJobServerClient.cxx
32
testUVPatches.cxx
33
testUVProcessChain.cxx
34
testUVRAII.cxx
35
testUVStreambuf.cxx
36
testCMExtMemory.cxx
37
testCMExtAlgorithm.cxx
38
testCMExtEnumSet.cxx
39
testList.cxx
40
testCMFilesystemPath.cxx
41
testCMakePath.cxx
42
)
43
if(CMake_ENABLE_DEBUGGER)
44
list(APPEND CMakeLib_TESTS
45
testDebuggerAdapter.cxx
46
testDebuggerAdapterPipe.cxx
47
testDebuggerBreakpointManager.cxx
48
testDebuggerVariables.cxx
49
testDebuggerVariablesHelper.cxx
50
testDebuggerVariablesManager.cxx
51
testDebuggerThread.cxx
52
)
53
endif()
54
55
add_executable(testUVProcessChainHelper testUVProcessChainHelper.cxx)
56
target_link_libraries(testUVProcessChainHelper CMakeLib)
57
target_compile_definitions(testUVProcessChainHelper PRIVATE WIN32_LEAN_AND_MEAN)
58
59
set(testRST_ARGS ${CMAKE_CURRENT_SOURCE_DIR})
60
set(testUVProcessChain_ARGS $<TARGET_FILE:testUVProcessChainHelper>)
61
set(testUVStreambuf_ARGS $<TARGET_FILE:cmake>)
62
set(testCTestResourceSpec_ARGS ${CMAKE_CURRENT_SOURCE_DIR})
63
set(testGccDepfileReader_ARGS ${CMAKE_CURRENT_SOURCE_DIR})
64
65
if(WIN32)
66
list(APPEND CMakeLib_TESTS
67
testVisualStudioSlnParser.cxx
68
)
69
endif()
70
71
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testUVProcessChainInput.txt" "HELLO WORLD!")
72
73
create_test_sourcelist(CMakeLib_TEST_SRCS CMakeLibTests.cxx ${CMakeLib_TESTS})
74
add_executable(CMakeLibTests ${CMakeLib_TEST_SRCS})
75
target_include_directories(CMakeLibTests PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
76
target_link_libraries(CMakeLibTests PRIVATE CTestLib CMakeLib)
77
if(CMake_BUILD_PCH)
78
target_precompile_headers(CMakeLibTests PRIVATE "<iostream>" "<cm3p/uv.h>")
79
target_compile_definitions(CMakeLibTests PRIVATE "NOMINMAX")
80
endif()
81
if(WIN32)
82
target_compile_definitions(CMakeLibTests PRIVATE WIN32_LEAN_AND_MEAN)
83
endif()
84
85
set_property(TARGET CMakeLibTests PROPERTY C_CLANG_TIDY "")
86
set_property(TARGET CMakeLibTests PROPERTY CXX_CLANG_TIDY "")
87
88
add_executable(testEncoding testEncoding.cxx)
89
target_link_libraries(testEncoding cmsys)
90
91
foreach(testfile ${CMakeLib_TESTS})
92
get_filename_component(test "${testfile}" NAME_WE)
93
add_test(NAME CMakeLib.${test} COMMAND CMakeLibTests ${test} ${${test}_ARGS})
94
endforeach()
95
96
if(TEST_CompileCommandOutput)
97
add_executable(runcompilecommands run_compile_commands.cxx)
98
target_link_libraries(runcompilecommands CMakeLib)
99
endif()
100
101
add_subdirectory(PseudoMemcheck)
102
103
add_executable(testAffinity testAffinity.cxx)
104
target_link_libraries(testAffinity CMakeLib)
105
106
if(CMake_ENABLE_DEBUGGER)
107
add_executable(testDebuggerNamedPipe testDebuggerNamedPipe.cxx)
108
target_link_libraries(testDebuggerNamedPipe PRIVATE CMakeLib)
109
set(testDebuggerNamedPipe_Project_ARGS
110
"$<TARGET_FILE:cmake>" -S ${CMAKE_CURRENT_SOURCE_DIR}/DebuggerSample -B ${CMAKE_CURRENT_BINARY_DIR}/DebuggerSample
111
--fresh -G ${CMAKE_GENERATOR}
112
)
113
if(CMAKE_GENERATOR_PLATFORM)
114
list(APPEND testDebuggerNamedPipe_Project_ARGS -A "${CMAKE_GENERATOR_PLATFORM}")
115
endif()
116
if(CMAKE_GENERATOR_TOOLSET)
117
list(APPEND testDebuggerNamedPipe_Project_ARGS -T "${CMAKE_GENERATOR_TOOLSET}")
118
endif()
119
if(CMAKE_GENERATOR_INSTANCE)
120
list(APPEND testDebuggerNamedPipe_Project_ARGS "-DCMAKE_GENERATOR_INSTANCE=${CMAKE_GENERATOR_INSTANCE}")
121
endif()
122
set(testDebuggerNamedPipe_Script_ARGS
123
"$<TARGET_FILE:cmake>" -P ${CMAKE_CURRENT_SOURCE_DIR}/DebuggerSample/script.cmake
124
)
125
foreach(case Project Script)
126
add_test(NAME CMakeLib.testDebuggerNamedPipe-${case} COMMAND testDebuggerNamedPipe ${testDebuggerNamedPipe_${case}_ARGS})
127
set_property(TEST CMakeLib.testDebuggerNamedPipe-${case} PROPERTY TIMEOUT 300)
128
endforeach()
129
if(WIN32)
130
target_compile_definitions(testDebuggerNamedPipe PRIVATE WIN32_LEAN_AND_MEAN)
131
endif()
132
endif()
133
134