| 1 | #!/bin/sh |
| 2 | |
| 3 | # Give names of targets to use on the command line |
| 4 | # by default the following would *not* run |
| 5 | # coccicheck |
| 6 | # address,undefined |
| 7 | # test |
| 8 | default="sparse hdr-check check-docs sha256 leaks doc" |
| 9 | skip=" " |
| 10 | more=" " |
| 11 | |
| 12 | : ${T:=""} |
| 13 | |
| 14 | for t |
| 15 | do |
| 16 | case "$t" in |
| 17 | -) default= ;; |
| 18 | -?*) skip="$skip${t#-} " ;; |
| 19 | ?*) more="$more$t " ;; |
| 20 | esac |
| 21 | done |
| 22 | |
| 23 | set -- $default $more |
| 24 | |
| 25 | for t |
| 26 | do |
| 27 | echo "----- >8 -----" >&2 |
| 28 | case "$skip" in |
| 29 | *" $t "*) |
| 30 | echo "Skipping $t" >&2 |
| 31 | continue ;; |
| 32 | esac |
| 33 | |
| 34 | echo "Running $t" >&2 |
| 35 | |
| 36 | case "$t" in |
| 37 | address | undefined | address,undefined) |
| 38 | SANITIZE=$t \ |
| 39 | Meta/Make -j16 test |
| 40 | ;; |
| 41 | leaks) |
| 42 | SANITIZE=leak \ |
| 43 | GIT_TEST_PASSING_SANITIZE_LEAK=true Meta/Make -j16 $T CC=clang test && |
| 44 | SANITIZE=leak \ |
| 45 | GIT_TEST_PASSING_SANITIZE_LEAK=true Meta/Make -j16 CC=clang clean |
| 46 | ;; |
| 47 | coccicheck) |
| 48 | SPATCH_FLAGS=--recursive-includes Meta/Make -j16 "$t" |
| 49 | ;; |
| 50 | sparse) |
| 51 | Meta/Make -j16 -- NO_REGEX=NoThanks SPARSE_FLAGS=-Wsparse-error "$t" && |
| 52 | Meta/Make -j16 -- NO_REGEX=NoThanks clean >/dev/null 2>&1 && |
| 53 | rm -f compat/regex/regex.o |
| 54 | ;; |
| 55 | sha256) |
| 56 | GIT_TEST_DEFAULT_HASH=sha256 Meta/Make -j16 $T test |
| 57 | ;; |
| 58 | test) |
| 59 | Meta/Make -j16 $T "$t" |
| 60 | ;; |
| 61 | *) |
| 62 | Meta/Make -j16 "$t" |
| 63 | ;; |
| 64 | esac && |
| 65 | Meta/Make -j16 distclean >/dev/null 2>&1 || exit 1 |
| 66 | done && |
| 67 | Meta/Make -j16 distclean |