Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

adding ability to run only selected tests in bt-tests.sh #64

Closed
wants to merge 1 commit into from

2 participants

@rrusnak1

This adds the ability to run a list of tests that you want to run in the B&T tests instead of running all of them.

first:
export TESTS='test1 test2 test3 etc'

then
./bt-nimbus.sh

@priteau priteau was assigned
@priteau
Owner

An equivalent functionality as been added some time ago in commit 9f49eaa.
The RUN_TESTS environment variable can contain a list of test filenames to run.

@priteau priteau closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 29 additions and 19 deletions.
  1. +29 −19 tests/bt-tests.sh
View
48 tests/bt-tests.sh
@@ -12,27 +12,37 @@ cd $src_dir
cnt="0"
error_cnt="0"
error_ts=""
-for t in *test.{sh,py}
-do
- echo $t
- ./$t 2>&1 | tee $t.log
- if [ $PIPESTATUS -ne 0 ]; then
- echo "$cnt parent tests passed (many more subtests were run)"
- echo "the test $t failed"
- error_cnt=`expr $error_cnt + 1`
- error_ts="$error_ts $t"
+
+tests_to_run () {
+echo $t
+./$t 2>&1 | tee $t.log
+if [ $PIPESTATUS -ne 0 ]; then
+ echo "$cnt parent tests passed (many more subtests were run)"
+ echo "the test $t failed"
+ error_cnt=`expr $error_cnt + 1`
+ error_ts="$error_ts $t"
+else
+ x=`grep "Ran " $t.log | grep " tests in " | sed "s/Ran //" | sed "s/tests in.*//"`
+ if [ "X$x" == "X" ]; then
+ cnt=`expr $cnt + 1`
else
- x=`grep "Ran " $t.log | grep " tests in " | sed "s/Ran //" | sed "s/tests in.*//"`
- if [ "X$x" == "X" ]; then
- cnt=`expr $cnt + 1`
- else
- for n in $x
- do
- cnt=`expr $cnt + $n`
- done
- fi
+ for n in $x
+ do
+ cnt=`expr $cnt + $n`
+ done
fi
-done
+fi
+}
+
+if [ -n "$TESTS" ]; then
+ for t in $TESTS; do
+ tests_to_run
+ done
+else
+ for t in *test.{sh,py}; do
+ tests_to_run
+ done
+fi
echo "$cnt tests passed"
echo "$error_cnt parent tests failed"
echo " $error_ts"
Something went wrong with that request. Please try again.