diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-07-19 12:51:56 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-07-19 13:25:18 +0300 |
commit | a301c70bebd3261ee8e872aeab2dcbc3361847c0 (patch) | |
tree | 3dfac2c8112ed28e8d03b1c465c7765bfd7d8bab | |
parent | f1590591451f135ca903e20f24ca5a9d0e7fba14 (diff) | |
download | ewww-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-x | check | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -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() { |