0 | 0 |
#!/bin/sh
|
1 | 1 |
|
2 | |
if [ x`which ghc` = x -a x`which runhugs` = x ]; then
|
3 | |
echo "Neither ghc nor runhugs found on search path"
|
4 | |
exit 1
|
|
2 |
./build.sh || exit 1
|
|
3 |
|
|
4 |
FILES="tests/Hev.markdown"
|
|
5 |
if [ x$USE_HUGS = x ]; then
|
|
6 |
FILES="$FILES tests/Internals.markdown"
|
5 | 7 |
fi
|
6 | 8 |
|
7 | |
touch fixture.markdown
|
8 | |
touch Internals.markdown
|
9 | |
|
10 | |
if [ ! x`which ghc` = x ]; then
|
11 | |
cat >>fixture.markdown <<EOF
|
12 | |
-> Functionality "Parse Hev Program" is implemented by
|
13 | |
-> shell command
|
14 | |
-> "ghc src/Hev.hs -e "parse \"%(test-body-text)\"""
|
15 | |
|
16 | |
-> Functionality "Compile Hev Program" is implemented by
|
17 | |
-> shell command
|
18 | |
-> "ghc src/Hev.hs -e "compile \"%(test-body-text)\"""
|
19 | |
|
20 | |
-> Functionality "Hev Binding" is implemented by
|
21 | |
-> shell command
|
22 | |
-> "ghc src/Hev.hs -e "getBinding \"%(test-body-text)\" (UnifierBinding \"-\" TreeLeaf (UnifierBinding \"+\" (TreeBranch TreeLeaf TreeLeaf) UnifierNil))""
|
23 | |
|
24 | |
-> Functionality "Hev Matching" is implemented by
|
25 | |
-> shell command
|
26 | |
-> "ghc src/Hev.hs -e "match %(test-body-text)""
|
27 | |
|
28 | |
-> Functionality "Hev Rewriting" is implemented by
|
29 | |
-> shell command
|
30 | |
-> "ghc src/Hev.hs -e "rewrite %(test-body-text)""
|
31 | |
|
32 | |
-> Functionality "Hev Execution" is implemented by
|
33 | |
-> shell command
|
34 | |
-> "ghc src/Hev.hs -e "run (compile \"%(test-body-text)\")""
|
35 | |
|
36 | |
EOF
|
37 | |
cp tests/Internals.markdown .
|
38 | |
fi
|
39 | |
|
40 | |
if [ ! x`which runhugs` = x ]; then
|
41 | |
cat >>fixture.markdown <<EOF
|
42 | |
-> Functionality "Parse Hev Program" is implemented by
|
43 | |
-> shell command
|
44 | |
-> "runhugs src/Main.hs parse %(test-body-file)"
|
45 | |
|
46 | |
-> Functionality "Compile Hev Program" is implemented by
|
47 | |
-> shell command
|
48 | |
-> "runhugs src/Main.hs compile %(test-body-file)"
|
49 | |
|
50 | |
-> Functionality "Hev Binding" is implemented by
|
51 | |
-> shell command
|
52 | |
-> "runhugs src/Main.hs getbinding %(test-body-file)"
|
53 | |
|
54 | |
-> Functionality "Hev Execution" is implemented by
|
55 | |
-> shell command
|
56 | |
-> "runhugs src/Main.hs run %(test-body-file)"
|
57 | |
|
58 | |
EOF
|
59 | |
fi
|
60 | |
|
61 | |
falderal fixture.markdown Internals.markdown tests/Hev.markdown
|
62 | |
RESULT=$?
|
63 | |
rm -f fixture.markdown Internals.markdown
|
64 | |
exit $RESULT
|
|
9 |
falderal $FILES
|