diff options
author | def <dennis@felsin9.de> | 2015-01-20 14:21:49 +0100 |
---|---|---|
committer | def <dennis@felsin9.de> | 2015-01-20 14:21:49 +0100 |
commit | d2ef99071ca518805722c9e77523388a74c7b8e9 (patch) | |
tree | 257b41f7bb73aedaa7676c72050357d8114d2263 /tests | |
parent | a295866ce8381f3a5bb723e2687282bb38896e65 (diff) | |
download | Nim-d2ef99071ca518805722c9e77523388a74c7b8e9.tar.gz |
Make caasdriver compile
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testament/caasdriver.nim | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/testament/caasdriver.nim b/tests/testament/caasdriver.nim index 8f2eec33b..c61a9f108 100644 --- a/tests/testament/caasdriver.nim +++ b/tests/testament/caasdriver.nim @@ -1,4 +1,5 @@ import osproc, streams, os, strutils, re +{.experimental.} ## Compiler as a service tester. ## @@ -10,7 +11,7 @@ type ProcRun, CaasRun, SymbolProcRun NimSession* = object - nim: PProcess # Holds the open process for CaasRun sessions, nil otherwise. + nim: Process # Holds the open process for CaasRun sessions, nil otherwise. mode: TRunMode # Stores the type of run mode the session was started with. lastOutput: string # Preserves the last output, needed for ProcRun mode. filename: string # Appended to each command starting with '>'. Also a var. @@ -70,8 +71,10 @@ proc doCaasCommand(session: var NimSession, command: string): string = break proc doProcCommand(session: var NimSession, command: string): string = - assert session.mode == ProcRun or session.mode == SymbolProcRun - except: result = "FAILED TO EXECUTE: " & command & "\n" & result + try: + assert session.mode == ProcRun or session.mode == SymbolProcRun + except: + result = "FAILED TO EXECUTE: " & command & "\n" & result var process = startProcess(NimBin, args = session.replaceVars(command).split) stream = outputStream(process) @@ -102,11 +105,11 @@ proc doCommand(session: var NimSession, command: string) = session.lastOutput = doProcCommand(session, command & " " & session.filename) -proc close(session: var NimSession) {.destructor.} = +proc destroy(session: var NimSession) {.destructor.} = if session.mode == CaasRun: session.nim.close -proc doScenario(script: string, output: PStream, mode: TRunMode, verbose: bool): bool = +proc doScenario(script: string, output: Stream, mode: TRunMode, verbose: bool): bool = result = true var f = open(script) @@ -171,7 +174,7 @@ when isMainModule: failures = 0 verbose = false - for i in 0..ParamCount() - 1: + for i in 0..paramCount() - 1: let param = string(paramStr(i + 1)) case param of "verbose": verbose = true |