Created
April 20, 2017 20:39
-
-
Save fpoussin/e08c36c877320331d3723f6a9faa5d56 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source /etc/profile | |
renice +10 $$ | |
JOBS=$(grep -c ^processor /proc/cpuinfo) | |
SKIP_ARRAY=(Win32) | |
RETCODE=0 | |
function test_skip { | |
Array=$1 | |
SKIP=0 | |
for var in "${SKIP_ARRAY[@]}" | |
do | |
if [[ $1 == *"${var}"* ]]; then | |
SKIP=1 | |
break | |
fi | |
done | |
return $SKIP | |
} | |
function chbuild { | |
projects=$(find $1 -name Makefile -printf '%h ') | |
OK=0 | |
NOK=0 | |
FAIL=() | |
SUCCESS=() | |
SKIPPED=() | |
for t in $projects | |
do | |
test_skip $t | |
if [ $? -ne 0 ]; then | |
printf "SKIPPING: ${t}\n" | |
SKIPPED+=($t) | |
continue | |
fi | |
pushd $t > /dev/null | |
printf "BUILDING: ${t}\n" | |
make --quiet -j $JOBS > /dev/null | |
if [ $? -ne 0 ]; then | |
((NOK++)) | |
FAIL+=($t) | |
RETCODE=1 | |
else | |
((OK++)) | |
SUCCESS+=($t) | |
fi | |
popd > /dev/null | |
done | |
printf "\n${1}: ${OK} builds ok, ${NOK} builds failed\n" | |
printf 'SUCCESS: %s\n' "${SUCCESS[@]}" | |
printf 'FAIL: %s\n' "${FAIL[@]}" | |
printf 'SKIPPED: %s\n' "${SKIPPED[@]}" | |
printf "\n" | |
return $NOK | |
} | |
chbuild testhal | |
chbuild demos | |
exit $RETCODE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment