• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright 2015 Paul Shmakov
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  *
15  */
16 
17 #ifndef H_TEAMCITY_GTEST
18 #define H_TEAMCITY_GTEST
19 
20 #include <string>
21 
22 #include "tests/gtest/include/gtest/gtest.h"
23 #include "tests/gtest/teamcity/src/teamcity_messages.h"
24 
25 namespace jetbrains {
26 namespace teamcity {
27 
28 class TeamcityGoogleTestEventListener: public ::testing::EmptyTestEventListener {
29 public:
30     TeamcityGoogleTestEventListener(const std::string& flowid);
31     TeamcityGoogleTestEventListener();
32 
33     // Fired before the test case starts.
34     virtual void OnTestCaseStart(const ::testing::TestCase& test_case);
35     // Fired before the test starts.
36     virtual void OnTestStart(const ::testing::TestInfo& test_info);
37     // Fired after the test ends.
38     virtual void OnTestEnd(const ::testing::TestInfo& test_info);
39     // Fired after the test case ends.
40     virtual void OnTestCaseEnd(const ::testing::TestCase& test_case);
41 
42 private:
43     TeamcityMessages messages;
44     std::string flowid;
45 
46     // Prevent copying.
47     TeamcityGoogleTestEventListener(const TeamcityGoogleTestEventListener&);
48     void operator =(const TeamcityGoogleTestEventListener&);
49 };
50 
51 }
52 }
53 
54 #endif /* H_TEAMCITY_GTEST */
55