check-all.sh

changeset 1630
17ae70728139
parent 1629
ac24ad6c8595
equal deleted inserted replaced
1629:ac24ad6c8595 1630:17ae70728139
1 #!/bin/sh 1 #!/bin/sh
2 2
3 # determine number of processors
4 nproc=`nproc`
5
3 # backup config 6 # backup config
4 cp config.mk config.mk.bak 7 if [ -f config.mk ]; then
8 cp config.mk config.mk.bak
9 restore=1
10 else
11 restore=0
12 fi
5 13
6 perform_check() 14 perform_check()
7 { 15 {
8 make clean > /dev/null 16 make clean > /dev/null
9 if ! make check -j`nproc` > /dev/null ; then 17 if ! make check -j$nproc > /dev/null ; then
10 echo "fail." 18 echo "fail."
11 else 19 else
12 echo "ok." 20 echo "ok."
13 fi 21 fi
14 } 22 }
15 23
16 perform_check_cxx() 24 perform_check_cxx()
17 { 25 {
18 make clean > /dev/null 26 make clean > /dev/null
19 # we cannot mute the warnings, so throw away everything 27 # we cannot mute the warnings, so throw away everything
20 if ! make check-cxx -j`nproc` > /dev/null 2> /dev/null ; then 28 if ! make check-cxx -j$nproc > /dev/null 2> /dev/null ; then
21 echo "fail." 29 echo "fail."
22 else 30 else
23 echo "ok." 31 echo "ok."
24 fi 32 fi
25 } 33 }
44 52
45 printf "Check gcc C23... " 53 printf "Check gcc C23... "
46 CC=gcc CFLAGS=-std=c23 ./configure --debug > /dev/null 54 CC=gcc CFLAGS=-std=c23 ./configure --debug > /dev/null
47 perform_check 55 perform_check
48 56
49 # clean build files and restore config 57 # clean build files and rebuild with restored config
50 make clean > /dev/null 58 make clean > /dev/null
51 mv config.mk.bak config.mk 59 if [ $restore -eq 1 ]; then
52 make check -j`nproc` 60 mv config.mk.bak config.mk
61 make -j$nproc > /dev/null
62 else
63 rm config.mk
64 fi

mercurial