summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAina Niemetz <aina.niemetz@gmail.com>2018-09-19 09:21:31 -0700
committerMathias Preiner <mathias.preiner@gmail.com>2018-09-22 16:30:59 -0700
commit65a713e53cefa95fcff1b2db30046edf943b3390 (patch)
treef2a00a78087c604c48f3bb40a2cbe72f3458e5cf /examples
parentbd5067d49cc113750887b62f865df8048c648cce (diff)
cmake: Refactor cvc4_add_unit_test macro to support test names with '/'.
Required for consistent naming of tests, unit test names now also use the test naming scheme <category>/<subdir>/<test name>, e.g., unit/theory/theory_bv_white.
Diffstat (limited to 'examples')
-rw-r--r--examples/CMakeLists.txt11
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 920727e86..a37cb9276 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -36,7 +36,7 @@ add_custom_target(runexamples
# as arguments to the test executable.
macro(cvc4_add_example name src_files libs output_dir)
# The build target is created without the path prefix (not supported),
- # e.g., for '<subdirs>/myexample.cpp'
+ # e.g., for '<output_dir>/myexample.cpp'
# we create build target 'myexample'
# and build it with 'make myexample'.
# As a consequence, all build target names must be globally unique.
@@ -50,15 +50,14 @@ macro(cvc4_add_example name src_files libs output_dir)
target_link_libraries(${name} ${libs})
add_dependencies(examples ${name})
# The test target is prefixed with test identifier 'example/' and the path,
- # e.g., for '<subdirs>/myexample.cpp'
- # we create test target 'example/<subdirs>/myexample'
- # and run it with 'ctest -R "example/<subdirs>/<example>"'.
+ # e.g., for '<output_dir>/myexample.cpp'
+ # we create test target 'example/<output_dir>/myexample'
+ # and run it with 'ctest -R "example/<output_dir>/myunittest"'.
+ set(example_bin_dir ${EXAMPLES_BIN_DIR}/${output_dir})
if("${output_dir}" STREQUAL "")
set(example_test example/${name})
- set(example_bin_dir ${EXAMPLES_BIN_DIR})
else()
set(example_test example/${output_dir}/${name})
- set(example_bin_dir ${EXAMPLES_BIN_DIR}/${output_dir})
endif()
set_target_properties(${name}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${example_bin_dir})
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback