Fix compilation without warnings test case

Compilation without warnings test case on Unix systems with older Nim
version 0.19.6 had been failing before the fix, because the compiler
expects full file name to be passed after the '-o' switch, but not only
an output directory name.

Related to #680
This commit is contained in:
Ivan Bobev 2019-08-08 16:34:48 +03:00 committed by Dominik Picheta
commit f0c454a399

View file

@ -882,7 +882,8 @@ test "compilation without warnings":
] ]
proc execBuild(fileName: string): tuple[output: string, exitCode: int] = proc execBuild(fileName: string): tuple[output: string, exitCode: int] =
result = execCmdEx(fmt"nim c -o:{buildDir} {fileName}") result = execCmdEx(
fmt"nim c -o:{buildDir/fileName.splitFile.name} {fileName}")
proc checkOutput(output: string): uint = proc checkOutput(output: string): uint =
const warningsToCheck = [ const warningsToCheck = [
@ -898,6 +899,8 @@ test "compilation without warnings":
checkpoint(line) checkpoint(line)
inc(result) inc(result)
removeDir(buildDir)
var linesWithWarningsCount: uint = 0 var linesWithWarningsCount: uint = 0
for file in filesToBuild: for file in filesToBuild:
let (output, exitCode) = execBuild(file) let (output, exitCode) = execBuild(file)