summaryrefslogtreecommitdiff
path: root/tools/slang-test/options.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-01-10 13:16:30 -0800
committerGitHub <noreply@github.com>2022-01-10 13:16:30 -0800
commit0ac19741937e007ebb45791f53d413d21055feda (patch)
treee058c07fef9138941b253116c1d8a434c334ab67 /tools/slang-test/options.cpp
parent36e9276b1799b476f12db9b24d3073ceef3b7594 (diff)
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 <yhe@nvidia.com> Co-authored-by: Theresa Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'tools/slang-test/options.cpp')
-rw-r--r--tools/slang-test/options.cpp20
1 files changed, 16 insertions, 4 deletions
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<TestCategory> 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;