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 16 #ifndef TEST_SHRINKDEFINE_H 17 #define TEST_SHRINKDEFINE_H 18 19 #define SHRINK_HWTEST_F(TestSuite, TestCase, VkglCase1, VkglCase2) \ 20 HWTEST_F(TestSuite, TestCase, Function | MediumTest | Level2) \ 21 { \ 22 GTEST_LOG_(INFO) << #TestCase << " start"; \ 23 int argc = 3; \ 24 const char *argv[3] = { \ 25 ".", \ 26 "--deqp-case=" \ 27 VkglCase1 \ 28 VkglCase2, \ 29 "--deqp-archive-dir=/data/local/tmp/" \ 30 }; \ 31 GTEST_LOG_(INFO) << #VkglCase1 << " is VkglCase1"; \ 32 GTEST_LOG_(INFO) << #VkglCase2 << " is VkglCase2"; \ 33 FuncRunResult result = RunTestKHRGLES(argc, argv); \ 34 TestSuite::runResult.numPassed += result.numPassed; \ 35 TestSuite::runResult.numFailed += result.numFailed; \ 36 TestSuite::runResult.numNotSupported += result.numNotSupported; \ 37 TestSuite::runResult.numWarnings += result.numWarnings; \ 38 TestSuite::runResult.numPassed += result.numWarnings; \ 39 TestSuite::runResult.numWaived += result.numWaived; \ 40 if (result.numNotSupported == 1) { \ 41 GTEST_LOG_(INFO) << #TestCase << " notsupport!"; \ 42 } else if (result.isComplete) { \ 43 EXPECT_TRUE(result.isComplete); \ 44 EXPECT_TRUE(result.numFailed == 0); \ 45 }; \ 46 GTEST_LOG_(INFO) << #TestCase << " end"; \ 47 } 48 49 #endif // 为缩减代码而存在