2009-12-08 19:44:50 +03:00
|
|
|
include_directories(
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMake_BINARY_DIR}/Source
|
|
|
|
${CMake_SOURCE_DIR}/Source
|
|
|
|
)
|
|
|
|
|
|
|
|
set(CMakeLib_TESTS
|
2011-12-24 00:08:47 +04:00
|
|
|
testGeneratedFileStream
|
2013-10-01 04:30:57 +04:00
|
|
|
testRST
|
2011-12-24 00:41:38 +04:00
|
|
|
testSystemTools
|
2009-12-08 23:44:22 +03:00
|
|
|
testUTF8
|
2009-12-08 19:44:50 +03:00
|
|
|
testXMLParser
|
2009-12-08 23:44:45 +03:00
|
|
|
testXMLSafe
|
2009-12-08 19:44:50 +03:00
|
|
|
)
|
|
|
|
|
2014-06-06 18:39:45 +04:00
|
|
|
set(testRST_ARGS ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
2013-10-11 02:02:24 +04:00
|
|
|
if(WIN32)
|
2013-01-08 17:10:42 +04:00
|
|
|
list(APPEND CMakeLib_TESTS
|
|
|
|
testVisualStudioSlnParser
|
|
|
|
)
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testVisualStudioSlnParser.h.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/testVisualStudioSlnParser.h @ONLY)
|
|
|
|
endif()
|
|
|
|
|
2009-12-08 19:44:50 +03:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testXMLParser.h.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/testXMLParser.h @ONLY)
|
|
|
|
|
|
|
|
create_test_sourcelist(CMakeLib_TEST_SRCS CMakeLibTests.cxx ${CMakeLib_TESTS})
|
|
|
|
add_executable(CMakeLibTests ${CMakeLib_TEST_SRCS})
|
|
|
|
target_link_libraries(CMakeLibTests CMakeLib)
|
|
|
|
|
2009-12-09 18:56:30 +03:00
|
|
|
# Xcode 2.x forgets to create the output directory before linking
|
|
|
|
# the individual architectures.
|
|
|
|
if(CMAKE_OSX_ARCHITECTURES AND XCODE
|
|
|
|
AND NOT "${XCODE_VERSION}" MATCHES "^[^12]")
|
|
|
|
add_custom_command(
|
|
|
|
TARGET CMakeLibTests
|
|
|
|
PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2009-12-08 19:44:50 +03:00
|
|
|
foreach(test ${CMakeLib_TESTS})
|
2014-06-06 18:39:45 +04:00
|
|
|
add_test(CMakeLib.${test} CMakeLibTests ${test} ${${test}_ARGS})
|
2009-12-08 19:44:50 +03:00
|
|
|
endforeach()
|
2011-04-01 03:55:00 +04:00
|
|
|
|
2011-04-25 21:16:01 +04:00
|
|
|
if(TEST_CompileCommandOutput)
|
|
|
|
add_executable(runcompilecommands run_compile_commands.cxx)
|
|
|
|
target_link_libraries(runcompilecommands CMakeLib)
|
|
|
|
endif()
|
2014-12-16 21:59:22 +03:00
|
|
|
|
|
|
|
add_subdirectory(PseudoMemcheck)
|