This commit is contained in:
Antonis Geralis 2022-08-28 11:43:26 +03:00
parent 6992d6819c
commit a4cbf3e6c6
2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") =
proc test(name: string, srcDir = "tests/", args = "", lang = "c") =
buildBinary name, srcDir, "--mm:arc -d:release"
withDir("build/"):
exec "./" & name & " -max_total_time=3 -runs=10000" & args
exec "./" & name & " -max_total_time=1 -runs=10000 " & args
task testDrChaosExamples, "Build & run Dr. Chaos examples":
let examples = @["fuzz_graph"]
@ -36,7 +36,7 @@ task testDrChaosExamples, "Build & run Dr. Chaos examples":
task testDrChaos, "Build & run Dr. Chaos tests":
for filePath in listFiles("tests/"):
if filePath[^4..^1] == ".nim":
test filePath[len("tests/")..^5], args = " -error_exitcode=0"
test filePath[len("tests/")..^5], args = "-error_exitcode=0"
task testDrChaosNoCrash, "Build & run Dr. Chaos tests that should not crash":
for filePath in listFiles("tests/no_crash/"):

View File

@ -63,7 +63,7 @@ proc mutateEnum*(index, itemCount: int; r: var Rand): int =
if itemCount <= 1: 0
else: (index + 1 + r.rand(itemCount - 1)) mod itemCount
proc newInput*[T](sizeIncreaseHint: int; r: var Rand): T =
proc newInput*[T](sizeIncreaseHint: Natural; r: var Rand): T =
## Creates new input with a chance of returning default(T).
runMutator(result, sizeIncreaseHint, false, r)