From 09633d1056299c056083ba75bd677cf3242d3711 Mon Sep 17 00:00:00 2001 From: Mergul Date: Sat, 4 Apr 2020 22:20:08 +0200 Subject: [PATCH] -removed not used code and testing (failure) unittest --- tests/runner.d | 54 -------------------------------------------------- 1 file changed, 54 deletions(-) diff --git a/tests/runner.d b/tests/runner.d index 9271d7c..1149ee7 100644 --- a/tests/runner.d +++ b/tests/runner.d @@ -8,16 +8,10 @@ import core.sys.posix.setjmp; import ecs.vector; import ecs.std; -unittest -{ - assert(0, "AAAAAAAA"); -} - enum int ASSERTED = 123; enum string OUT_FILE = "test_report.xml"; static jmp_buf gEnvBuffer; -//__gshared TestSuite[4] gSuites; static AssertInfo gAssertInfo; struct AssertInfo @@ -147,54 +141,6 @@ string copyString(const char* str) return cast(string) Mallocator.makeArray(arr); } -void runTestSuite(alias testModule)(ref TestSuite suite) -{ - suite.name = testModule.stringof; - foreach (index, testDelegate; __traits(getUnitTests, testModule)) - { - suite.tests[index].executed = true; - writeTests(gSuites); // Save executed info - - // Save calling environment for longjmp - int jmpRet = setjmp(gEnvBuffer); - - if (jmpRet == ASSERTED) - { - suite.tests[index].passed = false; - suite.tests[index].file = copyString(gAssertInfo.file); - suite.tests[index].fileLine = gAssertInfo.line; - suite.tests[index].msg = copyString(gAssertInfo.msg); - } - else - { - testDelegate(); - suite.tests[index].passed = true; - } - } -} - -void addTestSuite(alias testModule)(ref TestSuite suite) -{ - suite.name = testModule.stringof; - foreach (index, testDelegate; __traits(getUnitTests, testModule)) - { - enum attributes = __traits(getAttributes, testDelegate); - static if (attributes.length == 0) - { - enum string testName = "No name"; - } - else - { - enum string testName = attributes[0]; - - } - Test test; - test.name = testName; - - suite.tests ~= test; - } -} - struct TestRunner(Args...) { TestSuite[Args.length] suites;