diff --git a/tests/test.sh b/tests/test.sh index ed8d6a35b..571e8572a 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -188,20 +188,29 @@ function PLANNED() function RUNTESTS() { - for i in $srcdir/*.tests; do - source $i - done - echo - if [ $FAILCNT = 0 ]; then - echo " ... PASSED $(($TESTCNT - $SKIPCNT)) TESTS, $SKIPCNT SKIPPED" - #rm ,testlog - else - echo " ... SUCCEDED $(($TESTCNT - $FAILCNT - $SKIPCNT)) TESTS" - echo " ... FAILED $FAILCNT TESTS" - echo " ... SKIPPED $SKIPCNT TESTS" - echo " see ',testlog' for details" - exit 1 + if test "$TESTSUITES" != ''; then + if test ! "${TESTSUITES/* */}"; then + TESTSUITES={${TESTSUITES/ /,}} + fi fi + for t in $(eval echo *$TESTSUITES*.tests); do + echo "$t" + done | sort | uniq | { + while read i; do + source $i + done + echo + if [ $FAILCNT = 0 ]; then + echo " ... PASSED $(($TESTCNT - $SKIPCNT)) TESTS, $SKIPCNT SKIPPED" + #rm ,testlog + else + echo " ... SUCCEDED $(($TESTCNT - $FAILCNT - $SKIPCNT)) TESTS" + echo " ... FAILED $FAILCNT TESTS" + echo " ... SKIPPED $SKIPCNT TESTS" + echo " see ',testlog' for details" + exit 1 + fi + } } function TESTING() @@ -211,4 +220,6 @@ function TESTING() TESTBIN=$2 } +TESTSUITES="${TESTSUITES:+$TESTSUITES }$@" + RUNTESTS diff --git a/wiki/index.html b/wiki/index.html index 7a5c333ce..b41cbfcc9 100755 --- a/wiki/index.html +++ b/wiki/index.html @@ -3505,11 +3505,13 @@ One may define {{{TESTMODE}}} containing any one of the following strings: * {{{FAST}}} only run tests which failed recently * {{{FIRSTFAIL}}} abort the tests at the first failure +The variable {{{TESTSUITES}}} may contain a list of string which are used to select which tests are run. If not given, all available tests are run. + putting this together a very fast check (when using automake) while hacking on the source would look like: {{{ VALGRINDFLAGS=DISABLE TESTMODE=FAST+FIRSTFAIL make check }}} -This doesnt catch all errors, notably not regressions, but is useful to do coarse checks. +This doesn't catch all errors, notably not regressions, but is useful to do coarse checks. Running the testsuite with everything enabled is just: {{{