aboutsummaryrefslogtreecommitdiff
path: root/tools/test.nom
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-12-30 19:04:34 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-12-30 19:04:45 -0800
commit8a3c32408733a2f5e14f8a2dbafa3f980b2f73a1 (patch)
tree68f1e8a8b956c33ed24cc7a6a369fd97b8849321 /tools/test.nom
parent359152da1772ce501609edd8f84b4985ed3e42f2 (diff)
Update to new syntax.
Diffstat (limited to 'tools/test.nom')
-rwxr-xr-xtools/test.nom15
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/test.nom b/tools/test.nom
index 7b5842c..0202675 100755
--- a/tools/test.nom
+++ b/tools/test.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V5.12.12.8
+#!/usr/bin/env nomsu -V6.12.12.8
#
Tool to run all tests in a file (i.e. the code block inside a call to 'test %'). Usage:
nomsu tools/test.nom file1 file2 directory1 ...
@@ -13,21 +13,26 @@ for $filename in $(COMMAND LINE ARGS).extras: use $filename
$tests = {: for $s = $t in $TESTS: add (=lua "Source:from_string(\$s)") = $t}
for $filename in $(COMMAND LINE ARGS).extras:
$file = (read file $filename)
- $version = ($file|matching "#![^\n]* nomsu %-V[ ]*([^\n]*)")
+ $version = ($file, matching "#![^\n]* nomsu %-V[ ]*([^\n]*)")
$file_tests = []
for $src = $test in $tests:
if ($src.filename == $filename):
if $version:
- $test = "#!/usr/bin/env nomsu -V\$version\n\$test"
- $file_tests|add {test: $test, source: $src}
+ $test = ("
+ #!/usr/bin/env nomsu -V\$version
+ \$test
+ ")
+ $file_tests, add {.test = $test, .source = $src}
unless ($file_tests is empty):
sort $file_tests by $ -> $.source
lua> "io.write('[ .. ] ', \$filename); io.flush()"
+
if (command line args)."-v": say ""
+
for $ in $file_tests:
if (command line args)."-v":
- say " \(yellow ($.test|with "\n" -> "\n "))"
+ say " \(yellow ($.test, with "\n" -> "\n "))"
run $.test
if (command line args)."-v":