registration.cpp 642 B

1234567891011121314151617181920
  1. #include "events.h"
  2. #include <gmock/gmock.h>
  3. #include <library/cpp/testing/unittest/plugin.h>
  4. namespace {
  5. class TGMockUnittestPlugin: public NUnitTest::NPlugin::IPlugin {
  6. public:
  7. void OnStartMain(int argc, char* argv[]) override {
  8. testing::InitGoogleMock(&argc, argv);
  9. testing::TestEventListeners& listeners = testing::UnitTest::GetInstance()->listeners();
  10. delete listeners.Release(listeners.default_result_printer());
  11. listeners.Append(new TGMockTestEventListener());
  12. }
  13. };
  14. NUnitTest::NPlugin::TPluginRegistrator registerGMock(new TGMockUnittestPlugin());
  15. }