summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/ic/ic.nim3
-rw-r--r--testament/categories.nim33
-rw-r--r--testament/testament.nim4
3 files changed, 24 insertions, 16 deletions
diff --git a/compiler/ic/ic.nim b/compiler/ic/ic.nim
index 6530cb6c2..bd3be27f0 100644
--- a/compiler/ic/ic.nim
+++ b/compiler/ic/ic.nim
@@ -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)
 
diff --git a/testament/categories.nim b/testament/categories.nim
index 1f0bd6acf..28ede1ba0 100644
--- a/testament/categories.nim
+++ b/testament/categories.nim
@@ -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"]
diff --git a/testament/testament.nim b/testament/testament.nim
index 076123882..a8dc0557c 100644
--- a/testament/testament.nim
+++ b/testament/testament.nim
@@ -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 = @[