2020-03-04 12:35:06 +03:00
#!/usr/bin/env bash
set -e
2017-11-28 21:42:15 +03:00
2017-12-06 17:09:54 +03:00
BUILD_DIR = " $( $( dirname " $0 " ) /../tools/find-build-dir.sh) "
2017-12-06 17:13:02 +03:00
if [ $# -gt 0 ] ; then
scripts: use 4 space indentation
We had all kinds of indentation: 2 sp, 3 sp, 4 sp, 8 sp, and mixed.
4 sp was the most common, in particular the majority of scripts under test/
used that. Let's standarize on 4 sp, because many commandlines are long and
there's a lot of nesting, and with 8sp indentation less stuff fits. 4 sp
also seems to be the default indentation, so this will make it less likely
that people will mess up if they don't load the editor config. (I think people
often use vi, and vi has no support to load project-wide configuration
automatically. We distribute a .vimrc file, but it is not loaded by default,
and even the instructions in it seem to discourage its use for security
reasons.)
Also remove the few vim config lines that were left. We should either have them
on all files, or none.
Also remove some strange stuff like '#!/bin/env bash', yikes.
2019-04-04 15:10:42 +03:00
args = " $@ "
2017-12-06 17:13:02 +03:00
else
2020-03-20 21:09:35 +03:00
args = "setup run clean-again"
2017-12-06 17:13:02 +03:00
fi
2020-03-31 13:11:14 +03:00
args_no_clean = $( sed -r 's/(^| )clean($| )/ /g' <<< $args )
do_clean = $( [ " $args " = " $args_no_clean " ] ; echo $? )
2017-11-28 21:42:15 +03:00
2017-12-06 17:09:54 +03:00
ninja -C " $BUILD_DIR "
2017-11-28 21:42:15 +03:00
declare -A results
2020-03-31 12:44:09 +03:00
declare -A times
2017-11-28 21:42:15 +03:00
2018-03-23 12:02:22 +03:00
COUNT = 0
2017-11-28 21:42:15 +03:00
FAILURES = 0
2017-12-06 17:09:54 +03:00
cd " $( dirname " $0 " ) "
2019-12-12 11:37:19 +03:00
2020-03-31 13:11:14 +03:00
# Let's always do the cleaning operation first, because it destroys the image
# cache.
2019-12-12 11:37:19 +03:00
if [ $do_clean = 1 ] ; then
for TEST in TEST-??-* ; do
( set -x ; make -C " $TEST " " BUILD_DIR= $BUILD_DIR " clean )
done
fi
2020-03-25 15:46:44 +03:00
pass_blacklist( ) {
for marker in $BLACKLIST_MARKERS ; do
if [ -f " $1 / $marker " ] ; then
echo " ========== BLACKLISTED: $1 ( $marker ) ========== "
return 1
fi
done
return 0
}
2017-11-28 21:42:15 +03:00
for TEST in TEST-??-* ; do
scripts: use 4 space indentation
We had all kinds of indentation: 2 sp, 3 sp, 4 sp, 8 sp, and mixed.
4 sp was the most common, in particular the majority of scripts under test/
used that. Let's standarize on 4 sp, because many commandlines are long and
there's a lot of nesting, and with 8sp indentation less stuff fits. 4 sp
also seems to be the default indentation, so this will make it less likely
that people will mess up if they don't load the editor config. (I think people
often use vi, and vi has no support to load project-wide configuration
automatically. We distribute a .vimrc file, but it is not loaded by default,
and even the instructions in it seem to discourage its use for security
reasons.)
Also remove the few vim config lines that were left. We should either have them
on all files, or none.
Also remove some strange stuff like '#!/bin/env bash', yikes.
2019-04-04 15:10:42 +03:00
COUNT = $(( $COUNT + 1 ))
2018-03-23 12:02:22 +03:00
2020-03-25 15:46:44 +03:00
pass_blacklist $TEST || continue
2020-03-31 12:44:09 +03:00
start = $( date +%s)
2020-03-25 15:46:44 +03:00
scripts: use 4 space indentation
We had all kinds of indentation: 2 sp, 3 sp, 4 sp, 8 sp, and mixed.
4 sp was the most common, in particular the majority of scripts under test/
used that. Let's standarize on 4 sp, because many commandlines are long and
there's a lot of nesting, and with 8sp indentation less stuff fits. 4 sp
also seems to be the default indentation, so this will make it less likely
that people will mess up if they don't load the editor config. (I think people
often use vi, and vi has no support to load project-wide configuration
automatically. We distribute a .vimrc file, but it is not loaded by default,
and even the instructions in it seem to discourage its use for security
reasons.)
Also remove the few vim config lines that were left. We should either have them
on all files, or none.
Also remove some strange stuff like '#!/bin/env bash', yikes.
2019-04-04 15:10:42 +03:00
echo -e " \n--x-- Running $TEST --x-- "
set +e
2020-03-31 13:11:14 +03:00
( set -x ; make -C " $TEST " " BUILD_DIR= $BUILD_DIR " $args_no_clean )
scripts: use 4 space indentation
We had all kinds of indentation: 2 sp, 3 sp, 4 sp, 8 sp, and mixed.
4 sp was the most common, in particular the majority of scripts under test/
used that. Let's standarize on 4 sp, because many commandlines are long and
there's a lot of nesting, and with 8sp indentation less stuff fits. 4 sp
also seems to be the default indentation, so this will make it less likely
that people will mess up if they don't load the editor config. (I think people
often use vi, and vi has no support to load project-wide configuration
automatically. We distribute a .vimrc file, but it is not loaded by default,
and even the instructions in it seem to discourage its use for security
reasons.)
Also remove the few vim config lines that were left. We should either have them
on all files, or none.
Also remove some strange stuff like '#!/bin/env bash', yikes.
2019-04-04 15:10:42 +03:00
RESULT = $?
set -e
echo " --x-- Result of $TEST : $RESULT --x-- "
2017-11-28 21:42:15 +03:00
scripts: use 4 space indentation
We had all kinds of indentation: 2 sp, 3 sp, 4 sp, 8 sp, and mixed.
4 sp was the most common, in particular the majority of scripts under test/
used that. Let's standarize on 4 sp, because many commandlines are long and
there's a lot of nesting, and with 8sp indentation less stuff fits. 4 sp
also seems to be the default indentation, so this will make it less likely
that people will mess up if they don't load the editor config. (I think people
often use vi, and vi has no support to load project-wide configuration
automatically. We distribute a .vimrc file, but it is not loaded by default,
and even the instructions in it seem to discourage its use for security
reasons.)
Also remove the few vim config lines that were left. We should either have them
on all files, or none.
Also remove some strange stuff like '#!/bin/env bash', yikes.
2019-04-04 15:10:42 +03:00
results[ " $TEST " ] = " $RESULT "
2020-03-31 12:44:09 +03:00
times[ " $TEST " ] = $(( $( date +%s) - $start ))
2017-11-28 21:42:15 +03:00
scripts: use 4 space indentation
We had all kinds of indentation: 2 sp, 3 sp, 4 sp, 8 sp, and mixed.
4 sp was the most common, in particular the majority of scripts under test/
used that. Let's standarize on 4 sp, because many commandlines are long and
there's a lot of nesting, and with 8sp indentation less stuff fits. 4 sp
also seems to be the default indentation, so this will make it less likely
that people will mess up if they don't load the editor config. (I think people
often use vi, and vi has no support to load project-wide configuration
automatically. We distribute a .vimrc file, but it is not loaded by default,
and even the instructions in it seem to discourage its use for security
reasons.)
Also remove the few vim config lines that were left. We should either have them
on all files, or none.
Also remove some strange stuff like '#!/bin/env bash', yikes.
2019-04-04 15:10:42 +03:00
[ " $RESULT " -ne "0" ] && FAILURES = $(( $FAILURES + 1 ))
2017-11-28 21:42:15 +03:00
done
2019-12-12 11:37:19 +03:00
if [ $FAILURES -eq 0 -a $do_clean = 1 ] ; then
2020-03-25 15:46:44 +03:00
for TEST in ${ !results[@] } ; do
2019-12-12 11:37:19 +03:00
( set -x ; make -C " $TEST " " BUILD_DIR= $BUILD_DIR " clean-again )
done
fi
2017-11-28 21:42:15 +03:00
echo ""
for TEST in ${ !results[@] } ; do
scripts: use 4 space indentation
We had all kinds of indentation: 2 sp, 3 sp, 4 sp, 8 sp, and mixed.
4 sp was the most common, in particular the majority of scripts under test/
used that. Let's standarize on 4 sp, because many commandlines are long and
there's a lot of nesting, and with 8sp indentation less stuff fits. 4 sp
also seems to be the default indentation, so this will make it less likely
that people will mess up if they don't load the editor config. (I think people
often use vi, and vi has no support to load project-wide configuration
automatically. We distribute a .vimrc file, but it is not loaded by default,
and even the instructions in it seem to discourage its use for security
reasons.)
Also remove the few vim config lines that were left. We should either have them
on all files, or none.
Also remove some strange stuff like '#!/bin/env bash', yikes.
2019-04-04 15:10:42 +03:00
RESULT = " ${ results [ $TEST ] } "
2020-03-31 12:44:09 +03:00
time = " ${ times [ $TEST ] } "
string = $( [ " $RESULT " = "0" ] && echo "SUCCESS" || echo "FAIL" )
printf "%-35s %-8s (%3s s)\n" " ${ TEST } : " " ${ string } " " $time "
2017-11-28 21:42:15 +03:00
done | sort
if [ " $FAILURES " -eq 0 ] ; then
scripts: use 4 space indentation
We had all kinds of indentation: 2 sp, 3 sp, 4 sp, 8 sp, and mixed.
4 sp was the most common, in particular the majority of scripts under test/
used that. Let's standarize on 4 sp, because many commandlines are long and
there's a lot of nesting, and with 8sp indentation less stuff fits. 4 sp
also seems to be the default indentation, so this will make it less likely
that people will mess up if they don't load the editor config. (I think people
often use vi, and vi has no support to load project-wide configuration
automatically. We distribute a .vimrc file, but it is not loaded by default,
and even the instructions in it seem to discourage its use for security
reasons.)
Also remove the few vim config lines that were left. We should either have them
on all files, or none.
Also remove some strange stuff like '#!/bin/env bash', yikes.
2019-04-04 15:10:42 +03:00
echo -e " \nALL $COUNT TESTS PASSED "
2017-11-28 21:42:15 +03:00
else
scripts: use 4 space indentation
We had all kinds of indentation: 2 sp, 3 sp, 4 sp, 8 sp, and mixed.
4 sp was the most common, in particular the majority of scripts under test/
used that. Let's standarize on 4 sp, because many commandlines are long and
there's a lot of nesting, and with 8sp indentation less stuff fits. 4 sp
also seems to be the default indentation, so this will make it less likely
that people will mess up if they don't load the editor config. (I think people
often use vi, and vi has no support to load project-wide configuration
automatically. We distribute a .vimrc file, but it is not loaded by default,
and even the instructions in it seem to discourage its use for security
reasons.)
Also remove the few vim config lines that were left. We should either have them
on all files, or none.
Also remove some strange stuff like '#!/bin/env bash', yikes.
2019-04-04 15:10:42 +03:00
echo -e " \nTOTAL FAILURES: $FAILURES OF $COUNT "
2017-11-28 21:42:15 +03:00
fi
exit " $FAILURES "