From 8bd5bf805c477fa176bd46fd3d1b7cb207b27ea8 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 11 Jan 2022 18:15:56 +0100 Subject: [PATCH] [MIRROR] Prepares unit tests for vscode extension update. [MDB IGNORE] (#10596) * Prepares unit tests for vscode extension update. (#63963) * Prepares unit tests for vscode extension update. Co-authored-by: AnturK --- code/modules/unit_tests/_unit_tests.dm | 2 +- code/modules/unit_tests/unit_test.dm | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index 965b459db88..0b3c0a60120 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -117,5 +117,5 @@ #undef TEST_ASSERT #undef TEST_ASSERT_EQUAL #undef TEST_ASSERT_NOTEQUAL -#undef TEST_FOCUS +//#undef TEST_FOCUS - This define is used by vscode unit test extension to pick specific unit tests to run and appended later so needs to be used out of scope here #endif diff --git a/code/modules/unit_tests/unit_test.dm b/code/modules/unit_tests/unit_test.dm index 4a5e3ed32c4..97639c4946e 100644 --- a/code/modules/unit_tests/unit_test.dm +++ b/code/modules/unit_tests/unit_test.dm @@ -110,11 +110,13 @@ GLOBAL_VAR(test_log) CHECK_TICK var/list/tests_to_run = subtypesof(/datum/unit_test) + var/list/focused_tests = list() for (var/_test_to_run in tests_to_run) var/datum/unit_test/test_to_run = _test_to_run if (initial(test_to_run.focus)) - tests_to_run = list(test_to_run) - break + focused_tests += test_to_run + if(length(focused_tests)) + tests_to_run = focused_tests tests_to_run = sortTim(tests_to_run, /proc/cmp_unit_test_priority)