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

Commit 6963a2a

Browse files
authoredJun 2, 2022
[TouchRunner] Flush the console before exiting. (#114)
1 parent be3a8d0 commit 6963a2a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎NUnitLite/TouchRunner/TouchRunner.cs

+9
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,25 @@ public void Add (Assembly assembly, IList<string> fixtures)
126126
}
127127
}
128128

129+
protected void FlushConsole ()
130+
{
131+
Console.Out.Flush ();
132+
Console.Error.Flush ();
133+
}
134+
129135
[DllImport ("libc")]
130136
static extern void exit (int code);
131137
protected virtual void TerminateWithSuccess ()
132138
{
133139
// For WatchOS we're terminating the extension, not the watchos app itself.
134140
Console.WriteLine ("Exiting test run with success");
141+
FlushConsole ();
135142
exit (0);
136143
}
137144

138145
protected virtual void TerminateWithExitCode (int exitCode)
139146
{
147+
FlushConsole ();
140148
if (exitCode == 0) {
141149
TerminateWithSuccess ();
142150
} else {
@@ -737,6 +745,7 @@ public UINavigationController NavigationController {
737745
protected override void TerminateWithSuccess ()
738746
{
739747
Console.WriteLine ($"Exiting test run with success");
748+
FlushConsole ();
740749
Selector selector = new Selector ("terminateWithSuccess");
741750
UIApplication.SharedApplication.PerformSelector (selector, UIApplication.SharedApplication, 0);
742751
}

0 commit comments

Comments
 (0)
This repository has been archived.