diff --git a/tests/testbuilder.nim b/tests/testbuilder.nim index c7dd7d2..ce3828e 100644 --- a/tests/testbuilder.nim +++ b/tests/testbuilder.nim @@ -19,9 +19,14 @@ import os import strutils import strformat +## A rudimentary test builder. Converts test directories to test +## sequences. proc parseModalLine(line: string): tuple[modal: bool, mode: string, detail: string, comment: bool] = - + ## parses one line. If it's a line that's a mode (in format [modename: detail] it returns modal: true, else modal: false. + ## mode contains the content of the line, if it's modal the mode name + ## detail contains the content of the detail of the modename. If empty or non modal "" + ## if comment is true, the returned value has to be ignored # when non modal, mode becomes the line # when comment is true, it must not do anything to whenever it is exported let line = line diff --git a/tests/testeval.nim b/tests/testeval.nim index e72b3f6..989b9f2 100644 --- a/tests/testeval.nim +++ b/tests/testeval.nim @@ -24,12 +24,18 @@ import strformat import testconfig proc evalTests*(tests: seq[Test]) = + ## Goes through every test in tests and evaluates all finished + ## tests to success or mismatch for test in tests: if test.result == TestResult.ToEval: test.result = if test.eval(): TestResult.Success else: TestResult.Mismatch proc printResults*(tests: seq[Test]): bool = + ## Goes through every test in tests and prints the number of good/ + ## skipped/failed/crashed/killed tests to the screen. It also debug + ## logs all failed test details and crash messages. It returns + ## true if no tests {failed | crashed | got killed}. var skipped = 0 success = 0