diff options
author | Araq <rumpf_a@web.de> | 2018-12-06 16:37:56 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-12-11 21:23:23 +0100 |
commit | 3b783f7e131c6b5be5057127985d8ccb699d6d06 (patch) | |
tree | 2d1b08daa8b7a42912fd415bdc0242ee512c9558 /testament/specs.nim | |
parent | 8896770f8f9fa7057a11598b64160e7bce6a4266 (diff) | |
download | Nim-3b783f7e131c6b5be5057127985d8ccb699d6d06.tar.gz |
Testament: refactoring; makes the test joiner green
Diffstat (limited to 'testament/specs.nim')
-rw-r--r-- | testament/specs.nim | 13 |
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) |