-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
58 lines (47 loc) · 888 Bytes
/
Copy pathtest.sh
File metadata and controls
58 lines (47 loc) · 888 Bytes
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
MainTests()
{
pytest tests/chess
}
OnlyPlayedGames()
{
pytest -v -m played_games
}
TestAll()
{
pytest tests/chess tests/test_with_played_games.py
TypeCheck
ShowCovBrowser
}
ShowCovBrowser()
{
open htmlcov/index.html
}
InvalidOption()
{
echo "------------ INVALID OPTION : [$1] ------------"
ValidOptions
exit 1
}
ValidOptions()
{
echo "---------------- VALID OPTIONS ----------------"
echo " -a | --all : run all tests"
echo " -p | --played-games : test already played games"
echo " -t | --type-check : run mypy check"
}
TypeCheck()
{
mypy src/ --check-untyped-defs
}
no_args="true"
while [ $# -gt 0 ] ; do
case $1 in
-a | --all) TestAll ;;
-p | --played-games) OnlyPlayedGames ;;
-t | --type-check) TypeCheck ;;
*) InvalidOption $1 ;;
esac
no_args="false"
shift
done
[[ "$no_args" == "true" ]] && { MainTests; exit 1; }