From a9eec21d62ecd1da3929cdbfea872bfc4d22134b Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Thu, 21 Jul 2016 18:12:15 -0400 Subject: [PATCH] [runtime] Decrease the verbosity of the runtime test runner when not running under CI. --- mono/tests/Makefile.am | 10 ++++++++++ mono/tests/test-runner.cs | 40 ++++++++++++++++++++++++++++----------- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/mono/tests/Makefile.am b/mono/tests/Makefile.am index d39fdb3d69c..c8aaaa3d0f5 100644 --- a/mono/tests/Makefile.am +++ b/mono/tests/Makefile.am @@ -19,6 +19,13 @@ test-wrench: check-parallel aotcheck: testaot gshared-aot +# Whenever running under CI +# Can't use make conditionals since +# automake doesn't support them +# CI - Wrench +# BUILD_URL = Jenkins +RUNNING_ON_CI = $(CI)$(BUILD_URL) + TEST_PROG = ../interpreter/mint JITTEST_PROG = $(if $(VALGRIND), valgrind $(VALGRIND_ARGS),) $(if $(SGEN),$(top_builddir)/mono/mini/mono-sgen,$(top_builddir)/mono/mini/mono) @@ -34,6 +41,9 @@ else TEST_RUNNER_ARGS=--config tests-config --runtime $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),mono) endif +TEST_RUNNER_ARGS += $(if $(RUNNING_ON_CI), --verbose,) +TEST_RUNNER_ARGS += $(if $(V), --verbose,) + CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE) with_mono_path = MONO_PATH=$(CLASS) diff --git a/mono/tests/test-runner.cs b/mono/tests/test-runner.cs index f1053bbfde9..cf62e2d1689 100644 --- a/mono/tests/test-runner.cs +++ b/mono/tests/test-runner.cs @@ -47,6 +47,7 @@ public class TestRunner int concurrency = 1; int timeout = 2 * 60; // in seconds int expectedExitCode = 0; + bool verbose = false; string testsuiteName = null; string inputFile = null; @@ -159,6 +160,9 @@ public class TestRunner } 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; @@ -296,7 +300,11 @@ public class TestRunner 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; @@ -370,7 +378,9 @@ public class TestRunner } #endif - output.Write ($"timed out ({timeout}s)"); + if (verbose) { + output.Write ($"timed out ({timeout}s)"); + } try { p.Kill (); @@ -383,7 +393,8 @@ public class TestRunner 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; @@ -391,13 +402,15 @@ public class TestRunner 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 ()); } } }); @@ -538,12 +551,17 @@ public class TestRunner writer.WriteEndDocument (); } - 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 (); -- 2.25.1