diff --git a/lua/test.sh b/lua/test.sh index 4d885de..2a486e4 100755 --- a/lua/test.sh +++ b/lua/test.sh @@ -28,8 +28,10 @@ for t in $test_files; do t=${t%.lua} t=${t#./} printf "%-30s" "$t" - $VIS "$t.in" < /dev/null 2> /dev/null > "$t.busted" - + mkfifo infifo + $VIS "$t.in" /dev/null > "$t.busted" & + for i in 1; do sleep 0.1s; echo ":qall!"; done > infifo & + wait %1 && wait %2 if [ $? -ne 0 ]; then printf "FAIL\n" cat "$t.busted" @@ -37,6 +39,7 @@ for t in $test_files; do TESTS_OK=$((TESTS_OK + 1)) printf "OK\n" fi + rm infifo done printf "Tests ok %d/%d\n" $TESTS_OK $TESTS_RUN diff --git a/lua/visrc.lua b/lua/visrc.lua index 16aa8b9..efd3408 100644 --- a/lua/visrc.lua +++ b/lua/visrc.lua @@ -6,7 +6,7 @@ io.stderr = io.stdout -- make sure we gracefully terminate, cleanup terminal state etc. os.exit = function(status) - vis:exit(status) + if status ~= 0 then vis:exit(status) end end vis.events.subscribe(vis.events.WIN_OPEN, function(win) @@ -24,5 +24,4 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) return end end - vis:exit(0) end)