From 475a01f652eccea04fb8992f0c2ccb027970539d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 17 Dec 2014 15:24:31 +0200 Subject: Add support for database-specific output in tests Use that for the bulk test. --- build/bootstrap.make | 10 +- common/bulk/makefile | 4 +- common/bulk/test-mssql.std | 226 ++++++++++++++++++++++++++++++++++++++++++++ common/bulk/test-mysql.std | 0 common/bulk/test-oracle.std | 226 ++++++++++++++++++++++++++++++++++++++++++++ common/bulk/test-pgsql.std | 0 common/bulk/test-sqlite.std | 0 common/bulk/test.std | 226 -------------------------------------------- common/makefile | 2 +- tester.bat | 24 +++-- tester.in | 13 ++- 11 files changed, 490 insertions(+), 241 deletions(-) create mode 100644 common/bulk/test-mssql.std create mode 100644 common/bulk/test-mysql.std create mode 100644 common/bulk/test-oracle.std create mode 100644 common/bulk/test-pgsql.std create mode 100644 common/bulk/test-sqlite.std delete mode 100644 common/bulk/test.std diff --git a/build/bootstrap.make b/build/bootstrap.make index 7b97d74..9f749e3 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -114,25 +114,27 @@ endif # # $1 database name in the multi-database mode and empty otherwise +# $2 optional test.std file suffix (e.g., '-mysql' for test-mysql.std) # define test-schemaless-rule -$$(test$(if $1,_$1)): $$(driver) $$(src_base)/test.std +$$(test$(if $1,_$1)): $$(driver) $$(src_base)/test$2.std $$(call message,test$(if $1, [$1]) $$<,$$< $1 --options-file \ $$(dcf_root)/$(if $1,$1,$(db_id)).options >$$(out_base)/test.out) - $$(call message,,diff -u $$(src_base)/test.std $$(out_base)/test.out) + $$(call message,,diff -u $$(src_base)/test$2.std $$(out_base)/test.out) $$(call message,,rm -f $$(out_base)/test.out) endef # $1 database name in the multi-database mode and empty otherwise # $2 optional list of schema files, by default test.sql +# $3 optional test.std file suffix (e.g., '-mysql' for test-mysql.std) # define test-rule -$$(test$(if $1,_$1)): $$(driver) $$(src_base)/test.std +$$(test$(if $1,_$1)): $$(driver) $$(src_base)/test$3.std $$(call schema$(if $1,-$1),$2) $$(call message,test$(if $1, [$1]) $$<,$$< $1 --options-file \ $$(dcf_root)/$(if $1,$1,$(db_id)).options >$$(out_base)/test.out) - $$(call message,,diff -u $$(src_base)/test.std $$(out_base)/test.out) + $$(call message,,diff -u $$(src_base)/test$3.std $$(out_base)/test.out) $$(call message,,rm -f $$(out_base)/test.out) endef diff --git a/common/bulk/makefile b/common/bulk/makefile index 2107cd2..481fef3 100644 --- a/common/bulk/makefile +++ b/common/bulk/makefile @@ -68,9 +68,9 @@ $(dist): # Test. # ifneq ($(db_id),common) -$(eval $(call test-rule)) +$(eval $(call test-rule,,,-$(db_id))) else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) +$(foreach d,$(databases),$(eval $(call test-rule,$d,,-sqlite))) endif # Clean. diff --git a/common/bulk/test-mssql.std b/common/bulk/test-mssql.std new file mode 100644 index 0000000..e72869d --- /dev/null +++ b/common/bulk/test-mssql.std @@ -0,0 +1,226 @@ +multiple exceptions, 1 element attempted, 1 failed: +[0] object already persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object already persistent +[1] object already persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent +[3] object already persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent +[3] object already persistent +[4] object already persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent +[3] object already persistent +[4] object already persistent +[5] object already persistent + +multiple exceptions, 2 elements attempted, 1 failed: +[1] object already persistent + +multiple exceptions, 2 elements attempted, 1 failed: +[0] object already persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[1] object already persistent +[2] object already persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[0] object already persistent +[2] object already persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[0] object already persistent +[1] object already persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object already persistent +[1] object already persistent +[3] object already persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent + +multiple exceptions, 7 elements attempted, 3 failed: +[1] object already persistent +[3] object already persistent +[5] object already persistent + +multiple exceptions, 3 elements attempted, 1 failed: +[2] object already persistent + +multiple exceptions, 1 element attempted, 1 failed: +[0] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object not persistent +[1] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent +[5] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 7 elements attempted, 7 failed: +[0-5] (some) object not persistent +[6] object not persistent + +multiple exceptions, 7 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[6] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 1 element attempted, 1 failed: +[0] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object not persistent +[1] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent +[5] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 8 elements attempted, 8 failed: +[0-7] (some) object not persistent + +multiple exceptions, 10 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[6] object not persistent +[7] object not persistent +[8] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object changed concurrently +[3] object changed concurrently + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object changed concurrently +[3] object changed concurrently + diff --git a/common/bulk/test-mysql.std b/common/bulk/test-mysql.std new file mode 100644 index 0000000..e69de29 diff --git a/common/bulk/test-oracle.std b/common/bulk/test-oracle.std new file mode 100644 index 0000000..e72869d --- /dev/null +++ b/common/bulk/test-oracle.std @@ -0,0 +1,226 @@ +multiple exceptions, 1 element attempted, 1 failed: +[0] object already persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object already persistent +[1] object already persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent +[3] object already persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent +[3] object already persistent +[4] object already persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent +[3] object already persistent +[4] object already persistent +[5] object already persistent + +multiple exceptions, 2 elements attempted, 1 failed: +[1] object already persistent + +multiple exceptions, 2 elements attempted, 1 failed: +[0] object already persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[1] object already persistent +[2] object already persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[0] object already persistent +[2] object already persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[0] object already persistent +[1] object already persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object already persistent +[1] object already persistent +[3] object already persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent + +multiple exceptions, 7 elements attempted, 3 failed: +[1] object already persistent +[3] object already persistent +[5] object already persistent + +multiple exceptions, 3 elements attempted, 1 failed: +[2] object already persistent + +multiple exceptions, 1 element attempted, 1 failed: +[0] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object not persistent +[1] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent +[5] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 7 elements attempted, 7 failed: +[0-5] (some) object not persistent +[6] object not persistent + +multiple exceptions, 7 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[6] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 1 element attempted, 1 failed: +[0] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object not persistent +[1] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent +[5] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 8 elements attempted, 8 failed: +[0-7] (some) object not persistent + +multiple exceptions, 10 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[6] object not persistent +[7] object not persistent +[8] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object changed concurrently +[3] object changed concurrently + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object changed concurrently +[3] object changed concurrently + diff --git a/common/bulk/test-pgsql.std b/common/bulk/test-pgsql.std new file mode 100644 index 0000000..e69de29 diff --git a/common/bulk/test-sqlite.std b/common/bulk/test-sqlite.std new file mode 100644 index 0000000..e69de29 diff --git a/common/bulk/test.std b/common/bulk/test.std deleted file mode 100644 index e72869d..0000000 --- a/common/bulk/test.std +++ /dev/null @@ -1,226 +0,0 @@ -multiple exceptions, 1 element attempted, 1 failed: -[0] object already persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0] object already persistent -[1] object already persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent -[3] object already persistent - -multiple exceptions, 5 elements attempted, 5 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent -[3] object already persistent -[4] object already persistent - -multiple exceptions, 6 elements attempted, 6 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent -[3] object already persistent -[4] object already persistent -[5] object already persistent - -multiple exceptions, 2 elements attempted, 1 failed: -[1] object already persistent - -multiple exceptions, 2 elements attempted, 1 failed: -[0] object already persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[1] object already persistent -[2] object already persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[0] object already persistent -[2] object already persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[0] object already persistent -[1] object already persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object already persistent -[1] object already persistent -[3] object already persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent - -multiple exceptions, 7 elements attempted, 3 failed: -[1] object already persistent -[3] object already persistent -[5] object already persistent - -multiple exceptions, 3 elements attempted, 1 failed: -[2] object already persistent - -multiple exceptions, 1 element attempted, 1 failed: -[0] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0] object not persistent -[1] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent - -multiple exceptions, 5 elements attempted, 5 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent - -multiple exceptions, 6 elements attempted, 6 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent -[5] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0-1] (some) object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0-1] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 7 elements attempted, 7 failed: -[0-5] (some) object not persistent -[6] object not persistent - -multiple exceptions, 7 elements attempted, 4 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[6] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 1 element attempted, 1 failed: -[0] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0] object not persistent -[1] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent - -multiple exceptions, 5 elements attempted, 5 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent - -multiple exceptions, 6 elements attempted, 6 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent -[5] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0-1] (some) object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0-1] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 8 elements attempted, 8 failed: -[0-7] (some) object not persistent - -multiple exceptions, 10 elements attempted, 6 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[6] object not persistent -[7] object not persistent -[8] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object changed concurrently -[3] object changed concurrently - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object changed concurrently -[3] object changed concurrently - diff --git a/common/makefile b/common/makefile index 04e3efa..7f99cf4 100644 --- a/common/makefile +++ b/common/makefile @@ -64,7 +64,7 @@ cxx11_tests := session/custom no_dist_tests := changelog include -no_multi_tests := bulk changelog include +no_multi_tests := changelog include $(default): $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/tester.bat b/tester.bat index 95513fd..396070a 100644 --- a/tester.bat +++ b/tester.bat @@ -33,10 +33,26 @@ if exist test*.sql ( ) ) -if exist test.std ( +if exist test-%1.std ( + set "std=test-%1.std" +) else ( + if exist test.std ( + set "std=test.std" + ) else ( + set "std=" + ) +) + +if "_%std%" == "__" ( + + %dir%\driver.exe --options-file %topdir%\%1.options + if errorlevel 1 goto error + +) else ( + %dir%\driver.exe --options-file %topdir%\%1.options >test.out if errorlevel 1 goto error - %DIFF% test.std test.out + %DIFF% %std% test.out if errorlevel 1 ( del /f test.out @@ -46,10 +62,6 @@ if exist test.std ( del /f test.out goto end -) else ( - - %dir%\driver.exe --options-file %topdir%\%1.options - if errorlevel 1 goto error ) goto end diff --git a/tester.in b/tester.in index f9beb02..b653019 100755 --- a/tester.in +++ b/tester.in @@ -26,7 +26,16 @@ done echo ./driver --options-file "$db_options" -if test -f "$srcdir/test.std"; then +std= +if test -f "$srcdir/test-@database@.std"; then + std="$srcdir/test-@database@.std" +elif test -f "$srcdir/test.std"; then + std="$srcdir/test.std" +else + std= +fi + +if test -n "$std"; then ./driver --options-file "$db_options" >test.out if test $? -ne 0; then @@ -34,7 +43,7 @@ if test -f "$srcdir/test.std"; then exit 1 fi - @DIFF@ @DIFFFLAGS@ "$srcdir/test.std" test.out + @DIFF@ @DIFFFLAGS@ "$std" test.out r=$? rm -f test.out exit $r -- cgit v1.1