1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#!/bin/bash
IN="$1"
if [[ "$IN" == *.zip ]]
then
extract="7z x -y $IN"
dir=$(basename "$IN" .zip)
else
extract="tar xzf $IN"
dir=$(basename "$IN" .tar.gz)
fi
echo "Making sure the release $(basename "$IN") works..."
mkdir -p $STORM_ROOT/release/$dir
cd $STORM_ROOT/release/$dir
echo "Extracting..."
$extract > /dev/null
echo "Launching REPL..."
echo "exit" | ./storm > /dev/null
if [[ $? -ne 0 ]]
then
echo "Failed to launch the REPL. Something is bad! Test in release/storm"
exit 1
fi
echo "Running basic tests..."
./storm -c 'tests:bf:inlineBf' > output.txt
if [[ $? -ne 0 ]]
then
echo "Failed to execute BS code. Test in release/storm"
exit 1
fi
grep "1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89" output.txt > /dev/null
if [[ $? -ne 0 ]]
then
echo "Failed to execute BS code. Test in release/storm"
exit 1
fi
echo "Cleaning up..."
cd $STORM_ROOT
rm -r $STORM_ROOT/release/$dir
echo "Done!"
|