aboutsummaryrefslogtreecommitdiff
path: root/tools/test.nom
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-20 14:52:59 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-20 14:54:40 -0800
commit2bbc035f5dcc3ecd62724b9d1de0e7e3ea902379 (patch)
tree34a83497f7570946b6252183b3e8fe0ce2010595 /tools/test.nom
parentf30413853063483147d941ffccc4b663b71bc943 (diff)
Simplifying the filesystem code (no longer entangled with nomsupath) and
using that to simplify the tools. Now the tools directly take lists of file paths rather than things that might go through nomsupath or directories or get processed by filetype. Use your shell for globbing stuff like `nomsu tools/test.nom core/*.nom`
Diffstat (limited to 'tools/test.nom')
-rwxr-xr-xtools/test.nom24
1 files changed, 5 insertions, 19 deletions
diff --git a/tools/test.nom b/tools/test.nom
index bdbec54..52e548f 100755
--- a/tools/test.nom
+++ b/tools/test.nom
@@ -8,24 +8,10 @@ use "lib/consolecolor.nom"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-%args = (command line args)
-if (%args.1 == "-v"):
- %args::remove index 1
- %verbose = (yes)
-
-%to_run = [..]
- :
- for %path in (command line args):
- for %filename in (files for %path):
- if (%filename == "-"):
- %filename = "stdin"
- if ((%filename::matches "%.nom$") or (%filename == "stdin")): add %filename
-
# Make sure all the files get run
-for %filename in %to_run:
- use %filename
+for %filename in (command line args).extra_args: use %filename
%tests = {: for %s = %t in (tests): add (=lua "Source:from_string(\%s)") = %t}
-for %filename in %to_run:
+for %filename in (command line args).extra_args:
%file_tests = []
for %src = %test in %tests:
if (%src.filename == %filename):
@@ -34,13 +20,13 @@ for %filename in %to_run:
unless (%file_tests is empty):
sort %file_tests by % -> %.source
lua> "io.write('[ .. ] ', \%filename); io.flush()"
- if %verbose: say ""
+ if (command line args)."-v": say ""
for % in %file_tests:
- if %verbose:
+ if (command line args)."-v":
say " \(yellow (%.test::with "\n" -> "\n "))"
run %.test
- if %verbose:
+ if (command line args)."-v":
say (green "PASS")
..else:
say "\r[\(green "PASS")"