summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrun-tests40
1 files changed, 37 insertions, 3 deletions
diff --git a/run-tests b/run-tests
index 92f93fe0..f4c54c16 100755
--- a/run-tests
+++ b/run-tests
@@ -32,6 +32,7 @@ run_vim_80_tests=1
run_vim_90_tests=1
run_linters=1
use_docker=1
+run_parallell=1
while [ $# -ne 0 ]; do
case $1 in
@@ -130,6 +131,7 @@ while [ $# -ne 0 ]; do
echo ' --fast Run only the fastest Vim and custom checks'
echo ' --help Show this help text'
echo ' --no-docker Skip using Docker (unsupported)'
+ echo ' --no-parallell Run all tests sequentially'
echo ' -- Stop parsing options after this'
exit 0
;;
@@ -138,6 +140,10 @@ while [ $# -ne 0 ]; do
docker_flag='--no-docker'
shift
;;
+ --no-parallell)
+ run_parallell=0
+ shift
+ ;;
--)
shift
break
@@ -253,6 +259,22 @@ available_vims() {
fi
}
+tail_and_wait() {
+ tries=0
+ while [ "$tries" -lt 5 ]; do
+ tries=$((tries + 1))
+ [ -e "$1" ] || { sleep 2; continue; }
+
+ tail -f "$1" &
+ tail_pid=$!
+ wait "$2"
+ kill $tail_pid
+ return 0
+ done
+
+ echo "Log file $1 did not get created within a reasonable time." >&2
+}
+
for vim in $( available_vims ); do
if ( [[ "$vim" =~ ^vim-v8.0 ]] && ((run_vim_80_tests)) ) \
|| ( [[ "$vim" =~ ^vim-v9.0 ]] && ((run_vim_90_tests)) ) \
@@ -264,7 +286,11 @@ for vim in $( available_vims ); do
file_number=$((file_number+1))
test/script/run-vader-tests $quiet_flag $verbose_flag $docker_flag \
"${vim#*=}" "$tests" > "$output_dir/$file_number" 2>&1 &
- pid_list="$pid_list $!"
+ if [ "$run_parallell" -eq 1 ]; then
+ pid_list="$pid_list $!"
+ else
+ tail_and_wait "$output_dir/$file_number" $!
+ fi
fi
done
@@ -272,12 +298,20 @@ if ((run_linters)); then
echo "Starting Vint..."
file_number=$((file_number+1))
test/script/run-vint $docker_flag > "$output_dir/$file_number" 2>&1 &
- pid_list="$pid_list $!"
+ if [ "$run_parallell" -eq 1 ]; then
+ pid_list="$pid_list $!"
+ else
+ tail_and_wait "$output_dir/$file_number" $!
+ fi
echo "Starting Custom checks..."
file_number=$((file_number+1))
test/script/custom-checks &> "$output_dir/$file_number" 2>&1 &
- pid_list="$pid_list $!"
+ if [ "$run_parallell" -eq 1 ]; then
+ pid_list="$pid_list $!"
+ else
+ tail_and_wait "$output_dir/$file_number" $!
+ fi
fi
echo