From 8a38d5adee96bb42d8af3c6c28cfb0cd2fb7711f Mon Sep 17 00:00:00 2001 From: Liam Devine Date: Sat, 30 Apr 2011 22:29:54 +0100 Subject: corrected teardown function name in testing_make_linking.lua stopped 'runall' from running 'setup' and 'teardown' as tests which also stops the inflated test count that I noticed. Added writing of runtime to io for test suites. Added prj = premake.solution.getproject(sln, 1) to vs10 tests and removed the managed flag hack. --- tests/testfx.lua | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'tests/testfx.lua') diff --git a/tests/testfx.lua b/tests/testfx.lua index 89fa64c..f235cd0 100644 --- a/tests/testfx.lua +++ b/tests/testfx.lua @@ -228,30 +228,32 @@ local numpassed = 0 local numfailed = 0 - + local start_time = os.clock() for suitename, suitetests in pairs(T) do for testname, testfunc in pairs(suitetests) do + + if suitetests.setup ~= testfunc and suitetests.teardown ~= testfunc then + local ok, err = test_setup(suitetests, testfunc) - local ok, err = test_setup(suitetests, testfunc) - - if ok then - ok, err = test_run(suitetests, testfunc) - end + if ok then + ok, err = test_run(suitetests, testfunc) + end - local tok, terr = test_teardown(suitetests, testfunc) - ok = ok and tok - err = err or tok + local tok, terr = test_teardown(suitetests, testfunc) + ok = ok and tok + err = err or tok - if (not ok) then - test.print(string.format("%s.%s: %s", suitename, testname, err)) - numfailed = numfailed + 1 - else - numpassed = numpassed + 1 + if (not ok) then + test.print(string.format("%s.%s: %s", suitename, testname, err)) + numfailed = numfailed + 1 + else + numpassed = numpassed + 1 + end end - + end end - + io.write('running time : ', os.clock() - start_time,'\n') print = test.print return numpassed, numfailed end -- cgit v1.2.3