-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.sh
executable file
·59 lines (52 loc) · 1.47 KB
/
test.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
#!/bin/sh
#
# HOW TO USE:
# First parameter is your python alias: python or python3
# Second parameter is what you want to test: frontend, backend or both
#
# eg: ./test.sh python3 backend
#
#default
python_v="python3"
if [ -z "$1" ]
then
echo "HOW TO USE:\n
First parameter is your python alias: python or python3
Second parameter is what you want to test: frontend, backend or both
\n
eg: ./test.sh python3 backend"
fi
if [ ! -z "$1" -a "$1" == "help" ]
then
echo "HOW TO USE:\n
First parameter is your python alias: python or python3
Second parameter is what you want to test: frontend, backend or both
\n
eg: ./test.sh python3 backend"
else
if [ ! -z "$1" -a "$1" == "python" ]
then
python_v="python"
fi
if [ ! -z "$1" -a "$1" == "python3" ]
then
python_v="python3"
fi
if ! [ -z "$2" ]; then
if [ "$2" == "frontend" ]; then
clear
echo "\n\n\n ---- Front end test ----- | using $python_v alias \n" "$3"
"$python_v" manage.py test tests/tests_front_end --settings=mysite.settings.local --with-coverage"$3"
fi
if [ "$2" == "backend" ]; then
clear
echo "\n\n\n ---- Back end test ----- | using $python_v alias \n" "$3"
"$python_v" manage.py test tests/tests_bibliotools --settings=mysite.settings.local"$3"
fi
if [ "$2" == "both" ]; then
clear
echo "\n\n\n ---- Front end + Back end tests ----- | using $python_v alias \n" "$3"
"$python_v" manage.py test tests/ --settings=mysite.settings.local --with-coverage"$3"
fi
fi
fi