Add readme to tests. Add fileDir option to testament & create nimble test.
This commit is contained in:
parent
c9e093d61d
commit
9b465a2361
17 changed files with 151 additions and 49 deletions
|
|
@ -70,10 +70,17 @@ proc normalizeMsg(s: string): string =
|
|||
if result.len > 0: result.add '\L'
|
||||
result.add x.strip
|
||||
|
||||
proc getFileDir(filename: string): string =
|
||||
result = filename.splitFile().dir
|
||||
if not result.isAbsolute():
|
||||
result = getCurrentDir() / result
|
||||
|
||||
proc callCompiler(cmdTemplate, filename, options: string,
|
||||
target: TTarget): TSpec =
|
||||
let c = parseCmdLine(cmdTemplate % ["target", targetToCmd[target],
|
||||
"options", options, "file", filename.quoteShell])
|
||||
"options", options, "file", filename.quoteShell,
|
||||
"filedir", filename.getFileDir()])
|
||||
echo(c)
|
||||
var p = startProcess(command=c[0], args=c[1.. ^1],
|
||||
options={poStdErrToStdOut, poUsePath})
|
||||
let outp = p.outputStream
|
||||
|
|
@ -118,7 +125,8 @@ proc callCompiler(cmdTemplate, filename, options: string,
|
|||
proc callCCompiler(cmdTemplate, filename, options: string,
|
||||
target: TTarget): TSpec =
|
||||
let c = parseCmdLine(cmdTemplate % ["target", targetToCmd[target],
|
||||
"options", options, "file", filename.quoteShell])
|
||||
"options", options, "file", filename.quoteShell,
|
||||
"filedir", filename.getFileDir()])
|
||||
var p = startProcess(command="gcc", args=c[5.. ^1],
|
||||
options={poStdErrToStdOut, poUsePath})
|
||||
let outp = p.outputStream
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue