-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
run-test
executable file
·33 lines (28 loc) · 970 Bytes
/
run-test
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
#!/bin/bash
# Fail script if any command fails.
set -e
# Print usage function.
printUsage() {
printf "\
Usage: $(basename "$(readlink -f "${0}")") options
Options:
[-d|--debug] Enable debug mode.
[-h|--help] Print this help text.
[-o|--output-dir \$output_directory] Set output directory.
[\$arguments] Additional arguments to pass to robot directly
"
}
# Get path to this script.
script_path="$(dirname "$(readlink -f "${0}")")"
# Parse arguments.
output_directory="${script_path}/output"
while (( ${#} > 0 )); do
case "${1}" in
"-d");& "--debug") set -x;;
"-h");& "--help") printUsage; exit 0;;
"-o");& "--output-dir") shift; output_directory="${1}";;
*) break;;
esac; shift
done
# Run.
robot --outputdir "${output_directory}" "${@}" "${script_path}/tests.robot"