astextplain: Try to workaround textconv vs symlinks problem on win32
[msysgit/kirr.git] / share / msysGit / run-tests.sh
blob20ed3462f0e28e3461e4d8c7831315e2b74e7b1e
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=-j15;;
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 /usr/git &&
59 for file in *.exe
61 dir=${file%.exe} &&
62 test ! -d "$dir" ||
63 rm -rf "$dir"
64 done &&
65 echo make $PARALLEL_MAKE &&
66 (cd t &&
67 rm -rf test-results &&
68 time make $PARALLEL_MAKE -k "$@" < /dev/null) 2>&1 |
70 CURRENT_TESTS=
71 FAILED_TESTS=
72 while read line
74 case "$line" in
75 "*** t"*)
76 TEST_NAME=$(get_test_name "$line")
77 CURRENT_TESTS="$CURRENT_TESTS $TEST_NAME"
78 printf "$(echo "$CURRENT_TESTS" |
79 sed 's/t\([0-9]*\)-[^ ]*/\1/g')\\r"
81 '* passed'*|'# passed'*)
82 get_finished_tests
84 esac
85 done
86 test -z "$FAILED_TESTS" || echo "These tests failed: $FAILED_TESTS"
87 test -z "$CURRENT_TESTS" || echo "Unfinished tests: $CURRENT_TESTS")