summary refs log tree commit diff stats
path: root/testament
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2019-01-11 08:03:19 -0800
committerAndreas Rumpf <rumpf_a@web.de>2019-01-11 17:03:19 +0100
commit09ef25810aa7de55c32dfe7025668f1f889d00d6 (patch)
tree34aad6bb3ff168baace63c2195cb0ef2e3f51b42 /testament
parent5397c5d31d58f14ad39e8009882a87ceda6253aa (diff)
downloadNim-09ef25810aa7de55c32dfe7025668f1f889d00d6.tar.gz
refs #10249 ; more debug info to diagnose failures (#10266)
Diffstat (limited to 'testament')
-rw-r--r--testament/tester.nim16
1 files changed, 10 insertions, 6 deletions
diff --git a/testament/tester.nim b/testament/tester.nim
index 1867871c5..04552b7c9 100644
--- a/testament/tester.nim
+++ b/testament/tester.nim
@@ -104,15 +104,19 @@ proc execCmdEx2(command: string, args: openarray[string], options: set[ProcessOp
   var line = newStringOfCap(120).TaintedString
   while true:
     if outp.readLine(line):
-      result[0].string.add(line.string)
-      result[0].string.add("\n")
+      result.output.string.add(line.string)
+      result.output.string.add("\n")
       if onStdout != nil: onStdout(line.string)
     else:
-      result[1] = peekExitCode(p)
-      if result[1] != -1: break
+      result.exitCode = peekExitCode(p)
+      if result.exitCode != -1: break
   close(p)
-
-
+  if result.exitCode != 0:
+    var command2 = command
+    if args.len > 0: command2.add " " & args.quoteShellCommand
+    echo (msg: "execCmdEx2 failed",
+      command: command2,
+      options: options)
 
 proc nimcacheDir(filename, options: string, target: TTarget): string =
   ## Give each test a private nimcache dir so they don't clobber each other's.