forked from coreos/dev-util
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_unittests
executable file
·48 lines (41 loc) · 904 Bytes
/
run_unittests
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
#!/bin/bash
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Runs the devserver unit test modules.
set -e
# Display help/usage message.
usage() {
cat <<EOF
Usage: ${0##*/} [OPTION]...
Options:
-f force running all unit test modules, regardless of failure
-h display this help and exit
EOF
}
# Parse command-line options.
while getopts ":fh" opt; do
case $opt in
f)
force_all=1
;;
h)
usage
exit
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
shift $((OPTIND-1))
if [[ $# > 0 ]]; then
echo "Invalid argument: $1"
exit 1
fi
# Invoke unit test scripts.
for unittest_script in *_unittest.py; do
echo "Running $unittest_script":
./${unittest_script} || test ${force_all} || break
done