diff --git a/tests/tests_regression/CMakeLists.txt b/tests/tests_regression/CMakeLists.txt index c87dd68a..1ed6addf 100644 --- a/tests/tests_regression/CMakeLists.txt +++ b/tests/tests_regression/CMakeLists.txt @@ -28,7 +28,7 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# Authors: +# Authors: # Derek Christ ############################################### @@ -62,8 +62,6 @@ function(test_standard standard test_name base_config resource_dir output_filena # Put all the generated files into a subdirectory file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${test_name}) - configure_file(compare.sh ${test_name}/compare.sh) - # Test to create database add_test( NAME Regression${test_name}.CreateDatabase @@ -78,20 +76,21 @@ function(test_standard standard test_name base_config resource_dir output_filena add_test( NAME Regression${test_name}.SqlDiff WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${test_name} - COMMAND compare.sh + COMMAND sqldiff ${CMAKE_CURRENT_SOURCE_DIR}/${standard}/expected/${output_filename} ${output_filename} ) set_tests_properties(Regression${test_name}.SqlDiff PROPERTIES FIXTURES_REQUIRED Regression${test_name}.CreateDatabase) # Tests to diff individual tables foreach(table IN LISTS TABLES_TO_COMPARE) - configure_file(compare_table.sh ${test_name}/compare_table-${table}.sh) - add_test( NAME Regression${test_name}.SqlDiff.${table} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${test_name} - COMMAND compare_table-${table}.sh + COMMAND sqldiff --table ${table} ${CMAKE_CURRENT_SOURCE_DIR}/${standard}/expected/${output_filename} ${output_filename} ) set_tests_properties(Regression${test_name}.SqlDiff.${table} PROPERTIES FIXTURES_REQUIRED Regression${test_name}.CreateDatabase) + + # Only pass test if output is empty + set_tests_properties(Regression${test_name}.SqlDiff.${table} PROPERTIES PASS_REGULAR_EXPRESSION "^$") endforeach() endfunction() diff --git a/tests/tests_regression/compare.sh b/tests/tests_regression/compare.sh deleted file mode 100755 index 859e8044..00000000 --- a/tests/tests_regression/compare.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# When comparing the whole database, we do not care if there are differences or not. -# The tables that need to be checked have their own tests. -# The purpose of this script is solely to output the differences of the two databases -# so that they can be inspected easily. - -sqldiff ${CMAKE_CURRENT_SOURCE_DIR}/${standard}/expected/${output_filename} ${output_filename} -exit 0 diff --git a/tests/tests_regression/compare_table.sh b/tests/tests_regression/compare_table.sh deleted file mode 100755 index 1e709f07..00000000 --- a/tests/tests_regression/compare_table.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -stdout=$(sqldiff --table ${table} ${CMAKE_CURRENT_SOURCE_DIR}/${standard}/expected/${output_filename} ${output_filename}) - -if [[ $stdout ]]; then - echo $stdout - exit -1 -else - exit 0 -fi