mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
Generates runner only when tests files changed.
And move generated files into CMAKE_CURRENT_BINARY_DIR.
This commit is contained in:
parent
49e47a57a2
commit
0fd1264903
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -12,4 +12,3 @@ docs/doxyxml/
|
||||||
#*#
|
#*#
|
||||||
*~
|
*~
|
||||||
.DS_Store
|
.DS_Store
|
||||||
tests/runner-autogen.cpp
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
cd ${0%/*}
|
cd ${0%/*}
|
||||||
../third-party/cxxtest/bin/cxxtestgen --runner=ErrorPrinter -o ../tests/runner-autogen.cpp ../tests/*.hpp ../source/*/tests/*.hpp
|
../third-party/cxxtest/bin/cxxtestgen --runner=ErrorPrinter -o "$1"/tests/runner-autogen.cpp ../tests/*.hpp ../source/*/tests/*.hpp
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
cd %~dp0
|
cd %~dp0
|
||||||
../third-party/cxxtest/bin/cxxtestgen --runner=ErrorPrinter -o ../tests/runner-autogen.cpp ../tests/*.hpp ../source/*/tests/*.hpp
|
../third-party/cxxtest/bin/cxxtestgen --runner=ErrorPrinter -o "%1"/tests/runner-autogen.cpp ../tests/*.hpp ../source/*/tests/*.hpp
|
||||||
|
|
|
@ -25,8 +25,8 @@ FILE(GLOB TEST_HELPERS_SOURCES tests/helpers/*.cpp)
|
||||||
|
|
||||||
SET(TEST_HELPERS ${TEST_HELPERS_HEADERS} ${TEST_HELPERS_SOURCES})
|
SET(TEST_HELPERS ${TEST_HELPERS_HEADERS} ${TEST_HELPERS_SOURCES})
|
||||||
|
|
||||||
file(WRITE tests/runner-autogen.cpp "#error This file should be generated from tests before compiling")
|
SET(RUNNER "${CMAKE_CURRENT_BINARY_DIR}/tests/runner-autogen.cpp")
|
||||||
SET(RUNNER tests/runner-autogen.cpp)
|
SET_SOURCE_FILES_PROPERTIES(${RUNNER} PROPERTIES GENERATED TRUE)
|
||||||
|
|
||||||
add_executable(xlnt.test ${TEST_HELPERS} ${TESTS} ${RUNNER} )
|
add_executable(xlnt.test ${TEST_HELPERS} ${TESTS} ${RUNNER} )
|
||||||
|
|
||||||
|
@ -59,9 +59,13 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
|
||||||
target_link_libraries(xlnt.test Shlwapi)
|
target_link_libraries(xlnt.test Shlwapi)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_custom_target (generate-test-runner
|
add_custom_command(OUTPUT ${RUNNER}
|
||||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/cmake/generate-tests
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/cmake/generate-tests ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
DEPENDS ${TESTS}
|
||||||
|
IMPLICIT_DEPENDS CXX ${TESTS}
|
||||||
COMMENT "Generating test runner ${RUNNER}"
|
COMMENT "Generating test runner ${RUNNER}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_custom_target(generate-test-runner DEPENDS ${RUNNER})
|
||||||
|
|
||||||
add_dependencies(xlnt.test generate-test-runner)
|
add_dependencies(xlnt.test generate-test-runner)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user