summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-07-19 12:51:56 +0300
committerLars Wirzenius <liw@liw.fi>2020-07-19 13:25:18 +0300
commita301c70bebd3261ee8e872aeab2dcbc3361847c0 (patch)
tree3dfac2c8112ed28e8d03b1c465c7765bfd7d8bab
parentf1590591451f135ca903e20f24ca5a9d0e7fba14 (diff)
downloadewww-a301c70bebd3261ee8e872aeab2dcbc3361847c0.tar.gz
test: add -c (--codegen) option to generate test program, not run it
This makes it easier to run only specific tests, or to specify a log file for the test program.
-rwxr-xr-xcheck20
1 files changed, 16 insertions, 4 deletions
diff --git a/check b/check
index 8d7e56e..912a005 100755
--- a/check
+++ b/check
@@ -3,14 +3,21 @@
set -eu
verbose=false
-if [ "$#" -gt 0 ]
-then
+runtest=true
+moar=true
+while [ "$#" -gt 0 ] && $moar
+do
case "$1" in
verbose | -v | --verbose)
verbose=true
+ shift 1
+ ;;
+ -c | --codegen)
+ runtest=false
+ shift 1
;;
esac
-fi
+done
hideok=
if command -v chronic > /dev/null
@@ -26,7 +33,12 @@ fi
codegen() {
- $hideok sp-codegen "$1" --output "$2" --run
+ local run=
+ if $runtest
+ then
+ run=--run
+ fi
+ $hideok sp-codegen "$1" --output "$2" $run
}
docgen() {