forked from googleapis/google-api-php-client-services
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests.sh
42 lines (36 loc) · 787 Bytes
/
run_tests.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
#!/bin/sh
#
# Run the Google APIs client generator tests
#
case $0 in
/* )
TOP=$(dirname "$0")
;;
* )
TOP=$(dirname "$(/bin/pwd)/$0")
;;
esac
export PYTHONPATH=$TOP/src
TMP_REPORT_DIR=$(mktemp -d)
SUCCEEDED_FILE=${TMP_REPORT_DIR}/succeeded
FAILED_FILE=${TMP_REPORT_DIR}/failed
cd $TOP/tests
find . -name '*_test.py' | while read test
do
python $test
if [ $? == 0 ]; then
echo "${test}" >> "${SUCCEEDED_FILE}"
else
echo "${test}" >> "${FAILED_FILE}"
fi
done
echo ""
echo "--------- Succeeded tests -----------"
cat "${SUCCEEDED_FILE}"
if [ -f "${FAILED_FILE}" ]; then
echo "--------- Failed tests --------------"
cat "${FAILED_FILE}"
echo "-------------------------------------"
exit 1
fi
echo "-------------------------------------"