aboutsummaryrefslogtreecommitdiff
path: root/sam/visrc.lua
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-01-12 21:19:59 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-01-12 21:19:59 +0100
commite6d4c35a80b2aed4a0b60ba9d32599545e0a36fd (patch)
tree4094e0894ae18a2bd64396aa4ac7883e50100965 /sam/visrc.lua
parent72e2b4619ce5a7419de63efed1017b265ca9b7ce (diff)
downloadvis-e6d4c35a80b2aed4a0b60ba9d32599545e0a36fd.tar.gz
vis-e6d4c35a80b2aed4a0b60ba9d32599545e0a36fd.tar.xz
test/sam: adapt tests to new grouping semantics
Diffstat (limited to 'sam/visrc.lua')
-rw-r--r--sam/visrc.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/sam/visrc.lua b/sam/visrc.lua
index e69de29..c5cda31 100644
--- a/sam/visrc.lua
+++ b/sam/visrc.lua
@@ -0,0 +1,15 @@
+vis.events = {}
+vis.events.win_open = function(win)
+ -- test.in file passed to vis
+ local in_file = win.file.name
+ if in_file then
+ -- use the corresponding test.cmd file
+ local cmd_file_name = string.gsub(in_file, '%.in$', '.cmd');
+ local cmd_file = io.open(cmd_file_name)
+ 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))
+ end
+ vis:command('qall!')
+end