-
Notifications
You must be signed in to change notification settings - Fork 3
/
auto-test
executable file
·46 lines (38 loc) · 1.06 KB
/
auto-test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/env fish
# test_bf ::
# FilePath -> -- ^ Haskell code to be compiled and run
# String -> -- ^ Expected output
# IO ()
function test_bf
set hs_path $argv[1]
set bf_path test/(basename $argv[1] .hs).bf
set expected $argv[2]
echo "=== $hs_path ==="
rm -f $bf_path
dist/build/hs2bf/hs2bf --make $hs_path > $bf_path
set result (time -f 'user:%U sys:%S' bfi/bfi $bf_path)
if test "$result" = "$expected"
set_color green
echo "PASSED"
set_color normal
else
set_color red
echo "FAILED"
set_color normal
echo "expected: " $expected
echo "actual: " $result
end
echo ""
end
test_bf test/Halt.hs ""
and test_bf test/Const.hs "~"
and test_bf test/ExplicitCase.hs "o"
and test_bf test/Hello.hs "Hello!"
and test_bf test/LocalFun.hs "~"
and test_bf test/Lambda.hs "A"
and test_bf test/Arithmetic.hs "o"
and test_bf test/ShowList.hs "123"
and test_bf test/QuickSort.hs "best"
# and test_bf test/TypeClass.hs
# and test_bf test/ConstPattern.hs
# and test_bf test/