Test with both ghc and Hugs.
Cat's Eye Technologies
10 years ago
56 | 56 |
-------------
|
57 | 57 |
|
58 | 58 |
-> Tests for functionality "Interpret Flobnar program"
|
59 | |
|
60 | |
-> Functionality "Interpret Flobnar program" is implemented by
|
61 | |
-> shell command
|
62 | |
-> "ghc src/Flobnar.hs -e "do c <- readFile \"%(test-body-file)\"; putStr $ showRun c""
|
63 | 59 |
|
64 | 60 |
Basics of Execution
|
65 | 61 |
-------------------
|
|
0 |
module Main where
|
|
1 |
|
|
2 |
import System.Environment
|
|
3 |
import Flobnar
|
|
4 |
|
|
5 |
main = do
|
|
6 |
[fileName] <- getArgs
|
|
7 |
c <- readFile fileName
|
|
8 |
putStr $ showRun c
|
0 | 0 |
#!/bin/sh
|
1 | |
falderal -b README.markdown
|
|
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
|
|
5 |
fi
|
|
6 |
|
|
7 |
touch fixture.markdown
|
|
8 |
|
|
9 |
if [ ! x`which ghc` = x ]; then
|
|
10 |
cat >>fixture.markdown <<EOF
|
|
11 |
-> Functionality "Interpret Flobnar program" is implemented by
|
|
12 |
-> shell command
|
|
13 |
-> "ghc src/Flobnar.hs -e "do c <- readFile \"%(test-body-file)\"; putStr $ showRun c""
|
|
14 |
|
|
15 |
EOF
|
|
16 |
fi
|
|
17 |
|
|
18 |
if [ ! x`which runhugs` = x ]; then
|
|
19 |
cat >>fixture.markdown <<EOF
|
|
20 |
-> Functionality "Interpret Flobnar program" is implemented by
|
|
21 |
-> shell command
|
|
22 |
-> "runhugs src/Main.hs %(test-body-file)"
|
|
23 |
|
|
24 |
EOF
|
|
25 |
fi
|
|
26 |
|
|
27 |
falderal -b fixture.markdown README.markdown
|
|
28 |
rm -f fixture.markdown
|