This is how we should do builds and tests for Haskell projects.
Cat's Eye Technologies
8 years ago
|
0 |
#!/bin/sh
|
|
1 |
|
|
2 |
if [ -z `which ghc` -a -z x`which runhugs` ]; then
|
|
3 |
echo "Neither ghc nor runhugs found on search path."
|
|
4 |
exit 1
|
|
5 |
fi
|
|
6 |
|
|
7 |
mkdir -p bin
|
|
8 |
|
|
9 |
if [ -z `which ghc` -o ! -z $USE_HUGS ]; then
|
|
10 |
# create script to run with Hugs
|
|
11 |
cat >bin/iphi <<'EOF'
|
|
12 |
#!/bin/sh
|
|
13 |
THIS=`realpath $0`
|
|
14 |
DIR=`dirname $THIS`/../src
|
|
15 |
runhugs $DIR/Main.hs $*
|
|
16 |
EOF
|
|
17 |
chmod 755 bin/iphi
|
|
18 |
else
|
|
19 |
cd src && ghc --make Main.hs -o ../bin/iphi
|
|
20 |
fi
|
0 | 0 |
#!/bin/sh
|
1 | 1 |
|
2 | |
cd src && make iphi && cd ..
|
3 | |
falderal test tests/Iphigeneia.markdown && echo "All tests passed!"
|
4 | |
rm -f foo.txt
|
5 | |
#cd src && make clean && cd ..
|
|
2 |
falderal test tests/Iphigeneia.markdown
|
3 | 3 |
This test suite is in the format of Falderal version 0.7.
|
4 | 4 |
|
5 | 5 |
-> Functionality "Interpret Iphigeneia program" is implemented by
|
6 | |
-> shell command "src/iphi %(test-file)"
|
|
6 |
-> shell command "bin/iphi %(test-file)"
|
7 | 7 |
|
8 | 8 |
-> Tests for functionality "Interpret Iphigeneia program"
|
9 | 9 |
|