using System;
using System.IO;
using System.Threading;
-using System.Text;
using System.Diagnostics;
using System.Collections.Generic;
using System.Globalization;
int concurrency = 1;
int timeout = 2 * 60; // in seconds
int expectedExitCode = 0;
+ bool verbose = false;
string testsuiteName = null;
string inputFile = null;
}
aot_build_flags = args [i + 1].Substring(0, args [i + 1].Length);
i += 2;
+ } else if (args [i] == "--verbose") {
+ verbose = true;
+ i ++;
} else {
Console.WriteLine ("Unknown command line option: '" + args [i] + "'.");
return 1;
string test = ti.test;
string opt_set = ti.opt_set;
- output.Write (String.Format ("{{0,-{0}}} ", output_width), test);
+ if (verbose) {
+ output.Write (String.Format ("{{0,-{0}}} ", output_width), test);
+ } else {
+ Console.Write (".");
+ }
string test_invoke;
}
#endif
- output.Write ($"timed out ({timeout}s)");
+ if (verbose) {
+ output.Write ($"timed out ({timeout}s)");
+ }
try {
p.Kill ();
failed.Add (data);
}
- output.Write ("failed, time: {0}, exit code: {1}", (end - start).ToString (TEST_TIME_FORMAT), p.ExitCode);
+ if (verbose)
+ output.Write ("failed, time: {0}, exit code: {1}", (end - start).ToString (TEST_TIME_FORMAT), p.ExitCode);
} else {
var end = DateTime.UtcNow;
passed.Add (data);
}
- output.Write ("passed, time: {0}", (end - start).ToString (TEST_TIME_FORMAT));
+ if (verbose)
+ output.Write ("passed, time: {0}", (end - start).ToString (TEST_TIME_FORMAT));
}
p.Close ();
lock (monitor) {
- Console.WriteLine (output.ToString ());
+ if (verbose)
+ Console.WriteLine (output.ToString ());
}
}
});
XmlWriterSettings xmlWriterSettings = new XmlWriterSettings ();
xmlWriterSettings.NewLineOnAttributes = true;
xmlWriterSettings.Indent = true;
- using (XmlWriter writer = XmlWriter.Create (String.Format ("TestResult-{0}.xml", testsuiteName), xmlWriterSettings)) {
+
+ string xmlPath = String.Format ("TestResult-{0}.xml", testsuiteName);
+ using (XmlWriter writer = XmlWriter.Create (xmlPath, xmlWriterSettings)) {
// <?xml version="1.0" encoding="utf-8" standalone="no"?>
writer.WriteStartDocument ();
// <!--This file represents the results of running a test suite-->
// </test-results>
writer.WriteEndElement ();
writer.WriteEndDocument ();
+
+ string babysitterXmlList = Environment.GetEnvironmentVariable("MONO_BABYSITTER_NUNIT_XML_LIST_FILE");
+ if (!String.IsNullOrEmpty(babysitterXmlList)) {
+ try {
+ string fullXmlPath = Path.GetFullPath(xmlPath);
+ File.AppendAllText(babysitterXmlList, fullXmlPath + Environment.NewLine);
+ } catch (Exception e) {
+ Console.WriteLine("Attempted to record XML path to file {0} but failed.", babysitterXmlList);
+ }
+ }
}
- Console.WriteLine ();
- Console.WriteLine ("Time: {0}", test_time.ToString (TEST_TIME_FORMAT));
- Console.WriteLine ();
- Console.WriteLine ("{0,4} test(s) passed", npassed);
- Console.WriteLine ("{0,4} test(s) failed", nfailed);
- Console.WriteLine ("{0,4} test(s) timed out", ntimedout);
+ if (verbose) {
+ Console.WriteLine ();
+ Console.WriteLine ("Time: {0}", test_time.ToString (TEST_TIME_FORMAT));
+ Console.WriteLine ();
+ Console.WriteLine ("{0,4} test(s) passed", npassed);
+ Console.WriteLine ("{0,4} test(s) failed", nfailed);
+ Console.WriteLine ("{0,4} test(s) timed out", ntimedout);
+ } else {
+ Console.WriteLine ();
+ Console.WriteLine (String.Format ("{0} test(s) passed, {1} test(s) did not pass.", npassed, nfailed));
+ }
if (nfailed > 0) {
Console.WriteLine ();