xref: /test/xts/acts/graphic/vkgl/src/shrinkdefine.h (revision f6603c60)
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        FuncRunResult result = RunTestKHRGLES(argc, argv);                        \
32        TestSuite::runResult.numPassed += result.numPassed;                       \
33        TestSuite::runResult.numFailed += result.numFailed;                       \
34        TestSuite::runResult.numNotSupported += result.numNotSupported;           \
35        TestSuite::runResult.numWarnings += result.numWarnings;                   \
36        TestSuite::runResult.numPassed += result.numWarnings;                     \
37        TestSuite::runResult.numWaived += result.numWaived;                       \
38        if (result.numNotSupported == 1) {                                        \
39            GTEST_LOG_(INFO) << #TestCase << "notsupport!";                       \
40        } else if (result.isComplete) {                                           \
41            EXPECT_TRUE(result.isComplete);                                       \
42            EXPECT_TRUE(result.numFailed == 0);                                \
43        };                                                                        \
44        GTEST_LOG_(INFO) << #TestCase << "end";                                   \
45    }
46
47#endif // 为缩减代码而存在