diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2017-04-15 16:30:41 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2017-04-15 16:30:41 +0200 |
commit | 355b457c97a55c9ee16ef2f81fc06d49c47c129b (patch) | |
tree | 42938f6118a904bbefbe82c7a520fa7e80eb5cfb /test/runTest | |
parent | abe255d51bc450ee9c0ac1a4486b4d7d10c9794f (diff) |
Compile tests into one file to reduce time spent on setup
Diffstat (limited to 'test/runTest')
-rwxr-xr-x | test/runTest | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/test/runTest b/test/runTest index b8713d8..adeb84e 100755 --- a/test/runTest +++ b/test/runTest @@ -1,15 +1,12 @@ #!/bin/bash -. "$(dirname ${BASH_SOURCE[0]})/lib/common.inc" - -for t in "$(dirname ${BASH_SOURCE[0]})/test.d/"*.sh; do - l=$(basename ${t} .sh) - if [ -x ${t} ]; then - msg "Running test '${l}'" - ${t} - [ $? -ne 0 ] && die "Test '${l}' failed" - echo -e "\n\n\n" - else - warning "Skipping test ${l}" - fi -done +curdir=$(readlink -e $(dirname $0)) + +testSuite=$(mktemp) +trap "rm -rf '${testSuite}'" EXIT + +echo ". ${curdir}/lib/common.inc" > ${testSuite} +cat "${curdir}/test.d"/*.sh >> ${testSuite} +echo ". ${curdir}/lib/shunit2" >> ${testSuite} + +bash ${testSuite} |