From 79512d00d9c0e72c333b6b8ca2afc3773a5e93d4 Mon Sep 17 00:00:00 2001 From: Andy Davidoff Date: Fri, 28 May 2021 12:01:28 -0400 Subject: [PATCH] 2.6.0: new split, better smoke --- balls.nimble | 2 +- balls/runner.nim | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/balls.nimble b/balls.nimble index d239956..5b5f76f 100644 --- a/balls.nimble +++ b/balls.nimble @@ -1,4 +1,4 @@ -version = "2.5.4" +version = "2.6.0" author = "disruptek" description = "a unittest framework with balls 🔴🟡🟢" license = "MIT" diff --git a/balls/runner.nim b/balls/runner.nim index 10e6e22..8efcf70 100644 --- a/balls/runner.nim +++ b/balls/runner.nim @@ -76,8 +76,8 @@ proc cmp*(a, b: Profile): int = ## Compare Profiles `a`, `b` for the purposes of test ordering. ## Note that this comparison does not measure test filename. cmper cp - cmper opt cmper gc + cmper opt proc `<`*(a, b: Profile): bool {.used.} = ## Compare Profiles `a`, `b` for the purposes of test ordering. @@ -430,6 +430,13 @@ proc main*(directory: string; fallback = false) = # try to find something good to run in the current directory tests = ordered(getCurrentDir(), testsOnly = false) - # run the best input you found in the order you found it + var profiles: seq[Profile] + # generate profiles for the ordered inputs for test in tests.items: - matrix.perform test.profiles + profiles = concat(profiles, test.profiles) + + # polish the profile order to smoke the project faster + sort profiles + + # run the profiles + matrix.perform profiles