summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--doc/testament.rst9
-rw-r--r--testament/specs.nim20
-rw-r--r--tests/align/talign.nim2
-rw-r--r--tests/arc/trtree.nim2
-rw-r--r--tests/ccgbugs/tmissingvolatile.nim2
-rw-r--r--tests/ccgbugs/tprogmem.nim2
-rw-r--r--tests/ccgbugs2/tinefficient_const_table.nim2
-rw-r--r--tests/closure/tclosure.nim2
-rw-r--r--tests/compiler/tcppCompileToNamespace.nim1
-rw-r--r--tests/coroutines/texceptions.nim2
-rw-r--r--tests/coroutines/tgc.nim2
-rw-r--r--tests/coroutines/titerators.nim2
-rw-r--r--tests/coroutines/twait.nim2
-rw-r--r--tests/cpp/tevalorder.nim2
-rw-r--r--tests/destructor/tmove_objconstr.nim2
-rw-r--r--tests/destructor/tuse_result_prevents_sinks.nim2
-rw-r--r--tests/exception/t9657.nim2
-rw-r--r--tests/flags/tgenscript.nim2
-rw-r--r--tests/iter/titervaropenarray.nim2
-rw-r--r--tests/objects/tobjcov.nim2
-rw-r--r--tests/stdlib/t10231.nim2
-rw-r--r--tests/stdlib/thashes.nim2
-rw-r--r--tests/stdlib/ttimes.nim2
-rw-r--r--tests/system/tatomics1.nim2
24 files changed, 33 insertions, 39 deletions
diff --git a/doc/testament.rst b/doc/testament.rst
index 1a1909022..253afb33d 100644
--- a/doc/testament.rst
+++ b/doc/testament.rst
@@ -152,8 +152,11 @@ Example "template" **to edit** and write a Testament unittest:
     # Timeout seconds to run the test. Fractional values are supported.
     timeout: 1.5
 
-    # Targets to run the test into (C, C++, JavaScript, etc).
-    target: "c js"
+    # Targets to run the test into (c, cpp, objc, js).
+    targets: "c js"
+
+    # flags with which to run the test, delimited by `;`
+    matrix: "; -d:release; -d:caseFoo -d:release"
 
     # Conditions that will skip this test. Use of multiple "disabled" clauses
     # is permitted.
@@ -221,7 +224,7 @@ JavaScript tests:
 .. code-block:: nim
 
   discard """
-    target: "js"
+    targets: "js"
   """
   when defined(js):
     import jsconsole
diff --git a/testament/specs.nim b/testament/specs.nim
index e15dcb85c..a7f0fd4bb 100644
--- a/testament/specs.nim
+++ b/testament/specs.nim
@@ -218,7 +218,7 @@ proc parseTargets*(value: string): set[TTarget] =
     of "cpp", "c++": result.incl(targetCpp)
     of "objc": result.incl(targetObjC)
     of "js": result.incl(targetJS)
-    else: echo "target ignored: " & v
+    else: raise newException(ValueError, "invalid target: '$#'" % v)
 
 proc addLine*(self: var string; a: string) =
   self.add a
@@ -377,19 +377,11 @@ proc parseSpec*(filename: string): TSpec =
           result.timeout = parseFloat(e.value)
         except ValueError:
           result.parseErrors.addLine "cannot interpret as a float: ", e.value
-      of "target", "targets":
-        for v in e.value.normalize.splitWhitespace:
-          case v
-          of "c":
-            result.targets.incl(targetC)
-          of "cpp", "c++":
-            result.targets.incl(targetCpp)
-          of "objc":
-            result.targets.incl(targetObjC)
-          of "js":
-            result.targets.incl(targetJS)
-          else:
-            result.parseErrors.addLine "cannot interpret as a target: ", e.value
+      of "targets", "target":
+        try:
+          result.targets.incl parseTargets(e.value)
+        except ValueError as e:
+          result.parseErrors.addLine e.msg
       of "matrix":
         for v in e.value.split(';'):
           result.matrix.add(v.strip)
diff --git a/tests/align/talign.nim b/tests/align/talign.nim
index e0503cc70..3b8f6b4df 100644
--- a/tests/align/talign.nim
+++ b/tests/align/talign.nim
@@ -1,6 +1,6 @@
 discard """
 ccodeCheck: "\\i @'NIM_ALIGN(128) NI mylocal1' .*"
-target: "c cpp"
+targets: "c cpp"
 output: "align ok"
 """
 
