gtest: Add plugin for TeamCity integration

Automatically report unit tests to the TeamCity server if run within TeamCity.
See tests/gtest/teamcity/README.cef for details.

To test: Set the TEAMCITY_PROJECT_NAME environment variable and run ceftests.
This commit is contained in:
Marshall Greenblatt
2021-06-24 16:52:37 -04:00
parent 50f627b07e
commit 7efac13ac1
9 changed files with 445 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
#include "include/cef_file_util.h"
#include "include/wrapper/cef_scoped_temp_dir.h"
#include "tests/gtest/include/gtest/gtest.h"
#include "tests/gtest/teamcity/include/teamcity_gtest.h"
#include "tests/shared/common/client_switches.h"
namespace {
@@ -121,6 +122,12 @@ void CefTestSuite::InitMainProcess() {
// This will modify |argc_| and |argv_|.
testing::InitGoogleTest(&argc_, argv_.array());
if (jetbrains::teamcity::underTeamcity()) {
auto& listeners = ::testing::UnitTest::GetInstance()->listeners();
listeners.Append(
new jetbrains::teamcity::TeamcityGoogleTestEventListener());
}
}
// Don't add additional code to this method. Instead add it to Initialize().