more docs

This commit is contained in:
Productive2 2021-02-16 22:26:54 +01:00
parent 3fbf4300dc
commit 19ec90d775
2 changed files with 12 additions and 1 deletions

View File

@ -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

View File

@ -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