1 #ifndef _VKTTESTGROUPUTIL_HPP
2 #define _VKTTESTGROUPUTIL_HPP
3 /*-------------------------------------------------------------------------
4 * Vulkan Conformance Tests
5 * ------------------------
7 * Copyright (c) 2016 Google Inc.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and/or associated documentation files (the
11 * "Materials"), to deal in the Materials without restriction, including
12 * without limitation the rights to use, copy, modify, merge, publish,
13 * distribute, sublicense, and/or sell copies of the Materials, and to
14 * permit persons to whom the Materials are furnished to do so, subject to
15 * the following conditions:
17 * The above copyright notice(s) and this permission notice shall be
18 * included in all copies or substantial portions of the Materials.
20 * The Materials are Confidential Information as defined by the
21 * Khronos Membership Agreement until designated non-confidential by
22 * Khronos, at which point this condition clause shall be removed.
24 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
27 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
28 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
29 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
30 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
34 * \brief TestCaseGroup utilities
35 *//*--------------------------------------------------------------------*/
37 #include "tcuDefs.hpp"
38 #include "tcuTestCase.hpp"
43 class TestGroupHelper0 : public tcu::TestCaseGroup
46 typedef void (*CreateChildrenFunc) (tcu::TestCaseGroup* testGroup);
48 TestGroupHelper0 (tcu::TestContext& testCtx,
49 const std::string& name,
50 const std::string& description,
51 CreateChildrenFunc createChildren);
52 ~TestGroupHelper0 (void);
57 const CreateChildrenFunc m_createChildren;
60 template<typename Arg0>
61 class TestGroupHelper1 : public tcu::TestCaseGroup
64 typedef void (*CreateChildrenFunc) (tcu::TestCaseGroup* testGroup, Arg0 arg0);
66 TestGroupHelper1 (tcu::TestContext& testCtx,
67 const std::string& name,
68 const std::string& description,
69 CreateChildrenFunc createChildren,
71 : tcu::TestCaseGroup (testCtx, name.c_str(), description.c_str())
72 , m_createChildren (createChildren)
76 void init (void) { m_createChildren(this, m_arg0); }
79 const CreateChildrenFunc m_createChildren;
83 inline tcu::TestCaseGroup* createTestGroup (tcu::TestContext& testCtx,
84 const std::string& name,
85 const std::string& description,
86 TestGroupHelper0::CreateChildrenFunc createChildren)
88 return new TestGroupHelper0(testCtx, name, description, createChildren);
91 template<typename Arg0>
92 tcu::TestCaseGroup* createTestGroup (tcu::TestContext& testCtx,
93 const std::string& name,
94 const std::string& description,
95 typename TestGroupHelper1<Arg0>::CreateChildrenFunc createChildren,
98 return new TestGroupHelper1<Arg0>(testCtx, name, description, createChildren, arg0);
103 #endif // _VKTTESTGROUPUTIL_HPP