From 0ac19741937e007ebb45791f53d413d21055feda Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 10 Jan 2022 13:16:30 -0800 Subject: Enable running tests in parallel. (#2078) * Enable running tests in parallel. * Fix linux build. * Add pthread dependency for slang-test. * Fix teamcity output. * Fix race condition. * Make testReporter thread safe. * Clean up. * Fix. * trigger build * Fix. Co-authored-by: Yong He Co-authored-by: Theresa Foley --- tools/slang-test/options.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'tools/slang-test/options.cpp') diff --git a/tools/slang-test/options.cpp b/tools/slang-test/options.cpp index 48a43d621..38ed902a8 100644 --- a/tools/slang-test/options.cpp +++ b/tools/slang-test/options.cpp @@ -23,12 +23,11 @@ TestCategory* TestCategorySet::add(String const& name, TestCategory* parent) TestCategory* TestCategorySet::find(String const& name) { - RefPtr category; - if (!m_categoryMap.TryGetValue(name, category)) + if (auto category = m_categoryMap.TryGetValue(name)) { - return nullptr; + return category->Ptr(); } - return category; + return nullptr; } TestCategory* TestCategorySet::findOrError(String const& name) @@ -191,6 +190,19 @@ static bool _isSubCommand(const char* arg) } optionsOut->adapter = *argCursor++; } + else if (strcmp(arg, "-server-count") == 0) + { + if (argCursor == argEnd) + { + stdError.print("error: expected operand for '%s'\n", arg); + return SLANG_FAIL; + } + optionsOut->serverCount = StringToInt(* argCursor++); + if (optionsOut->serverCount <= 0) + { + optionsOut->serverCount = 1; + } + } else if (strcmp(arg, "-appveyor") == 0) { optionsOut->outputMode = TestOutputMode::AppVeyor; -- cgit v1.2.3