summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2021-05-09 00:50:08 -0700
committerGitHub <noreply@github.com>2021-05-09 09:50:08 +0200
commit69710e4548dcc56ce395edd227fb5298ea78ff78 (patch)
tree49e5bb9677ea10fb5f863d4164af423a0bde5fd4
parent72d6b59ffa93060386888ffdd333baaab28a8483 (diff)
downloadNim-69710e4548dcc56ce395edd227fb5298ea78ff78.tar.gz
fix #17960: honor `matrix` also for `action: compile, action: reject` (#17980)
* fix #17960: honor `matrix` for all action
-rw-r--r--testament/testament.nim13
-rw-r--r--tests/stylecheck/tusages.nim4
2 files changed, 9 insertions, 8 deletions
diff --git a/testament/testament.nim b/testament/testament.nim
index 11c541890..f50605acc 100644
--- a/testament/testament.nim
+++ b/testament/testament.nim
@@ -478,14 +478,16 @@ 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 = 
+    # 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)
   case expected.action
   of actionCompile:
-    var given = callNimCompiler(expected.getCmd, test.name, test.options, nimcache, target,
-          extraOptions = " --stdout --hint[Path]:off --hint[Processing]:off")
+    var given = callNimCompilerImpl()
     compilerOutputTests(test, target, given, expected, r)
   of actionRun:
-    var given = callNimCompiler(expected.getCmd, test.name, test.options,
-                             nimcache, target, extraOptions)
+    var given = callNimCompilerImpl()
     if given.err != reSuccess:
       r.addResult(test, target, "", "$ " & given.cmd & '\n' & given.nimout, given.err)
     else:
@@ -538,8 +540,7 @@ proc testSpecHelper(r: var TResults, test: var TTest, expected: TSpec,
           else:
             compilerOutputTests(test, target, given, expected, r)
   of actionReject:
-    var given = callNimCompiler(expected.getCmd, test.name, test.options,
-                              nimcache, target)
+    let given = callNimCompilerImpl()
     cmpMsgs(r, expected, given, test, target)
 
 proc targetHelper(r: var TResults, test: TTest, expected: TSpec, extraOptions = "") =
diff --git a/tests/stylecheck/tusages.nim b/tests/stylecheck/tusages.nim
index 696d1c1fc..2f99c70c5 100644
--- a/tests/stylecheck/tusages.nim
+++ b/tests/stylecheck/tusages.nim
@@ -1,10 +1,10 @@
 discard """
   action: reject
   nimout: '''tusages.nim(22, 5) Error: 'BAD_STYLE' should be: 'BADSTYLE' [proc declared in tusages.nim(11, 6)]'''
-  cmd: "nim $target --styleCheck:error --styleCheck:usages $file"
+  matrix: "--styleCheck:error --styleCheck:usages"
 """
 
-# xxx pending bug #17960, use: matrix: "--styleCheck:error --styleCheck:usages"
+
 
 import strutils