|
12 | 12 | #include <gtest/gtest.h>
|
13 | 13 | #include <string>
|
14 | 14 |
|
15 |
| -#define HVT_TEST_DEFAULT_BACKEND(TestSuiteName, TestName) \ |
16 |
| - void HVTTestDefaultBackend##TestName(); \ |
17 |
| - TEST(TestSuiteName, TestName) \ |
18 |
| - { \ |
19 |
| - TestHelpers::gParameterizedTests = false; \ |
20 |
| - TestHelpers::gTestNames = \ |
21 |
| - TestHelpers::getTestNames(::testing::UnitTest::GetInstance()->current_test_info()); \ |
22 |
| - HVTTestDefaultBackend##TestName(); \ |
23 |
| - } \ |
24 |
| - void HVTTestDefaultBackend##TestName() |
25 |
| - |
26 |
| -#if defined(ENABLE_VULKAN) && defined(WIN32) |
27 |
| - |
28 |
| - #define HVT_TEST(TestSuiteName, TestName) \ |
29 |
| - std::string ParamTestName##TestName(const testing::TestParamInfo<std::string>& info) \ |
30 |
| - { \ |
31 |
| - return info.param; \ |
32 |
| - } \ |
33 |
| - class TestName : public ::testing::TestWithParam<std::string> \ |
34 |
| - { \ |
35 |
| - public: \ |
36 |
| - void HVTTest##TestName( \ |
37 |
| - [[maybe_unused]] const std::string& computedImageName, \ |
38 |
| - [[maybe_unused]] const std::string& imageFile); \ |
39 |
| - }; \ |
40 |
| - /* TODO: Enable "Vulkan" backend when Vulkan support is complete and stable. \ |
41 |
| - Currently, only "OpenGL" is enabled for testing. */ \ |
42 |
| - INSTANTIATE_TEST_SUITE_P(TestSuiteName, TestName, ::testing::Values(/*"Vulkan",*/ "OpenGL"), \ |
43 |
| - ParamTestName##TestName); \ |
44 |
| - TEST_P(TestName, TestName) \ |
45 |
| - { \ |
46 |
| - TestHelpers::gRunVulkanTests = (GetParam() == "Vulkan"); \ |
47 |
| - TestHelpers::gParameterizedTests = true; \ |
48 |
| - TestHelpers::gTestNames = TestHelpers::getTestNames( \ |
49 |
| - ::testing::UnitTest::GetInstance()->current_test_info()); \ |
50 |
| - const std::string imageFile = TestHelpers::gTestNames.suiteName + \ |
51 |
| - std::string("/") + TestHelpers::gTestNames.fixtureName; \ |
52 |
| - const std::string computedImageName = TestHelpers::appendParamToImageFile(imageFile); \ |
53 |
| - HVTTest##TestName(computedImageName, imageFile); \ |
54 |
| - } \ |
55 |
| - void TestName::HVTTest##TestName( \ |
56 |
| - [[maybe_unused]] const std::string& computedImageName, \ |
57 |
| - [[maybe_unused]] const std::string& imageFile) |
58 |
| - |
59 |
| -#else |
60 |
| - |
61 |
| - #define HVT_TEST(TestSuiteName, TestName) HVT_TEST_DEFAULT_BACKEND(TestSuiteName, TestName) |
62 |
| - |
63 |
| -#endif |
| 15 | +#define HVT_TEST(TestSuiteName, TestName) \ |
| 16 | + std::string ParamTestName##TestName(const testing::TestParamInfo<std::string>& info) \ |
| 17 | + { \ |
| 18 | + return info.param; \ |
| 19 | + } \ |
| 20 | + class TestName : public ::testing::TestWithParam<std::string> \ |
| 21 | + { \ |
| 22 | + public: \ |
| 23 | + void HVTTest##TestName( \ |
| 24 | + [[maybe_unused]] const std::string& computedImageName, \ |
| 25 | + [[maybe_unused]] const std::string& imageFile); \ |
| 26 | + }; \ |
| 27 | + /* TODO: Enable "Vulkan" backend when Vulkan support is complete and stable. \ |
| 28 | + Currently, only "OpenGL" is enabled for testing. */ \ |
| 29 | + INSTANTIATE_TEST_SUITE_P(TestSuiteName, TestName, ::testing::Values(/*"Vulkan",*/ "OpenGL"), \ |
| 30 | + ParamTestName##TestName); \ |
| 31 | + TEST_P(TestName, TestName) \ |
| 32 | + { \ |
| 33 | + TestHelpers::gRunVulkanTests = (GetParam() == "Vulkan"); \ |
| 34 | + TestHelpers::gParameterizedTests = true; \ |
| 35 | + TestHelpers::gTestNames = TestHelpers::getTestNames( \ |
| 36 | + ::testing::UnitTest::GetInstance()->current_test_info()); \ |
| 37 | + const std::string imageFile = TestHelpers::gTestNames.suiteName + \ |
| 38 | + std::string("/") + TestHelpers::gTestNames.fixtureName; \ |
| 39 | + const std::string computedImageName = TestHelpers::appendParamToImageFile(imageFile); \ |
| 40 | + HVTTest##TestName(computedImageName, imageFile); \ |
| 41 | + } \ |
| 42 | + void TestName::HVTTest##TestName( \ |
| 43 | + [[maybe_unused]] const std::string& computedImageName, \ |
| 44 | + [[maybe_unused]] const std::string& imageFile) |
64 | 45 |
|
65 | 46 | namespace TestHelpers
|
66 | 47 | {
|
|
0 commit comments