]>
git.proxmox.com Git - systemd.git/blob - test/run-integration-tests.sh
4 if [ "$NO_BUILD" ]; then
6 elif BUILD_DIR
="$($(dirname "$0")/../tools/find-build-dir.sh)"; then
9 echo "No build found, please set BUILD_DIR or NO_BUILD" >&2
16 args
="setup run clean-again"
19 VALID_TARGETS
="all setup run clean clean-again"
22 for target
in $VALID_TARGETS; do
23 [ "$1" = "$target" ] && return 0
28 # reject invalid make targets in $args
30 if ! is_valid_target
"$arg"; then
31 echo "Invalid target: $arg" >&2
39 # separate 'clean' and 'clean-again' operations
40 [[ "$args" =~
"clean-again" ]] && CLEANAGAIN
=1
41 args
=${args/clean-again}
42 [[ "$args" =~
"clean" ]] && CLEAN
=1
54 for marker
in $DENY_LIST_MARKERS $BLACKLIST_MARKERS; do
55 if [ -f "$1/$marker" ]; then
56 echo "========== DENY-LISTED: $1 ($marker) =========="
63 SELECTED_TESTS
="${SELECTED_TESTS:-TEST-??-*}"
65 # Let's always do the cleaning operation first, because it destroys the image
67 if [ $CLEAN = 1 ]; then
68 for TEST
in $SELECTED_TESTS; do
69 ( set -x ; make -C "$TEST" clean
)
73 # Run actual tests (if requested)
74 if [[ $args =~
[a-z
] ]]; then
75 for TEST
in $SELECTED_TESTS; do
78 pass_deny_list
$TEST ||
continue
81 echo -e "\n--x-- Running $TEST --x--"
83 ( set -x ; make -C "$TEST" $args )
86 echo "--x-- Result of $TEST: $RESULT --x--"
88 results
["$TEST"]="$RESULT"
89 times["$TEST"]=$
(( $
(date +%s
) - $start ))
91 [ "$RESULT" -ne "0" ] && FAILURES
=$
(($FAILURES+1))
95 # Run clean-again, if requested, and if no tests failed
96 if [ $FAILURES -eq 0 -a $CLEANAGAIN = 1 ]; then
97 for TEST
in ${!results[@]}; do
98 ( set -x ; make -C "$TEST" clean-again
)
104 for TEST
in ${!results[@]}; do
105 RESULT
="${results[$TEST]}"
106 time="${times[$TEST]}"
107 string
=$
([ "$RESULT" = "0" ] && echo "SUCCESS" ||
echo "FAIL")
108 printf "%-35s %-8s (%3s s)\n" "${TEST}:" "${string}" "$time"
111 if [ "$FAILURES" -eq 0 ] ; then
112 echo -e "\nALL $COUNT TESTS PASSED"
114 echo -e "\nTOTAL FAILURES: $FAILURES OF $COUNT"