From b70005c3890f169a1ac7b9e05cb5d4377d64d55e Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Tue, 18 Jun 2024 19:27:45 +0000 Subject: [PATCH] run-tests: Group all tests for a single dll together. --- tools/run-tests/run-tests.cs | 90 ++++++++++++++++++------------------ 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/tools/run-tests/run-tests.cs b/tools/run-tests/run-tests.cs index 0d2371cf..75e9f90b 100644 --- a/tools/run-tests/run-tests.cs +++ b/tools/run-tests/run-tests.cs @@ -306,9 +306,9 @@ bool should_run_fixture(string fixture, string arch, bool run_all) return result; } - void run_clr_test_list(string filename, string fixture, string arch, List to_run, ref bool any_passed, ref bool any_failed, ref bool any_skipped) + void run_clr_test_list(string testname, string filename, string arch, List to_run, ref bool any_passed, ref bool any_failed, ref bool any_skipped) { - string fullfixture = String.Format("{0}.{1}", arch, fixture); + string fulltest = String.Format("{0}.{1}", arch, testname); string outputfile = Path.GetTempFileName(); try @@ -319,7 +319,7 @@ void run_clr_test_list(string filename, string fixture, string arch, List testlist, bool run_all) + void collect_clr_tests(string filename, string fixture, string arch, List testlist, bool run_all, List to_run) { string fullfixture = String.Format("{0}.{1}", arch, fixture); - List to_run = new List (); - - Console.WriteLine("Running {0}", fullfixture); List runs = new List (); if (run_list.ContainsKey(fixture) && run_list[fixture] != null) @@ -425,15 +428,16 @@ void run_clr_test_fixture(string filename, string fixture, string arch, List to_run) + { + string fulltest = String.Format("{0}.{1}", arch, filename); + + Console.WriteLine("Running {0}", fulltest); int batch_size = 100; bool any_passed = false; @@ -442,36 +446,28 @@ void run_clr_test_fixture(string filename, string fixture, string arch, List tests_to_run = new List(); if (skip_list.ContainsKey(testname) || skip_list.ContainsKey(fulltestname)) @@ -496,8 +493,6 @@ void run_clr_test_dll(string filename, string arch) if (fixtures == null) return; - bool copied_config = false; - string nunitlite_config = filename+".nunitlite.config"; string exe_config = null; @@ -507,17 +502,24 @@ void run_clr_test_dll(string filename, string arch) var testlist = t.Item2; if (should_run_fixture(testfixture, arch, run_all)) - { - if (!copied_config && File.Exists(nunitlite_config)) { - exe_config = get_nunit_lite_console(arch)+".config"; - File.Copy(nunitlite_config, exe_config, true); - copied_config = true; - } + collect_clr_tests(filename, testfixture, arch, testlist, run_all, tests_to_run); + } - run_clr_test_fixture(filename, testfixture, arch, testlist, run_all); - } + if (tests_to_run.Count == 0) { + return; } + bool copied_config = false; + + if (File.Exists(nunitlite_config)) + { + exe_config = get_nunit_lite_console(arch)+".config"; + File.Copy(nunitlite_config, exe_config, true); + copied_config = true; + } + + run_clr_tests(testname, filename, arch, tests_to_run); + if (copied_config) { File.Delete(exe_config); }