1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
#!/bin/sh
TARGET=$1
DIR=build-"$TARGET"
CONFIGURE=do-"$TARGET"-configure
shift
(mkdir "$DIR" || exit 1
cd "$DIR" || exit 2
echo '##################################################'
echo '##########' ../scripts/"$CONFIGURE" -Dwerror=true -Ddebug=false "$@"
echo '##################################################'
date
../scripts/"$CONFIGURE" -Dwerror=true -Ddebug=false "$@" > config.log 2>&1
case $? in
0)
echo 'Configuration succeeded'
;;
77)
echo 'Configuration skipped'
exit 0
;;
*)
exit 3
;;
esac
echo '##########' "$TARGET" 'ninja'
date
ninja > ninja.log 2>&1 || exit 4
echo 'Build succeeded'
echo '##########' "$TARGET" 'meson test -t 20'
date
meson test -t 20 > test.log 2>&1 || exit 5
echo 'Test succeeded'
date)
case $? in
0)
rm -rf "$DIR"
;;
1)
echo '##################################'
echo '############# mkdir' "$DIR" 'failed'
echo '##################################'
exit 1
;;
2)
echo '##################################'
echo '############# cd' "$DIR" 'failed'
echo '##################################'
exit 1
;;
3)
echo '##################################'
echo '############# Configuration failed'
echo '##################################'
echo 'config.log'
echo '##################################'
cat "$DIR"/config.log
echo '##################################'
echo 'meson-logs/meson-log.txt'
echo '##################################'
cat "$DIR"/meson-logs/meson-log.txt
exit 1
;;
4)
echo '##################################'
echo '############# Build failed'
echo '##################################'
echo 'ninja.log'
echo '##################################'
cat "$DIR"/ninja.log
exit 1
;;
5)
echo '##################################'
echo '############# Test failed'
echo '##################################'
echo 'test.log'
echo '##################################'
cat "$DIR"/test.log
echo '##################################'
echo 'meson-logs/testlog.txt'
echo '##################################'
cat "$DIR"/meson-logs/testlog.txt
exit 1
;;
*)
echo '##################################'
echo '############# Unknown failure' "$?"
echo '##################################'
cat "$DIR"/meson-logs/*
exit 1
;;
esac
|