-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Helper integration test suite scripts
- Loading branch information
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
logs/ | ||
tests-fail/ | ||
tests-success/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -uo pipefail | ||
|
||
cd "$( dirname "${BASH_SOURCE[0]}" )" | ||
|
||
export STACK_ROOT=$HOME/.stack | ||
unset GHC_PACKAGE_PATH | ||
|
||
DIR=$(pwd) | ||
STACK=$(stack exec which stack) | ||
|
||
if [[ ! -d "tests/$1" ]] | ||
then | ||
echo Test does not exist: $1 | ||
exit 1 | ||
fi | ||
|
||
mkdir -p tests/$1/files | ||
cd tests/$1/files | ||
echo Running test $1 | ||
exec $STACK --stack-yaml $DIR/../../stack.yaml runghc --no-ghc-package-path -- -i../../../lib ../Main.hs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -uo pipefail | ||
|
||
cd "$( dirname "${BASH_SOURCE[0]}" )" | ||
|
||
export STACK_ROOT=$HOME/.stack | ||
|
||
DIR=$(pwd) | ||
STACK=$(stack exec which stack) | ||
|
||
mkdir -p tests-success | ||
mkdir -p tests-fail | ||
mkdir -p logs | ||
|
||
cd "$DIR/tests" | ||
for f in * | ||
do | ||
cd "$DIR/tests" | ||
if [[ -d "$f" ]] | ||
then | ||
mkdir -p "$f/files" | ||
cd "$f/files" | ||
echo Running test $f | ||
$STACK --stack-yaml $DIR/../../stack.yaml runghc --no-ghc-package-path -- -i../../../lib ../Main.hs > $DIR/logs/$f 2>&1 | ||
RES=$? | ||
cd "$DIR/tests" | ||
echo Result code for $f: $RES | ||
if [[ $RES -eq 0 ]] | ||
then | ||
mv "$f" ../tests-success | ||
rm $DIR/logs/$f | ||
else | ||
mv "$f" ../tests-fail | ||
fi | ||
fi | ||
done |