file: update the file utility to version 5.04.
[msysgit.git] / share / msysGit / run-tests.sh
blobfe018e2cf269557327c54483502b27dc70df9fa2
1 #!/bin/sh
3 # This list was generated after a run of "make test" using generate_skip_list
5 export GIT_SKIP_TESTS='
8 #echo "$GIT_SKIP_TESTS" | tr '\n' ' '; exit
9 export NO_SVN_TESTS=t
10 case " $*" in
11 *' -j'*) ;;
12 *) PARALLEL_MAKE=-j5;;
13 esac
15 generate_skip_list () {
16 cd /git/t
17 for d in trash*
19 name=${d#trash directory.}
20 short=${name%%-*}
21 sh $name.sh |
22 sed -n -e "s/.*FAIL \([0-9]*\).*/$short.\1/p" \
23 -e "s/^not ok - \([0-9]*\).*/$short.\1/p"
24 done
27 test generate_skip_list = "$1" && {
28 generate_skip_list
29 exit
32 get_test_name () {
33 echo "$*" | sed 's/.* \(t[0-9].*\)\.sh .*/\1/'
36 get_finished_tests () {
37 REMAINING_TESTS=
38 for t in $CURRENT_TESTS
40 f=$(grep failed t/test-results/${t%.sh}-[1-9]* 2> /dev/null)
41 if test ! -z "$f"
42 then
43 printf '%70s ' $(cd t && echo $t*.sh)
44 if test "failed 0" = "$f"
45 then
46 echo -e '\033[32mok\033[0m'
47 else
48 FAILED_TESTS="$FAILED_TESTS $t"
49 echo -e '\033[31mfailed\033[0m'
51 else
52 REMAINING_TESTS="$REMAINING_TESTS $t"
54 done
55 CURRENT_TESTS="$REMAINING_TESTS"
58 cd /git &&
59 echo make $PARALLEL_MAKE &&
60 (cd t &&
61 rm -rf test-results &&
62 time make $PARALLEL_MAKE -k "$@" < /dev/null) 2>&1 |
64 CURRENT_TESTS=
65 FAILED_TESTS=
66 while read line
68 case "$line" in
69 "*** t"*)
70 TEST_NAME=$(get_test_name "$line")
71 CURRENT_TESTS="$CURRENT_TESTS $TEST_NAME"
72 printf "Currently running $(echo "$CURRENT_TESTS" |
73 sed 's/-[^ ]*//g')\\r"
75 '* passed'*|'# passed'*)
76 get_finished_tests
78 esac
79 done
80 test -z "$FAILED_TESTS" || echo "These tests failed: $FAILED_TESTS"
81 test -z "$CURRENT_TESTS" || echo "Unfinished tests: $CURRENT_TESTS")