From e0e6400c61a4d74e68a2d2ef0039d077b8955853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 6 Apr 2017 22:03:45 +0200 Subject: test: terminate tests via command line argument not lua code Executing a vis:command("qall!") or similar from a Lua WIN_OPEN event handler is a bad idea. --- sam/test.sh | 2 +- sam/visrc.lua | 3 +-- vis/test.sh | 2 +- vis/visrc.lua | 1 - 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sam/test.sh b/sam/test.sh index 764f7c3..eb81635 100755 --- a/sam/test.sh +++ b/sam/test.sh @@ -73,7 +73,7 @@ for t in $TESTS; do TESTS_RUN=$((TESTS_RUN+1)) - $VIS "$IN" /dev/null + $VIS '+qall!' "$IN" /dev/null RETURN_CODE=$? printf "Running test %s with vis ... " "$t" diff --git a/sam/visrc.lua b/sam/visrc.lua index c5cda31..315526f 100644 --- a/sam/visrc.lua +++ b/sam/visrc.lua @@ -9,7 +9,6 @@ vis.events.win_open = function(win) local cmd = cmd_file:read('*all') vis:command(string.format(",{\n %s\n }", cmd)) local out_file_name = string.gsub(in_file, '%.in$', '.vis.out') - vis:command(string.format("wq! %s", out_file_name)) + vis:command(string.format("w! %s", out_file_name)) end - vis:command('qall!') end diff --git a/vis/test.sh b/vis/test.sh index 91e3914..26702d3 100755 --- a/vis/test.sh +++ b/vis/test.sh @@ -25,7 +25,7 @@ for t in $test_files; do TESTS_RUN=$((TESTS_RUN + 1)) t=${t%.in} t=${t#./} - $VIS "$t".in < /dev/null 2> /dev/null + $VIS '+qall!' "$t".in < /dev/null 2> /dev/null RETURN_CODE=$? printf "%-50s" "$t" diff --git a/vis/visrc.lua b/vis/visrc.lua index ad26bc8..2cb3f8a 100644 --- a/vis/visrc.lua +++ b/vis/visrc.lua @@ -14,6 +14,5 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) file:close() vis:feedkeys(keys..'') vis:command(string.format("w! '%s.out'", name)) - vis:command('qall!') end end) -- cgit v1.2.3