diff --git a/tests/arc/trtree.nim b/tests/arc/trtree.nim
index 986268f51..5659a5bdc 100644
--- a/tests/arc/trtree.nim
+++ b/tests/arc/trtree.nim
@@ -1,7 +1,7 @@
 discard """
   output: '''1 [2, 3, 4, 7]
 [0, 0]'''
-  target: "c"
+  targets: "c"
   joinable: false
 disabled: 32bit
   cmd: "nim c --gc:arc $file"
diff --git a/tests/ccgbugs/tmissingvolatile.nim b/tests/ccgbugs/tmissingvolatile.nim
index 60b1771dc..1eccdc6b1 100644
--- a/tests/ccgbugs/tmissingvolatile.nim
+++ b/tests/ccgbugs/tmissingvolatile.nim
@@ -2,7 +2,7 @@ discard """
   output: "1"
   cmd: r"nim c --hints:on $options -d:release $file"
   ccodecheck: "'NI volatile state;'"
-  target: "C"
+  targets: "c"
 """
 
 # bug #1539
diff --git a/tests/ccgbugs/tprogmem.nim b/tests/ccgbugs/tprogmem.nim
index 884ca158a..58a20583a 100644
--- a/tests/ccgbugs/tprogmem.nim
+++ b/tests/ccgbugs/tprogmem.nim
@@ -2,7 +2,7 @@ discard """
   output: "5"
   cmd: r"nim c --hints:on $options -d:release $file"
   ccodecheck: "'/*PROGMEM*/ myLetVariable = {'"
-  target: "C"
+  targets: "c"
 """
 
 var myLetVariable {.exportc, codegenDecl: "$# /*PROGMEM*/ $#".} = [1, 2, 3]
diff --git a/tests/ccgbugs2/tinefficient_const_table.nim b/tests/ccgbugs2/tinefficient_const_table.nim
index a1b89e220..8ab895cb0 100644
--- a/tests/ccgbugs2/tinefficient_const_table.nim
+++ b/tests/ccgbugs2/tinefficient_const_table.nim
@@ -6,7 +6,7 @@ of
 words'''
   cmd: r"nim c --hints:on $options -d:release $file"
   ccodecheck: "! @'genericSeqAssign'"
-  target: "c"
+  targets: "c"
 """
 
 # bug #4354
diff --git a/tests/closure/tclosure.nim b/tests/closure/tclosure.nim
index 7e2ec7a77..546d7026d 100644
--- a/tests/closure/tclosure.nim
+++ b/tests/closure/tclosure.nim
@@ -1,5 +1,5 @@
 discard """
-  target: "c"
+  targets: "c"
   output: '''
 1 3 6 11 20 foo
 foo88
diff --git a/tests/compiler/tcppCompileToNamespace.nim b/tests/compiler/tcppCompileToNamespace.nim
index 1d0977236..4e895c38b 100644
--- a/tests/compiler/tcppCompileToNamespace.nim
+++ b/tests/compiler/tcppCompileToNamespace.nim
@@ -1,6 +1,5 @@
 discard """
 cmd: "nim cpp --cppCompileToNamespace:foo $options -r $file"
-target: cpp
 """
 
 # Theoretically nim could just ignore the flag cppCompileToNamespace
diff --git a/tests/coroutines/texceptions.nim b/tests/coroutines/texceptions.nim
index 7b5d57ec0..31feffdff 100644
--- a/tests/coroutines/texceptions.nim
+++ b/tests/coroutines/texceptions.nim
@@ -1,5 +1,5 @@
 discard """
-  target: "c"
+  targets: "c"
   disabled: true
 """
 
diff --git a/tests/coroutines/tgc.nim b/tests/coroutines/tgc.nim
index 46f4f8e83..311ec5efc 100644
--- a/tests/coroutines/tgc.nim
+++ b/tests/coroutines/tgc.nim
@@ -1,5 +1,5 @@
 discard """
-  target: "c"
+  targets: "c"
 """
 
 import coro
diff --git a/tests/coroutines/titerators.nim b/tests/coroutines/titerators.nim
index d12a5debe..1ea134811 100644
--- a/tests/coroutines/titerators.nim
+++ b/tests/coroutines/titerators.nim
@@ -1,5 +1,5 @@
 discard """
-  target: "c"
+  targets: "c"
 disabled: true
 """
 
diff --git a/tests/coroutines/twait.nim b/tests/coroutines/twait.nim
index b88801869..348007afb 100644
--- a/tests/coroutines/twait.nim
+++ b/tests/coroutines/twait.nim
@@ -1,6 +1,6 @@
 discard """
   output: "Exit 1\nExit 2"
-  target: "c"
+  targets: "c"
 """
 import coro
 
diff --git a/tests/cpp/tevalorder.nim b/tests/cpp/tevalorder.nim
index f130cef6c..4764f3aca 100644
--- a/tests/cpp/tevalorder.nim
+++ b/tests/cpp/tevalorder.nim
@@ -2,7 +2,7 @@ discard """
   output: '''0
 1
 2'''
-target: "cpp"
+targets: "cpp"
 """
 
 # bug #8202
diff --git a/tests/destructor/tmove_objconstr.nim b/tests/destructor/tmove_objconstr.nim
index 16d0daa22..5faaabb8b 100644
--- a/tests/destructor/tmove_objconstr.nim
+++ b/tests/destructor/tmove_objconstr.nim
@@ -8,7 +8,7 @@ test destroyed 0
 4
 Pony is dying!'''
 joinable: false
-target: "C"
+targets: "c"
 """
 
 # bug #4214
diff --git a/tests/destructor/tuse_result_prevents_sinks.nim b/tests/destructor/tuse_result_prevents_sinks.nim
index 6eac5c902..d2777bd97 100644
--- a/tests/destructor/tuse_result_prevents_sinks.nim
+++ b/tests/destructor/tuse_result_prevents_sinks.nim
@@ -1,6 +1,6 @@
 discard """
   output: ""
-  target: "C"
+  targets: "c"
 """
 
 # bug #9594
diff --git a/tests/exception/t9657.nim b/tests/exception/t9657.nim
index 514d29353..6ac525a70 100644
--- a/tests/exception/t9657.nim
+++ b/tests/exception/t9657.nim
@@ -1,7 +1,7 @@
 discard """
   action: run
   exitcode: 1
-  target: "c cpp"
+  targets: "c cpp"
   disabled: "openbsd"
   disabled: "netbsd"
 """
diff --git a/tests/flags/tgenscript.nim b/tests/flags/tgenscript.nim
index bf83ab972..d58395a40 100644
--- a/tests/flags/tgenscript.nim
+++ b/tests/flags/tgenscript.nim
@@ -1,5 +1,5 @@
 discard """
-  target: "c"
+  targets: "c"
   action: compile
 """
 
diff --git a/tests/iter/titervaropenarray.nim b/tests/iter/titervaropenarray.nim
index 4469fdcf5..ad1192bd8 100644
--- a/tests/iter/titervaropenarray.nim
+++ b/tests/iter/titervaropenarray.nim
@@ -1,6 +1,6 @@
 discard """
   output: "123"
-  targets: "C"
+  targets: "c"
 """
 # Try to break the transformation pass:
 iterator iterAndZero(a: var openArray[int]): int =
diff --git a/tests/objects/tobjcov.nim b/tests/objects/tobjcov.nim
index 6c587e04d..a12f74702 100644
--- a/tests/objects/tobjcov.nim
+++ b/tests/objects/tobjcov.nim
@@ -1,6 +1,6 @@
 discard """
 action: compile
-target: "c"
+targets: "c"
 """
 
 # Covariance is not type safe:
diff --git a/tests/stdlib/t10231.nim b/tests/stdlib/t10231.nim
index 2bb64b475..3b2b684f3 100644
--- a/tests/stdlib/t10231.nim
+++ b/tests/stdlib/t10231.nim
@@ -1,5 +1,5 @@
 discard """
-  target: cpp
+  targets: "cpp"
   action: run
   exitcode: 0
 """
diff --git a/tests/stdlib/thashes.nim b/tests/stdlib/thashes.nim
index 92154825e..520b27e26 100644
--- a/tests/stdlib/thashes.nim
+++ b/tests/stdlib/thashes.nim
@@ -1,5 +1,5 @@
 discard """
-  targets: '''c c++ js'''
+  targets: "c cpp js"
 """
 
 import hashes
diff --git a/tests/stdlib/ttimes.nim b/tests/stdlib/ttimes.nim
index 4d89ffa1a..a7677edf9 100644
--- a/tests/stdlib/ttimes.nim
+++ b/tests/stdlib/ttimes.nim
@@ -1,5 +1,5 @@
 discard """
-  target: "c js"
+  targets: "c js"
 """
 
 import times, strutils, unittest
diff --git a/tests/system/tatomics1.nim b/tests/system/tatomics1.nim
index 88ab705a8..217fd07fa 100644
--- a/tests/system/tatomics1.nim
+++ b/tests/system/tatomics1.nim
@@ -1,5 +1,5 @@
 discard """
-  target: "c cpp js"
+  targets: "c cpp js"
 """
 
 var x = 10