From 179196fc65315bf9e8cade8137e9786e2e0b0fed Mon Sep 17 00:00:00 2001 From: 8000ff Date: Tue, 3 Jul 2018 15:13:05 +0200 Subject: Binding now talks to the client - Resonding after a the test verb has been called - Sends the test results through an event Change-Id: Ifc52ca2fdd272777ba42c97c8d4424cf75c05553 Signed-off-by: 8000ff Signed-off-by: Romain Forlot --- conf.d/project/lua.d/aft.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'conf.d/project') diff --git a/conf.d/project/lua.d/aft.lua b/conf.d/project/lua.d/aft.lua index 62c1de7..5032929 100644 --- a/conf.d/project/lua.d/aft.lua +++ b/conf.d/project/lua.d/aft.lua @@ -364,8 +364,15 @@ function _launch_test(context, args) dofile('var/'..args.files) end + AFB:success(_AFT.context, { info = "Launching tests"}) lu.LuaUnit:runSuiteByInstances(_AFT.tests_list) - AFB:success(context, {"Tests launched"}) + local success ="Success : "..tostring(lu.LuaUnit.result.passedCount) + local failures="Failures : "..tostring(lu.LuaUnit.result.testCount-lu.LuaUnit.result.passedCount) + + local evtHandle = AFB:evtmake(_AFT.context, 'results') + AFB:subscribe(_AFT.context,evtHandle) + AFB:evtpush(_AFT.context,evtHandle,{info = success.." "..failures}) + if _AFT.exit[1] == 1 then os.exit(_AFT.exit[2]) end end -- cgit 1.2.3-korg