forked from tests-always-included/libnss_exec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_tests
executable file
·50 lines (39 loc) · 1.1 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
49
#!/bin/bash
failures=0
cd "${0%/*}"
echo "Starting test run: $(date)"
echo ""
for groupName in tests/*/; do
command=${groupName%/}
command=${command##*/}
for testNameFull in "$groupName"*; do
testName=${testNameFull##*/}
if [[ "$testName" == "no-arguments" ]]; then
testName=""
fi
if [[ -f "$testNameFull" ]] && [[ "$testName" != "nss_exec" ]]; then
echo -n "$command $testName ... "
DIFF=$(cd "$groupName" ;
# Do not quote $testName here as it may contain spaces
# and we want spaces to separate arguments.
../../nss_exec_test "$command" $testName | \
diff -U5 "../../$testNameFull" -
)
if [[ $? -eq 0 ]]; then
echo "pass"
else
echo "FAIL"
echo ""
echo "$DIFF"
echo ""
((failures++))
fi
fi
done
done
echo ""
if [[ $failures -gt 0 ]]; then
echo "$failures failures detected"
exit 1
fi
echo "All tests pass"