From ee15040e18a660bb5fcac87450620b35596db9ad Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Mon, 20 Aug 2018 19:05:57 +0200 Subject: Make the binding root directory available This lets the test lua scripts use this variable to be able to retrieve fixtures files which lie in the 'var' directory Change-Id: Iad321706bd05dfb8e5f0423a15d710fdc540c154 Signed-off-by: Romain Forlot --- conf.d/controller/lua.d/aft.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'conf.d/controller') diff --git a/conf.d/controller/lua.d/aft.lua b/conf.d/controller/lua.d/aft.lua index 917d175..428dd2f 100644 --- a/conf.d/controller/lua.d/aft.lua +++ b/conf.d/controller/lua.d/aft.lua @@ -25,6 +25,7 @@ lu.LuaUnit.fname = "xUnitResults.xml" _AFT = { exit = {0, code}, context = _ctx, + bindingRootDir = nil, tests_list = {}, event_history = false, monitored_events = {}, @@ -580,7 +581,7 @@ end function _launch_test(context, args) _AFT.context = context - local bindingRootDir = AFB:getrootdir(_AFT.context) + _AFT.bindingRootDir = AFB:getrootdir(_AFT.context) local loadedfile = nil -- Prepare the tests execution configuring the monitoring and loading @@ -598,12 +599,12 @@ function _launch_test(context, args) if args.files and type(args.files) == 'table' then for _,f in pairs(args.files) do - local cmdHandle = io.popen('find '..bindingRootDir..' -name '..f) + local cmdHandle = io.popen('find '.. _AFT.bindingRootDir..' -name '..f) loadedfile = dofile(cmdHandle:read()) cmdHandle:close() end elseif type(args.files) == 'string' then - local cmdHandle = io.popen('find '..bindingRootDir..' -name '..args.files) + local cmdHandle = io.popen('find '.._AFT.bindingRootDir..' -name '..args.files) loadedfile = dofile(cmdHandle:read()) cmdHandle:close() end -- cgit 1.2.3-korg