]> granicus.if.org Git - jq/commitdiff
Make it possible to run tests with set -x
authorNicolas Williams <nico@cryptonector.com>
Sun, 17 Jan 2016 18:23:05 +0000 (12:23 -0600)
committerNicolas Williams <nico@cryptonector.com>
Sun, 17 Jan 2016 18:45:01 +0000 (12:45 -0600)
One can now run:

    make TRACE_TESTS=1 check

to get detailed output

tests/jqtest
tests/mantest
tests/onigtest
tests/optionaltest
tests/setup
tests/shtest

index 8df5f110070a4e364a11105a7da32361862a01d7..2420e0378ffe16734cc6c0ca82c603b128c8c4bb 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-. "${0%/*}/setup"
+. "${0%/*}/setup" "$@"
 
 $VALGRIND $Q $JQ -L "$mods" --run-tests $JQTESTDIR/jq.test
index 46aae405c5287e94aa7eec1b5e81b1d777a37752..c5acf925945d95116e9d416211825db4a6ce7e14 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-. "${0%/*}/setup"
+. "${0%/*}/setup" "$@"
 
 # We set PAGER because there's a mantest for `env` that uses it.
 (cd $JQBASEDIR/docs && rake mantests) |
index 55c26bd29dbade878721b51ab82d0f7b2aba26db..f4521938059ec9ad3fea7037f863b322285f25bc 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-. "${0%/*}/setup"
+. "${0%/*}/setup" "$@"
 
 $VALGRIND $Q $JQ -L "$mods" --run-tests $JQTESTDIR/onig.test
index b2444a402ad0aa94c078babae869c03b0c33dd7a..1de0a495fe58648231aaf2f16d09dca2b9382272 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-. "${0%/*}/setup"
+. "${0%/*}/setup" "$@"
 
 $VALGRIND $Q $JQ -L "$mods" --run-tests $JQTESTDIR/optional.test
index d64ba29ca5653be51d1c2408930550f0cb3cf7e3..94bcf1ebfef3425b0d4852f6809f4e3491f572c4 100755 (executable)
@@ -2,6 +2,10 @@
 
 # This is meant to be included by each test's shell script driver.
 
+if [ -n "$TRACE_TESTS" ]; then
+    set -x
+fi
+
 set -eu
 
 JQTESTDIR=$(cd "$(dirname "$0")" && pwd)
index 89ae61772cc13d4766c92de2201eadca72cc37cd..2614e90062d1a71bb07e6427ad78265bf573cffc 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-. "${0%/*}/setup"
+. "${0%/*}/setup" "$@"
 
 PATH=$JQBASEDIR:$PATH $JQBASEDIR/tests/jq-f-test.sh > /dev/null