summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-12-20 12:22:06 +0200
committerLars Wirzenius <liw@liw.fi>2020-12-20 15:54:14 +0200
commit5a5064482f513e68a4a878898f21a577ab5f59ec (patch)
tree55aa6917fe4d205111b2b3266d5ccb59e1275406 /check
parentbd66c9fbe065fcf9eb49a0572443808f8d37133a (diff)
downloadsubplot-5a5064482f513e68a4a878898f21a577ab5f59ec.tar.gz
test: run test program with --log, if Python
This makes it easier to debug failures when ./check fails. For example, when build is run in CI.
Diffstat (limited to 'check')
-rwxr-xr-xcheck11
1 files changed, 9 insertions, 2 deletions
diff --git a/check b/check
index 447011b..10c0303 100755
--- a/check
+++ b/check
@@ -26,8 +26,15 @@ fi
codegen() {
- $hideok cargo run $quiet --bin sp-codegen -- "$1" --output "$2" --run \
- --templates "$(pwd)/templates"
+ $hideok cargo run $quiet --bin sp-codegen -- \
+ "$1" --output "$2" --templates "$(pwd)/templates"
+ rm -f test.log
+ template="$(sed -n '/^template: /s///p' "$1" | tail -n1)"
+ case "$template" in
+ python) $hideok python3 "$2" --log test.log ;;
+ bash) $hideok bash "$2" ;;
+ *) echo "Don't know interpreter for $2" ; exit 1 ;;
+ esac
}
docgen() {