summaryrefslogtreecommitdiffstats
path: root/conf.d/project
diff options
context:
space:
mode:
author8000ff <clementmallejac@gmail.com>2018-07-03 15:13:05 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-07-10 17:12:27 +0200
commit179196fc65315bf9e8cade8137e9786e2e0b0fed (patch)
tree24fdaf0fee9a6e2bb21a7b6b4cd5c20bccf75085 /conf.d/project
parent47d9a2667ee860c3dc3199a4e0c4f23a03f47fbc (diff)
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 <clementmallejac@gmail.com> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'conf.d/project')
-rw-r--r--conf.d/project/lua.d/aft.lua9
1 files changed, 8 insertions, 1 deletions
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