diff --git a/tests/Makefile b/tests/Makefile index 5e8934e4..3a23d7e7 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -3,6 +3,7 @@ # TEST=GLOB run test(s) from directories matching GLOB # TEST_LOG=tty print name of a command run via the execution helpers # TEST_LOG=dump dump testing log file when a test fails +# TEST_FLAVOR test build flavor: dynamic (default), static # # TOP=path test binaries from the given path diff --git a/tests/README.md b/tests/README.md index 7b86716c..56cd1fa6 100644 --- a/tests/README.md +++ b/tests/README.md @@ -132,6 +132,9 @@ occurs, possibly allowing to continue interactively debugging. * `TEST_LOG=dump` -- dump the entire testing log when a test fails +* `TEST_FLAVOR` -- run binaries of specified flavor, which is dynamic build by + default, or *static* using all the build binaries with *.static* suffix + * `TEST_ENABLE_OVERRIDE` -- defined either as make arguments or via `tests/common.local` to enable additional arguments to some commands, using the variable(s) below (default: false, enable by setting to 'true') diff --git a/tests/common b/tests/common index 94b9d24c..de8a47cf 100644 --- a/tests/common +++ b/tests/common @@ -198,7 +198,11 @@ expand_command() if [ $i -eq $ins -a ! -z "$spec" ]; then cmd_array+=("$spec") fi - cmd_array+=("${!i}") + if [ $i -eq $command_index -a "$TEST_FLAVOR" = 'static' ]; then + cmd_array+=("${!i}".static) + else + cmd_array+=("${!i}") + fi done } @@ -376,8 +380,12 @@ check_prereq() fi ;; *) - if ! [ -f "$TOP/$1" ]; then - _fail "Failed prerequisites: $TOP/$1"; + bin="$TOP/$1" + if [ "$TEST_FLAVOR" = 'static' ]; then + bin="${bin}.static" + fi + if ! [ -f "$bin" ]; then + _fail "Failed prerequisites: $bin"; fi ;; esac