1 /* 2 * Copyright (C) 2012 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef __ANDROID_HAL_CAMERA2_TESTS_FORKER_EVENT_LISTENER__ 18 #define __ANDROID_HAL_CAMERA2_TESTS_FORKER_EVENT_LISTENER__ 19 20 #include <gtest/gtest.h> 21 22 namespace android { 23 namespace camera2 { 24 namespace tests { 25 26 // Fork before each test runs. 27 class TestForkerEventListener : public ::testing::EmptyTestEventListener { 28 29 public: 30 31 TestForkerEventListener(); 32 33 private: 34 35 // Called before a test starts. 36 virtual void OnTestStart(const ::testing::TestInfo& test_info); 37 38 // Called after a failed assertion or a SUCCEED() invocation. 39 virtual void OnTestPartResult( 40 const ::testing::TestPartResult& test_part_result); 41 42 // Called after a test ends. 43 virtual void OnTestEnd(const ::testing::TestInfo& test_info); 44 45 bool mHasSucceeded; 46 int mTermSignal; 47 48 public: 49 // do not read directly. use TEST_EXTENSION macros instead 50 static bool mIsForked; 51 }; 52 53 } 54 } 55 } 56 57 #endif 58