-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrunTests.sh
executable file
·67 lines (58 loc) · 1.66 KB
/
runTests.sh
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
GREEN=`echo -e "\033[92m"`
DARK_GREEN=`echo -e "\033[1;32m"`
RED=`echo -e "\033[1;31m"`
CYAN=`echo -e "\033[96m"`
BLUE=`echo -e "\033[94m"`
YELLOW=`echo -e "\033[1;33m"`
PURPLE=`echo -e "\033[95m"`
RESET=`echo -e "\033[0m"`
L_GREEN=`echo "\033[92m"`
L_DARK_GREEN=`echo "\033[1;32m"`
L_RED=`echo "\033[1;31m"`
L_CYAN=`echo "\033[96m"`
L_BLUE=`echo "\033[94m"`
L_YELLOW=`echo "\033[1;33m"`
L_PURPLE=`echo "\033[95m"`
L_RESET=`echo "\033[0m"`
test_passed="s/✔\|√/${DARK_GREEN}&${RESET}/g;"
test_failed="s/✗\|Х/${RED}&${RESET}/g;"
test_timeout="s/∞/${YELLOW}&${RESET}/g;"
test_undefined="s/?/${YELLOW}&${RESET}/g;"
test_error="s/е/${RED}&${RESET}/g;"
heart="s/♥/${RED}&${RESET}/g;"
star="s/✶/${YELLOW}&${RESET}/g;"
l_test_passed="s/✔\|√/${L_DARK_GREEN}&${L_RESET}/g;"
l_test_failed="s/✗\|Х/${L_RED}&${L_RESET}/g;"
l_test_timeout="s/∞/${L_YELLOW}&${L_RESET}/g;"
l_test_undefined="s/?/${L_YELLOW}&${L_RESET}/g;"
l_test_error="s/е/${L_RED}&${L_RESET}/g;"
# remove_e="s/-е //g;"
git stash
git pull
chmod +x ./runTests.sh
# echo ciao
source /etc/profile.d/modules.sh > /dev/null 2>&1 || true
module add ghc > /dev/null 2>&1 || true
if [ "$*" == "--windows" ] || [[ "$HOME" == *"/afs/inf.ed.ac.uk"* ]]
then
# echo "windows"
exec runghc -i../:./ Tester.hs $(whoami) $* |\
sed "$test_passed\
$test_failed\
$test_timeout\
$test_undefined\
$test_error\
$heart\
$star"
fi
if [ "$*" != "--windows" ] && [[ "$HOME" != *"/afs/inf.ed.ac.uk"* ]]
then
# echo linux
exec runghc -i../:./ Tester.hs $(whoami) $* |\
sed "$l_test_passed\
$l_test_failed\
$l_test_timeout\
$l_test_undefined\
$l_test_error"
fi