Skip to content

Commit

Permalink
2.6.0: new split, better smoke
Browse files Browse the repository at this point in the history
  • Loading branch information
disruptek committed May 28, 2021
1 parent bfa0719 commit 79512d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion balls.nimble
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "2.5.4"
version = "2.6.0"
author = "disruptek"
description = "a unittest framework with balls 🔴🟡🟢"
license = "MIT"
Expand Down
13 changes: 10 additions & 3 deletions balls/runner.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

0 comments on commit 79512d0

Please sign in to comment.