2015-07-30 02:37:31 +00:00
|
|
|
#!/usr/bin/env bash
|
2015-05-18 19:52:25 +00:00
|
|
|
|
2015-05-18 23:28:58 +00:00
|
|
|
. "test/testenv.sh"
|
2015-05-19 01:09:32 +00:00
|
|
|
set -e
|
2015-05-18 23:28:58 +00:00
|
|
|
|
2015-05-18 23:57:43 +00:00
|
|
|
SHUTDOWN_LFS=no
|
|
|
|
SHOW_LOGS=yes
|
2015-07-24 10:17:15 +00:00
|
|
|
TESTS=( "$@" )
|
2015-05-18 23:57:43 +00:00
|
|
|
|
2015-05-18 23:28:58 +00:00
|
|
|
atexit() {
|
2015-05-19 01:09:32 +00:00
|
|
|
res=${1:-$?}
|
|
|
|
SHUTDOWN_LFS=yes
|
2015-05-19 01:18:13 +00:00
|
|
|
if [ "$res" = "0" ]; then
|
|
|
|
SHOW_LOGS=no
|
|
|
|
fi
|
|
|
|
|
2015-09-08 15:23:00 +00:00
|
|
|
if [ "$SHOW_LOGS" = "yes" ] && [ "$VERBOSE_LOGS" = "1" ]; then
|
2015-05-18 23:57:43 +00:00
|
|
|
if [ -s "$REMOTEDIR/gitserver.log" ]; then
|
|
|
|
echo ""
|
|
|
|
echo "gitserver.log:"
|
|
|
|
cat "$REMOTEDIR/gitserver.log"
|
|
|
|
fi
|
|
|
|
|
2015-05-18 23:28:58 +00:00
|
|
|
echo ""
|
2015-05-18 23:57:43 +00:00
|
|
|
echo "env:"
|
|
|
|
env
|
2015-05-18 23:28:58 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
shutdown
|
2015-05-19 01:09:32 +00:00
|
|
|
exit $res
|
2015-05-18 23:28:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
trap "atexit" EXIT
|
|
|
|
|
|
|
|
if [ -s "$LFS_URL_FILE" ]; then
|
2015-05-18 23:57:43 +00:00
|
|
|
SHOW_LOGS=no
|
2015-05-18 23:28:58 +00:00
|
|
|
echo "$LFS_URL_FILE still exists!"
|
2015-05-19 00:12:17 +00:00
|
|
|
echo "Confirm other tests are done, and run:"
|
|
|
|
echo " $ curl $(cat "$LFS_URL_FILE")/shutdown"
|
2015-05-18 23:28:58 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
setup
|
|
|
|
|
2015-05-21 21:01:44 +00:00
|
|
|
parallel=${GIT_LFS_TEST_MAXPROCS:-4}
|
|
|
|
|
|
|
|
echo "Running this maxprocs=$parallel"
|
2015-07-28 15:38:41 +00:00
|
|
|
echo
|
2015-05-21 21:01:44 +00:00
|
|
|
|
2015-07-24 10:17:15 +00:00
|
|
|
if [ ${#TESTS[@]} -eq 0 ]
|
|
|
|
then
|
|
|
|
testfiles=(test/test-*.sh)
|
|
|
|
else
|
|
|
|
for ((i=0; i<${#TESTS[@]}; i++)); do
|
|
|
|
testfiles[i]=test/test-${TESTS[i]}.sh
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
for file in "${testfiles[@]}"; do
|
2015-05-19 01:09:32 +00:00
|
|
|
echo "0$(cat .$(basename $file).time 2>/dev/null || true) $file"
|
2015-05-21 21:01:44 +00:00
|
|
|
done | sort -rnk1 | awk '{ print $2 }' | xargs -I % -P $parallel -n 1 /bin/sh -c % --batch
|