summaryrefslogtreecommitdiffstats
path: root/tools/slang-test/main.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2018-11-09 10:23:37 -0500
committerGitHub <noreply@github.com>2018-11-09 10:23:37 -0500
commitd782a162a783eab3f4a57a22056c5eba04c2b4ae (patch)
tree36be12801f7e6833133f86eb7f6437c037038922 /tools/slang-test/main.cpp
parentde6ca4df6668aa4f3f5113410e2e898e37cd7bc4 (diff)
Feature/teamcity output (#715)
* First pass support for TeamCity compatible output. * Remove reset of counters on starting suite - so summary is over all suites.
Diffstat (limited to 'tools/slang-test/main.cpp')
-rw-r--r--tools/slang-test/main.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/tools/slang-test/main.cpp b/tools/slang-test/main.cpp
index 22749c206..30fa709d7 100644
--- a/tools/slang-test/main.cpp
+++ b/tools/slang-test/main.cpp
@@ -222,6 +222,10 @@ Result parseOptions(int* argc, char** argv)
{
g_options.outputMode = TestOutputMode::XUnit2;
}
+ else if (strcmp(arg, "-teamcity") == 0)
+ {
+ g_options.outputMode = TestOutputMode::TeamCity;
+ }
else if( strcmp(arg, "-category") == 0 )
{
if( argCursor == argEnd )
@@ -1670,7 +1674,7 @@ TestResult runTest(
testInput.testList = &testList;
{
- TestContext::Scope scope(context, outputStem);
+ TestContext::TestScope scope(context, outputStem);
TestResult testResult = ii->callback(context, testInput);
context->addResult(testResult);
@@ -1957,18 +1961,21 @@ int main(
// Setup the context
TestContext context(g_options.outputMode);
-
context.m_dumpOutputOnFailure = g_options.dumpOutputOnFailure;
context.m_isVerbose = g_options.shouldBeVerbose;
-
- // Enumerate test files according to policy
- // TODO: add more directories to this list
- // TODO: allow for a command-line argument to select a particular directory
- runTestsInDirectory(&context, "tests/");
-
+
+ {
+ TestContext::SuiteScope suiteScope(&context, "tests");
+ // Enumerate test files according to policy
+ // TODO: add more directories to this list
+ // TODO: allow for a command-line argument to select a particular directory
+ runTestsInDirectory(&context, "tests/");
+ }
+
// Run the unit tests (these are internal C++ tests - not specified via files in a directory)
// They are registered with SLANG_UNIT_TEST macro
{
+ TestContext::SuiteScope suiteScope(&context, "unit tests");
TestContext::set(&context);
// Run the unit tests
@@ -2003,7 +2010,6 @@ int main(
TestContext::set(nullptr);
}
-
context.outputSummary();