Cleaned up stout test setup code slightly.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ee3b04bc Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ee3b04bc Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ee3b04bc Branch: refs/heads/master Commit: ee3b04bc9d3fbfcefa9e27c1e3e34ed15ca064e8 Parents: bca95ca Author: Neil Conway <[email protected]> Authored: Mon Apr 24 11:22:43 2017 -0400 Committer: Neil Conway <[email protected]> Committed: Mon Apr 24 11:47:26 2017 -0400 ---------------------------------------------------------------------- 3rdparty/stout/include/stout/tests/environment.hpp | 10 ++++++---- 3rdparty/stout/tests/main.cpp | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/ee3b04bc/3rdparty/stout/include/stout/tests/environment.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/stout/include/stout/tests/environment.hpp b/3rdparty/stout/include/stout/tests/environment.hpp index 211f1fb..5909aa7 100644 --- a/3rdparty/stout/include/stout/tests/environment.hpp +++ b/3rdparty/stout/include/stout/tests/environment.hpp @@ -42,8 +42,10 @@ public: if (strings::contains(test->test_case_name(), pattern) || strings::contains(test->name(), pattern)) { return true; - } else if (test->type_param() != nullptr && - strings::contains(test->type_param(), pattern)) { + } + + if (test->type_param() != nullptr && + strings::contains(test->type_param(), pattern)) { return true; } @@ -61,6 +63,7 @@ static std::vector<std::string> disabled( for (int i = 0; i < unitTest->total_test_case_count(); i++) { const ::testing::TestCase* testCase = unitTest->GetTestCase(i); + for (int j = 0; j < testCase->total_test_count(); j++) { const ::testing::TestInfo* test = testCase->GetTestInfo(j); @@ -126,8 +129,7 @@ public: disabled_tests += strings::join(":", disabled(unitTest, filters)); // Now update the gtest flag. - ::testing::GTEST_FLAG(filter) = - enabled_tests + "-" + disabled_tests; + ::testing::GTEST_FLAG(filter) = enabled_tests + "-" + disabled_tests; } }; http://git-wip-us.apache.org/repos/asf/mesos/blob/ee3b04bc/3rdparty/stout/tests/main.cpp ---------------------------------------------------------------------- diff --git a/3rdparty/stout/tests/main.cpp b/3rdparty/stout/tests/main.cpp index 1a4acab..09868e5 100644 --- a/3rdparty/stout/tests/main.cpp +++ b/3rdparty/stout/tests/main.cpp @@ -36,8 +36,8 @@ using std::string; using std::vector; -// Attempt to create a symlink. If not possible, disable all unit tests -// that rely on the creation of symlinks. +// Attempt to create a symlink. If creating a symlink fails, disable +// all unit tests that rely on the creation of symlinks. class SymlinkFilter : public TestFilter { public: @@ -57,7 +57,7 @@ public: if (!can_create_symlinks) { std::cerr << "-------------------------------------------------------------\n" - << "Not able to create Symlinks, so no symlink tests will be run\n" + << "Unable to create symlinks, so no symlink tests will be run\n" << "-------------------------------------------------------------" << std::endl; }
