* fixes #17943

* IC: test 'nim check --ic:on' for the full Nim compiler

* Update testament/testament.nim

Co-authored-by: Clyybber <darkmine956@gmail.com>

Co-authored-by: Clyybber <darkmine956@gmail.com>
This commit is contained in:
Andreas Rumpf
2021-05-19 16:00:14 +02:00
committed by GitHub
parent 53935b8b27
commit 558644725d
3 changed files with 24 additions and 16 deletions

View File

@@ -507,6 +507,9 @@ proc toPackedNodeIgnoreProcDefs(n: PNode, encoder: var PackedEncoder; m: var Pac
of nkStmtList, nkStmtListExpr:
for it in n:
toPackedNodeIgnoreProcDefs(it, encoder, m)
of nkImportStmt, nkImportExceptStmt, nkExportStmt, nkExportExceptStmt,
nkFromStmt, nkIncludeStmt:
discard "nothing to do"
else:
toPackedNode(n, m.topLevel, encoder, m)

View File

@@ -502,7 +502,7 @@ proc testNimblePackages(r: var TResults; cat: Category; packageFilter: string) =
proc icTests(r: var TResults; testsDir: string, cat: Category, options: string;
isNavigatorTest: bool) =
const
tooltests = ["compiler/nim.nim", "tools/nimgrep.nim"]
tooltests = ["compiler/nim.nim"]
writeOnly = " --incremental:writeonly "
readOnly = " --incremental:readonly "
incrementalOn = " --incremental:on -d:nimIcIntegrityChecks "
@@ -518,6 +518,24 @@ proc icTests(r: var TResults; testsDir: string, cat: Category, options: string;
test.spec.targets = {getTestSpecTarget()}
testSpecWithNimcache(r, test, nimcache)
template checkTest() =
var test = makeRawTest(file, options, cat)
test.spec.cmd = compilerPrefix & " check --hint[Conf]:off --warnings:off --ic:on $options " & file
testSpecWithNimcache(r, test, nimcache)
if not isNavigatorTest:
for file in tooltests:
let nimcache = nimcacheDir(file, options, getTestSpecTarget())
removeDir(nimcache)
let oldPassed = r.passed
checkTest()
if r.passed == oldPassed+1:
checkTest()
if r.passed == oldPassed+2:
checkTest()
const tempExt = "_temp.nim"
for it in walkDirRec(testsDir):
if isTestFile(it) and not it.endsWith(tempExt):
@@ -532,19 +550,6 @@ proc icTests(r: var TResults; testsDir: string, cat: Category, options: string;
editedTest(if isNavigatorTest: navTestConfig else: incrementalOn)
if r.passed != oldPassed+1: break
if not isNavigatorTest and false:
for file in tooltests:
let nimcache = nimcacheDir(file, options, getTestSpecTarget())
removeDir(nimcache)
let oldPassed = r.passed
test writeOnly
if r.passed == oldPassed+1:
test readOnly
if r.passed == oldPassed+2:
test readOnly
# ----------------------------------------------------------------------------
const AdditionalCategories = ["debugger", "examples", "lib", "ic", "navigator"]

View File

@@ -500,7 +500,7 @@ proc equalModuloLastNewline(a, b: string): bool =
proc testSpecHelper(r: var TResults, test: var TTest, expected: TSpec,
target: TTarget, nimcache: string, extraOptions = "") =
test.startTime = epochTime()
template callNimCompilerImpl(): untyped =
template callNimCompilerImpl(): untyped =
# xxx this used to also pass: `--stdout --hint:Path:off`, but was done inconsistently
# with other branches
callNimCompiler(expected.getCmd, test.name, test.options, nimcache, target, extraOptions)
@@ -649,9 +649,9 @@ proc makeRawTest(test, options: string, cat: Category): TTest {.used.} =
result.name = test
result.options = options
result.spec = initSpec(addFileExt(test, ".nim"))
result.startTime = epochTime()
result.spec.action = actionCompile
result.spec.targets = {getTestSpecTarget()}
result.startTime = epochTime()
# TODO: fix these files
const disabledFilesDefault = @[