renamed babelcmd to nimblecmd; config files are now nim.cfg; other renamings

This commit is contained in:
Araq 2014-08-29 09:03:00 +02:00
commit cd2c6128d1
25 changed files with 187 additions and 43 deletions

View file

@ -1,6 +1,6 @@
#
#
# The Nimrod Tester
# The Nim Tester
# (c) Copyright 2014 Andreas Rumpf
#
# Look at license.txt for more info.

View file

@ -9,7 +9,7 @@ type
TRunMode = enum
ProcRun, CaasRun, SymbolProcRun
TNimrodSession* = object
NimSession* = object
nim: PProcess # 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.
@ -26,15 +26,15 @@ const
var
TesterDir = getAppDir() / ".."
NimrodBin = TesterDir / "../bin/nimrod"
NimBin = TesterDir / "../bin/nim"
proc replaceVars(session: var TNimrodSession, text: string): string =
proc replaceVars(session: var NimSession, text: string): string =
result = text.replace(filenameReplaceVar, session.filename)
result = result.replace(moduleReplaceVar, session.modname)
result = result.replace(silentReplaceVar, silentReplaceText)
proc startNimrodSession(project, script: string, mode: TRunMode):
TNimrodSession =
NimSession =
let (dir, name, ext) = project.splitFile
result.mode = mode
result.lastOutput = ""
@ -50,10 +50,10 @@ proc startNimrodSession(project, script: string, mode: TRunMode):
removeDir(nimcacheDir / "nimcache")
if mode == CaasRun:
result.nim = startProcess(NimrodBin, workingDir = dir,
result.nim = startProcess(NimBin, workingDir = dir,
args = ["serve", "--server.type:stdin", name])
proc doCaasCommand(session: var TNimrodSession, command: string): string =
proc doCaasCommand(session: var NimSession, command: string): string =
assert session.mode == CaasRun
session.nim.inputStream.write(session.replaceVars(command) & "\n")
session.nim.inputStream.flush
@ -69,11 +69,11 @@ proc doCaasCommand(session: var TNimrodSession, command: string): string =
result = "FAILED TO EXECUTE: " & command & "\n" & result
break
proc doProcCommand(session: var TNimrodSession, command: string): string =
proc doProcCommand(session: var NimSession, command: string): string =
assert session.mode == ProcRun or session.mode == SymbolProcRun
except: result = "FAILED TO EXECUTE: " & command & "\n" & result
var
process = startProcess(NimrodBin, args = session.replaceVars(command).split)
process = startProcess(NimBin, args = session.replaceVars(command).split)
stream = outputStream(process)
line = TaintedString("")
@ -84,7 +84,7 @@ proc doProcCommand(session: var TNimrodSession, command: string): string =
process.close()
proc doCommand(session: var TNimrodSession, command: string) =
proc doCommand(session: var NimSession, command: string) =
if session.mode == CaasRun:
if not session.nim.running:
session.lastOutput = "FAILED TO EXECUTE: " & command & "\n" &
@ -102,7 +102,7 @@ proc doCommand(session: var TNimrodSession, command: string) =
session.lastOutput = doProcCommand(session,
command & " " & session.filename)
proc close(session: var TNimrodSession) {.destructor.} =
proc close(session: var NimSession) {.destructor.} =
if session.mode == CaasRun:
session.nim.close

View file

@ -192,9 +192,9 @@ proc jsTests(r: var TResults, cat: Category, options: string) =
# testSpec(r, t, options)
proc findMainFile(dir: string): string =
# finds the file belonging to ".nimrod.cfg"; if there is no such file
# finds the file belonging to ".nim.cfg"; if there is no such file
# it returns the some ".nim" file if there is only one:
const cfgExt = ".nimrod.cfg"
const cfgExt = ".nim.cfg"
result = ""
var nimFiles = 0
for kind, file in os.walkDir(dir):

View file

@ -7,7 +7,7 @@
# distribution, for details about the copyright.
#
## This program verifies Nimrod against the testcases.
## This program verifies Nim against the testcases.
import
parseutils, strutils, pegs, os, osproc, streams, parsecfg, json,