summaryrefslogtreecommitdiffstats
path: root/run_tests.fish
blob: 22c86d5143e402aebd0b29570f45d5aebdee737b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env fish

set d (realpath (status dirname))

cd $d/bytecode
cargo build; or return

cd $d

if test (count $argv) -gt 0
    set files $d/tests/$argv*
else
    set files $d/tests/*
end

for f in $files
    $d/bytecode/target/debug/bytecode (sml $d/main.sml -o /dev/stderr $f >/dev/null 2>| psub)
    set -l got $status
    if test $got -eq 42
        echo (basename -s.sml $f): PASS
    else
        echo (basename -s.sml $f): FAIL "(status $got)"
    end
end