diff options
author | Alex Ozdemir <aozdemir@hmc.edu> | 2019-11-14 10:39:05 -0800 |
---|---|---|
committer | Andres Noetzli <andres.noetzli@gmail.com> | 2019-11-14 10:39:05 -0800 |
commit | 68eea7921ddfa0544e2f7936fe5f7724107df189 (patch) | |
tree | 318cad838a4026e7c3f9bc177d4ce077d51f4d65 /test/unit/CMakeLists.txt | |
parent | 0383980050ab86b1a4f7f265d9c8527e627ef971 (diff) |
Use Shebang in cxxtestgen when appropriate (#3458)
CxxTest's generator has one of three names, depending on the CxxTest
version:
* `cxxtestgen.py`, a python program
* `cxxtestgen`, some kind of program with a shebang
* `cxxtestgen.pl`, a perl program
We were mistakenly assuming that the `cxxtestgen` form was always a
python program.
Now, if we find that form on the system, we assume that it is has a
shebang, and is executable.
Diffstat (limited to 'test/unit/CMakeLists.txt')
-rw-r--r-- | test/unit/CMakeLists.txt | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 83b0ec0db..0c82bcc1a 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -32,14 +32,24 @@ macro(cvc4_add_unit_test is_white name output_dir) # generate the test sources set(test_src ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp) set(test_header ${CMAKE_CURRENT_LIST_DIR}/${name}.h) - add_custom_command( - OUTPUT ${test_src} - DEPENDS ${test_header} - COMMAND - ${CxxTest_TESTGEN_INTERPRETER} + if (CxxTest_USE_SHEBANG) + add_custom_command( + OUTPUT ${test_src} + DEPENDS ${test_header} + COMMAND ${CxxTest_TESTGEN_EXECUTABLE} - ${CxxTest_TESTGEN_ARGS} -o ${test_src} ${test_header} - ) + ${CxxTest_TESTGEN_ARGS} -o ${test_src} ${test_header} + ) + else() + add_custom_command( + OUTPUT ${test_src} + DEPENDS ${test_header} + COMMAND + ${CxxTest_TESTGEN_INTERPRETER} + ${CxxTest_TESTGEN_EXECUTABLE} + ${CxxTest_TESTGEN_ARGS} -o ${test_src} ${test_header} + ) + endif() set_source_files_properties(${test_src} PROPERTIES GENERATED true) # The build target is created without the path prefix (not supported), # e.g., for '<output_dir>/myunittest.h' |