diff --git a/tests/tests_regression/CMakeLists.txt b/tests/tests_regression/CMakeLists.txt index 779e2a42..686ae049 100644 --- a/tests/tests_regression/CMakeLists.txt +++ b/tests/tests_regression/CMakeLists.txt @@ -54,29 +54,37 @@ set(TABLES_TO_COMPARE ) function(test_standard standard base_config resource_dir output_filename) - configure_file(compare.sh compare-${standard}.sh) + # Put all the generated files into a subdirectory + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${standard}) + + configure_file(compare.sh ${standard}/compare.sh) # Test to create database add_test( NAME Regression${standard}.CreateDatabase + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${standard} COMMAND $ ${base_config} ${resource_dir} ) set_tests_properties(Regression${standard}.CreateDatabase PROPERTIES FIXTURES_SETUP Regression${standard}.CreateDatabase) - # Test to diff the whole database + # Test to diff the whole database. This test should not fail. + # The purpose of this test is solely to output the differences of the two databases + # so that they can be inspected easily. add_test( NAME Regression${standard}.SqlDiff - COMMAND compare-${standard}.sh + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${standard} + COMMAND compare.sh ) set_tests_properties(Regression${standard}.SqlDiff PROPERTIES FIXTURES_REQUIRED Regression${standard}.CreateDatabase) # Tests to diff individual tables foreach(table IN LISTS TABLES_TO_COMPARE) - configure_file(compare_table.sh compare_table-${table}-${standard}.sh) + configure_file(compare_table.sh ${standard}/compare_table-${table}.sh) add_test( NAME Regression${standard}.SqlDiff.${table} - COMMAND compare_table-${table}-${standard}.sh + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${standard} + COMMAND compare_table-${table}.sh ) set_tests_properties(Regression${standard}.SqlDiff.${table} PROPERTIES FIXTURES_REQUIRED Regression${standard}.CreateDatabase) endforeach()