make tests green

This commit is contained in:
araq
2026-06-23 13:58:02 +02:00
parent 9dee632fd4
commit 5438ea5e93

View File

@@ -74,6 +74,18 @@ proc parseTest(filename: string; epcMode=false): Test =
# else: ignore empty lines for better readability of the specs
inc i
tmp.close()
# Give every run a private, freshly-wiped NIF cache. Under IC nimsuggest reuses
# the on-disk NIFs of a previous session, but per-symbol usage counts are not
# serialized, so a warm start ranks `sug`/`con` results differently than a cold
# one (e.g. `string` outranks `int` because `system` was loaded, not re-walked).
# The tester runs the stdio and EPC variants of a test as two processes sharing
# the same temp project name — without isolation the second inherits the first's
# NIFs and the result order flips. A dedicated, cleared cache keeps both cold and
# deterministic.
let nimcache = getTempDir() / ("nimsuggest_cache_" &
extractFilename(result.dest).changeFileExt("") & (if epcMode: "_epc" else: "_stdin"))
removeDir(nimcache)
result.cmd.add " --nimcache:" & nimcache
# now that we know the markers, substitute them:
for a in mitems(result.script):
a[0] = a[0] % markers