-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruntests.sh
executable file
·34 lines (33 loc) · 1.26 KB
/
runtests.sh
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
#!/bin/sh
# A Script to run tests
mkdir test-out -p
echo "SPIM Version 8.0 of January 8, 2010
Copyright 1990-2010, James R. Larus.
All Rights Reserved.
See the file README for a full copyright notice.
Loaded: /usr/lib/spim/exceptions.s" > test-out/header
for test in `ls tests/exec/*.hs`; do
echo "$test : ";
timeout 1s ./dist/build/MiniHaskell/MiniHaskell $test Base.hs > test-out/`basename -s.hs $test`.s 2> /dev/null;
if [ $? -eq 0 ];
then
echo "Compilation ok : $test";
echo "spim -ldata 100000000 -file test-out/`basename -s.hs $test`.s > test-out/`basename -s.hs $test`.out 2> /dev/null";
timeout 3s spim -ldata 100000000 -file test-out/`basename -s.hs $test`.s > test-out/`basename -s.hs $test`.out 2> /dev/null;
if [ $? -eq 0 ]
then
tail -n +6 test-out/`basename -s.hs $test`.out > test-out/`basename -s.hs $test`.out2;
echo "Run ok : $test";
if diff test-out/`basename -s.hs $test`.out2 tests/exec/`basename -s.hs $test`.out > /dev/null;
then
echo "Test ok : $test";
else
echo "Test failed : $test";
fi
else
echo "Run failed : $test";
fi
else
echo "Compilation failed : $test"
fi;
done;