• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
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 #ifndef TEST_SUITETESTSHRINKHEAD_H
16 #define TEST_SUITETESTSHRINKHEAD_H
17 
18 #define SHRINK_SUITETEST_HEAD(TestSuite)   \
19 namespace OHOS {                                                            \
20     class TestSuite : public testing::Test {              \
21     public:              \
22         static time_t startTime;              \
23         static time_t endTime;              \
24         static FuncRunResult runResult;              \
25     protected:              \
26         static void SetUpTestCase(void)     \
27         {                                   \
28             time(&startTime);                   \
29             RegistPackage();                    \
30             runResult.numPassed = 0;            \
31             runResult.numFailed = 0;            \
32             runResult.numNotSupported = 0;      \
33             runResult.numWarnings = 0;          \
34             runResult.numWaived = 0;            \
35         };              \
36         static void TearDownTestCase(void)  \
37         {                                                                                           \
38             time(&endTime);                                                                         \
39             printf("Test run totals --- Passed[%d]\n", runResult.numPassed);                        \
40             printf("Test run totals --- Failed[%d]\n", runResult.numFailed);                        \
41             printf("Test run totals --- Notsupport[%d]\n", runResult.numNotSupported);              \
42             printf("Test run totals --- Warnings[%d]\n", runResult.numWarnings);                    \
43             printf("Test run totals --- Waved[%d]\n", runResult.numWaived);                         \
44             std::cout << "testmain end --- COST TIME ["<< (endTime-startTime) << "]" << std::endl;       \
45         };              \
46         virtual void SetUp(void) {};              \
47         virtual void TearDown(void) {};              \
48     };              \
49 }
50 #endif // 为缩减代码而存在