From e6d4c35a80b2aed4a0b60ba9d32599545e0a36fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 12 Jan 2017 21:19:59 +0100 Subject: test/sam: adapt tests to new grouping semantics --- sam/visrc.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'sam/visrc.lua') 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 -- cgit v1.2.3