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