From 8da99509449498658468051551eef820f92199d7 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Thu, 29 Sep 2011 10:42:23 +0200 Subject: Bug #12373393 PB2 SHOULD ALLOW TO CREATE COLLECTIONS AS SUPER SET OF EXISTING COLLECTIONS Let CMake parse files with a ".in" suffix containing includes Added default.release.in to replace default.release Explained in README New patch: replace 'include' with '#include' to avoid accidental matches --- mysql-test/CMakeLists.txt | 23 +++++++++++++++++++++++ mysql-test/collections/README | 8 ++++++++ mysql-test/collections/default.release | 11 ----------- mysql-test/collections/default.release.in | 17 +++++++++++++++++ 4 files changed, 48 insertions(+), 11 deletions(-) delete mode 100644 mysql-test/collections/default.release create mode 100644 mysql-test/collections/default.release.in (limited to 'mysql-test') diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt index 655d8e086eb..954e9c44311 100644 --- a/mysql-test/CMakeLists.txt +++ b/mysql-test/CMakeLists.txt @@ -132,3 +132,26 @@ ADD_CUSTOM_TARGET(test-bt-debug COMMAND ${MTR_FORCE} --comment=debug --timer --skip-ndbcluster --skip-rpl --report-features ${EXP} ) +# Process .in files with includes in collections/ + +MACRO(PROCESS_COLLECTION_INCLUDE collin collection) + FILE(STRINGS ${collin} inlines) + FOREACH(line ${inlines}) + IF(${line} MATCHES "#include .*") + STRING(REPLACE "#include " "collections/" incfile ${line}) + FILE(READ ${incfile} contents) + FILE(APPEND ${collection} "${contents}") + ELSE() + FILE(APPEND ${collection} "${line}\n") + ENDIF() + ENDFOREACH() +ENDMACRO() + +FILE(GLOB infiles "collections/*.in") +FOREACH(collin ${infiles}) + STRING(REPLACE ".in" "" collection ${collin}) + # Only generate file once + IF(NOT EXISTS ${collection}) + PROCESS_COLLECTION_INCLUDE(${collin} ${collection}) + ENDIF() +ENDFOREACH() diff --git a/mysql-test/collections/README b/mysql-test/collections/README index 9af84646a40..f64c089ee99 100644 --- a/mysql-test/collections/README +++ b/mysql-test/collections/README @@ -28,3 +28,11 @@ these steps: 5) The commands from the collection are run line by line via execv() or similar system calls. They are not run as a shell script. Shell expansions are not guaranteed to work and most likely won't. + +The directory may contain collections that are "super sets" of others, +identified by a file name suffix ".in". These files may contain lines +"#include ", or lines with mysql-test-run.pl invocations. +CMake will create a new file without the .in suffix where +the include lines are replaced with the contents of the referred +file. Filename is local to the collections directory, and includes do +not nest. diff --git a/mysql-test/collections/default.release b/mysql-test/collections/default.release deleted file mode 100644 index 108e1032ca2..00000000000 --- a/mysql-test/collections/default.release +++ /dev/null @@ -1,11 +0,0 @@ -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=debug --vardir=var-debug --skip-ndbcluster --skip-rpl --report-features --debug-server -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --skip-ndbcluster --report-features -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --skip-ndbcluster --ps-protocol -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=funcs1+ps --vardir=var-funcs_1_ps --suite=funcs_1 --ps-protocol -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2 -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=jp --vardir=var-jp --suite=jp -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded-server --skip-rpl --skip-ndbcluster -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=nist --vardir=var-nist --suite=nist -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=nist+ps --vardir=var-nist_ps --suite=nist --ps-protocol diff --git a/mysql-test/collections/default.release.in b/mysql-test/collections/default.release.in new file mode 100644 index 00000000000..0e3ad30671b --- /dev/null +++ b/mysql-test/collections/default.release.in @@ -0,0 +1,17 @@ +# This file contains the old default.release, the plan is to replace that +# with something like the below (remove space after #): + +# include default.daily +# include default.weekly + +perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=debug --vardir=var-debug --skip-ndbcluster --skip-rpl --report-features --debug-server +perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --skip-ndbcluster --report-features +perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --skip-ndbcluster --ps-protocol +perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=funcs1+ps --vardir=var-funcs_1_ps --suite=funcs_1 --ps-protocol +perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2 +perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts +perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress +perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=jp --vardir=var-jp --suite=jp +perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded-server --skip-rpl --skip-ndbcluster +perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=nist --vardir=var-nist --suite=nist +perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=nist+ps --vardir=var-nist_ps --suite=nist --ps-protocol -- cgit v1.2.1