-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·51 lines (39 loc) · 796 Bytes
/
test.sh
File metadata and controls
executable file
·51 lines (39 loc) · 796 Bytes
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
#!/usr/bin/env bash
set -eu
set -o pipefail
has_argument() {
local term="$1"
shift
for arg; do
if [ $arg == "$term" ]; then
return 0
fi
done
return 1
}
main() {
export DVM_ROOT="$(pwd)"
find tests -name test.sh -print0 | {
local failed=0
while IFS= read -r -d '' line; do
pushd $(dirname "$line") > /dev/null
echo "********** Running tests in: $(pwd)"
local output
if has_argument "--verbose" "$@"; then
if ! ./test.sh; then
failed=1
echo 'Test failed'
fi
else
if ! output="$(./test.sh 2>&1)"; then
failed=1
echo 'Test failed with output:'
echo "$output"
fi
fi
popd > /dev/null
done
return "$failed"
}
}
main "$@"