-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathallTestsForPyVersion
More file actions
executable file
·65 lines (55 loc) · 1.3 KB
/
allTestsForPyVersion
File metadata and controls
executable file
·65 lines (55 loc) · 1.3 KB
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
#!/bin/bash
set -e
set -u
cd $(dirname $0)
unit_test_path=code/wypp:tests:code
integration_test_path=code/wypp:integration-tests:code
function usage()
{
echo "USAGE: $0 [--unit | --integration] [ FILE ]"
exit 1
}
function run_unit_tests()
{
echo "Running unit tests, PYTHONPATH=$unit_test_path"
if [ -z "${1:-}" ]; then
PYTHONPATH=$unit_test_path python3 -m unittest tests/test*.py
ecode=$?
else
PYTHONPATH=$unit_test_path python3 -m unittest "$@"
ecode=$?
fi
echo "Done with unit tests"
}
function run_integration_tests()
{
echo "Running all integration tests, PYTHONPATH=$integration_test_path"
if [ -z "${1:-}" ]; then
PYTHONPATH=$integration_test_path python3 -m unittest integration-tests/test*.py
ecode=$?
else
PYTHONPATH=$integration_test_path python3 -m unittest "$@"
ecode=$?
fi
echo "Done with integration tests"
}
echo "Python version:"
python3 --version
if [ -z "${1:-}" ]; then
run_unit_tests
echo
run_integration_tests
echo
echo "Running file tests ..."
python3 ./fileTests.py
elif [ "$1" == "--unit" ]; then
shift
run_unit_tests "$@"
exit $ecode
elif [ "$1" == "--integration" ]; then
shift
run_integration_tests "$@"
exit $ecode
else
usage
fi