Commit c307e1c9 authored by Brad King's avatar Brad King
Browse files

Tests/RunCMake: Allow tests to control build tree behavior

Teach the run_cmake to allow tests to set a custom test build directory.
Also add an option to skip removing the build directory.
parent 2963c982
...@@ -26,8 +26,12 @@ function(run_cmake test) ...@@ -26,8 +26,12 @@ function(run_cmake test)
endif() endif()
endforeach() endforeach()
set(RunCMake_TEST_SOURCE_DIR "${top_src}") set(RunCMake_TEST_SOURCE_DIR "${top_src}")
set(RunCMake_TEST_BINARY_DIR "${top_bin}/${test}-build") if(NOT RunCMake_TEST_BINARY_DIR)
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") set(RunCMake_TEST_BINARY_DIR "${top_bin}/${test}-build")
endif()
if(NOT RunCMake_TEST_NO_CLEAN)
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
endif()
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
if(NOT DEFINED RunCMake_TEST_OPTIONS) if(NOT DEFINED RunCMake_TEST_OPTIONS)
set(RunCMake_TEST_OPTIONS "") set(RunCMake_TEST_OPTIONS "")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment