summary refs log tree commit diff stats
path: root/testament/specs.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-12-06 16:37:56 +0100
committerAraq <rumpf_a@web.de>2018-12-11 21:23:23 +0100
commit3b783f7e131c6b5be5057127985d8ccb699d6d06 (patch)
tree2d1b08daa8b7a42912fd415bdc0242ee512c9558 /testament/specs.nim
parent8896770f8f9fa7057a11598b64160e7bce6a4266 (diff)
downloadNim-3b783f7e131c6b5be5057127985d8ccb699d6d06.tar.gz
Testament: refactoring; makes the test joiner green
Diffstat (limited to 'testament/specs.nim')
-rw-r--r--testament/specs.nim13
1 files changed, 6 insertions, 7 deletions
diff --git a/testament/specs.nim b/testament/specs.nim
index 9cbf2a9f6..6283d18d7 100644
--- a/testament/specs.nim
+++ b/testament/specs.nim
@@ -14,9 +14,6 @@ var compilerPrefix* = "compiler" / "nim"
 let isTravis* = existsEnv("TRAVIS")
 let isAppVeyor* = existsEnv("APPVEYOR")
 
-proc cmdTemplate*(): string =
-  compilerPrefix & " $target --hints:on -d:testing --nimblePath:tests/deps $options $file"
-
 type
   TTestAction* = enum
     actionRun = "run"
@@ -70,6 +67,12 @@ type
     nimout*: string
     parseErrors*: string # when the spec definition is invalid, this is not empty.
 
+proc getCmd*(s: TSpec): string =
+  if s.cmd.len == 0:
+    result = compilerPrefix & " $target --hints:on -d:testing --nimblePath:tests/deps $options $file"
+  else:
+    result = s.cmd
+
 const
   targetToExt*: array[TTarget, string] = ["c", "cpp", "m", "js"]
   targetToCmd*: array[TTarget, string] = ["c", "cpp", "objc", "js"]
@@ -97,9 +100,6 @@ proc extractSpec(filename: string): string =
 when not defined(nimhygiene):
   {.pragma: inject.}
 
-proc defaultSpec*(): TSpec =
-  result.cmd = cmdTemplate()
-
 proc parseTargets*(value: string): set[TTarget] =
   for v in value.normalize.splitWhitespace:
     case v
@@ -119,7 +119,6 @@ proc addLine*(self: var string; a,b: string) =
   self.add "\n"
 
 proc parseSpec*(filename: string): TSpec =
-  result = defaultSpec()
   result.file = filename
   let specStr = extractSpec(filename)
   var ss = newStringStream(specStr)
;rumpf_a@web.de> 2017-10-30 00:27:30 +0100 committer Andreas Rumpf <rumpf_a@web.de> 2017-10-30 00:27:30 +0100 breaking change: 'and' and 'mod' do not produce a subrange type anymore; fixes #5854' href='/ahoang/Nim/commit/changelog.md?h=devel&id=d7a896f19dfc7ff2ad22b78ef03e4db73332fc7e'>d7a896f19 ^
90c1b94fb ^

560d87f5f ^
90c1b94fb ^
9565da11e ^
089506498 ^

4e4d466d0 ^







742f43e57 ^












136dbd3c6 ^










5e66a7ce5 ^



a4d40d137 ^


661ce8b8c ^

908a25a2c ^

55cdaaef6 ^
844e12306 ^

0594a3a70 ^


908a25a2c ^
0594a3a70 ^






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96