diff options
author | cos <cos> | 2023-06-06 11:26:00 +0200 |
---|---|---|
committer | cos <cos> | 2023-06-06 11:35:22 +0200 |
commit | 7ce96a92bdb9640fb61d89b768efb291ba5777cf (patch) | |
tree | e5d24ad06a94937406a1a677041d0e7bd664ac31 | |
parent | 5aa95e208fa49e03d3d298bda7e8c599b8421a9c (diff) | |
download | ale-topic/docker-free_testing.zip |
Make it possible to run tests sequentiallytopic/docker-free_testing
-rwxr-xr-x | run-tests | 40 |
1 files changed, 37 insertions, 3 deletions
@@ -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 |