maybe this time?

This commit is contained in:
Arne Döring 2018-11-19 19:19:21 +01:00 • committed by Araq
commit bfcf82c7e5
2 changed files with 29 additions and 13 deletions

View file

@ -74,11 +74,11 @@ proc getFileDir(filename: string): string =
if not result.isAbsolute(): if not result.isAbsolute():
result = getCurrentDir() / result result = getCurrentDir() / result
proc execCmdEx2*(command: string, options: set[ProcessOption], input: string): tuple[ proc execCmdEx2*(command: string, args: openarray[string], options: set[ProcessOption], input: string): tuple[
output: TaintedString, output: TaintedString,
exitCode: int] {.tags: exitCode: int] {.tags:
[ExecIOEffect, ReadIOEffect, RootEffect], gcsafe.} = [ExecIOEffect, ReadIOEffect, RootEffect], gcsafe.} =
var p = startProcess(command, options=options + {poEvalCommand}) var p = startProcess(command, args=args, options=options)
var outp = outputStream(p) var outp = outputStream(p)
# There is no way to provide input for the child process # There is no way to provide input for the child process
@ -385,8 +385,16 @@ proc testSpec(r: var TResults, test: TTest, target = targetC) =
reExeNotFound) reExeNotFound)
continue continue
let exeCmd = nodejs & " " & quoteShell(exeFile)
var (buf, exitCode) = execCmdEx2(exeCmd, options = {poStdErrToStdOut}, input = expected.input) var exeCmd: string
var args: seq[string]
if isJsTarget:
exeCmd = nodejs
args.add exeFile
else:
exeCmd = exeFile
var (buf, exitCode) = execCmdEx2(exeCmd, args, options = {poStdErrToStdOut}, input = expected.input)
# Treat all failure codes from nodejs as 1. Older versions of nodejs used # Treat all failure codes from nodejs as 1. Older versions of nodejs used
# to return other codes, but for us it is sufficient to know that it's not 0. # to return other codes, but for us it is sufficient to know that it's not 0.

View file

@ -1,7 +1,11 @@
discard """ discard """
disabled: "travis"
""" """
const size = 250000000 const size = 250000000
proc main() =
var saved = newSeq[seq[int8]]() var saved = newSeq[seq[int8]]()
for i in 0..22: for i in 0..22:
@ -12,4 +16,8 @@ for i in 0..22:
for x in saved: for x in saved:
#echo x.len #echo x.len
echo x.len
doAssert x.len == size doAssert x.len == size
main()