-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathrun-tests
executable file
·48 lines (40 loc) · 1.59 KB
/
run-tests
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
#! /usr/bin/env bash
# ------------------------------------------------------------------------------
# A wrapper script for "mvn test". Primarily just for the help message.
# ------------------------------------------------------------------------------
set -euo pipefail
if [ $# -eq 0 ]; then
cat <<END
Usage: $0 <path-to-auth-file> [ <test-selector> ] [ --okhttp ]
<path-to-auth-file>: The path to a ".auth" file. You can generate a
".auth" file by running the "authorize" example program (see
ReadMe.md for instructions on how to do that).
<test-selector> [optional]: If omitted, all the tests are run. If
provided, only the specified tests are run. Example values:
- "DbxClientV1Test"
- "DbxClientV1Test,StringUtilTest"
- "DbxClientV1Test#testMoveFolder"
- "DbxClientV1Test#testMove*"
- "DbxClientV1Test#testMoveFolder+testMoveEmptyFolder"
For the full specification, see:
http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html
--okhttp [optional]: When making HTTP requests, use the OkHttp library instead
of the Java standard library
END
exit
elif [ $# -eq 1 ]; then
args=("-DdbxAuthInfoFile=$1")
elif [ $# -eq 2 ]; then
if [ "$2" == "--okhttp" ]; then
args=("-DdbxAuthInfoFile=$1" "-DokHttp=true")
else
args=("-DdbxAuthInfoFile=$1" "-Dtest=$2")
fi
elif [ $# -eq 3 ]; then
args=("-DdbxAuthInfoFile=$1" "-Dtest=$2" "-DokHttp=true")
else
echo 1>&2 "Expecting at most 3 arguments, got $#."
echo 1>&2 "Run with no arguments for help."
exit 1
fi
exec mvn test -DskipTests=false "${args[@]}"