Build api tests in build/bin/test/api. (#6076)
authorAina Niemetz <aina.niemetz@gmail.com>
Mon, 8 Mar 2021 19:10:14 +0000 (11:10 -0800)
committerGitHub <noreply@github.com>
Mon, 8 Mar 2021 19:10:14 +0000 (11:10 -0800)
Previously, api tests where built in build/test/api instead of in the
bin directory for the tests.

test/api/CMakeLists.txt

index 33d5f9c37ace2714cdc996852604adefd3e5c396..cc968422fbd56901ee38097b34bfbc6c06c68d2b 100644 (file)
@@ -28,10 +28,13 @@ set(CVC4_API_TEST_FLAGS
   -D__BUILDING_CVC4_API_TEST -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS)
 
 macro(cvc4_add_api_test name)
+  set(test_bin_dir ${CMAKE_BINARY_DIR}/bin/test/api/)
   add_executable(${name} ${name}.cpp)
   target_link_libraries(${name} main-test)
   target_compile_definitions(${name} PRIVATE ${CVC4_API_TEST_FLAGS})
-  add_test(api/${name} ${CMAKE_CURRENT_BINARY_DIR}/${name})
+  set_target_properties(${name}
+    PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${test_bin_dir})
+  add_test(api/${name} ${test_bin_dir}/${name})
   set_tests_properties(api/${name} PROPERTIES LABELS "api")
   add_dependencies(build-apitests ${name})
 endmacro()