add wrapper for shelltest

This commit is contained in:
Greg Weber 2011-07-15 08:41:07 -07:00
parent 67fc2f8aa7
commit ab30fdcfe6
4 changed files with 22 additions and 12 deletions

View File

@ -2,9 +2,11 @@
## Test suite
install the shelltest package: cabal install shelltests
Run this from the project root directory. It will make sure each site type builds. It first does an sdist, which ensures we are testing what will be put on hackage.
shelltest tests/scaffold.shelltest
tests/run.sh
Give it the --debug flag to see all output

17
tests/run.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash -x
#
# A wrapper for the shelltest test. Passes along options to shelltest.
#
# cabal install shelltestrunner
cabal clean && cabal install && cabal sdist
# I am not that good at shell scripting
# this for loop only operates on 1 file (as per tail -1)
for f in $(ls -1rt dist/*.tar.gz | tail -1)
do
tar -xzvf $f && cd `basename $f .tar.gz`
shelltest ../tests/scaffold.shelltest $@
cd ..
rm -r `basename $f .tar.gz`
done

View File

@ -1,3 +1,3 @@
#!/bin/bash -x
rm -rf foobar && runghc scaffold.hs init && cd foobar && cabal install && cabal install -fdevel && cd ..
rm -rf foobar && runghc scaffold.hs init && cd foobar && cabal install && cabal install -fdevel && cd ..

View File

@ -1,13 +1,4 @@
# This uses shelltest
#
# cabal install shelltestrunner
# shelltest tests/scaffold.shelltest
#
# note that the first 2 lines setup this test but will also be counted as 2 tests.
cabal clean && cabal install && cabal sdist
for f in $(ls -1rt dist/*.tar.gz | tail -1); do tar -xzvf $f && cd `basename $f .tar.gz`; done
# Important! run with tests/run.sh
rm -rf foobar && runghc scaffold.hs init && cd foobar && cabal install && cabal install -fdevel && cd ..
<<<