Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit ea59b18

Browse files
committed
Print raw test output for failed tests in the CI
1 parent f57caca commit ea59b18

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/runtest.proj

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,23 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
289289
sErrorText = "Unable to read error file: " + errorFile%3B
290290
}
291291
292+
string outputText = null%3B
293+
try
294+
{
295+
System.IO.StreamReader outputReader = new System.IO.StreamReader(outputFile)%3B
296+
outputText = outputReader.ReadToEnd()%3B
297+
outputReader.Close()%3B
298+
}
299+
catch(Exception ex)
300+
{
301+
outputText = "Unable to read output file: " + outputFile%3B
302+
}
303+
292304
string msg = infraEx != null ? "Test Infrastructure Failure: " + infraEx.Message
293305
: sErrorText + "\n\n" +
294-
"Raw output: " + outputFile + "\n" +
306+
"Return code: " + ret + "\n" +
307+
"Raw output file: " + outputFile + "\n" +
308+
"Raw output:\n" + outputText + "\n" +
295309
"To run the test:\n" +
296310
"> set CORE_ROOT=" + _Global.coreRoot + "\n" +
297311
"> " + testExecutable + "\n"%3B

0 commit comments

Comments
 (0)