Cause vkrunner tests to fail if scripts not found
authorGraeme Leese <gleese@broadcom.com>
Wed, 9 Jan 2019 16:46:22 +0000 (16:46 +0000)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 11 Jan 2019 08:54:05 +0000 (03:54 -0500)
Rather than simply ignoring the test throw an InternalError.

Components: Vulkan
VK-GL-CTS Issue: 1548
Affects: dEQP-VK.vkrunner-example.*

Change-Id: Ib29692c792acf49f428e042fb9cc951dd32130dd
(cherry picked from commit 255f67d1d9dc6616058335ca8a0597b92a3bfa27)

external/vulkancts/modules/vulkan/vkrunner/vktVkRunnerExampleTests.cpp
external/vulkancts/modules/vulkan/vkrunner/vktVkRunnerTestCase.cpp

index 9d9e113..8d6ebe3 100644 (file)
@@ -59,10 +59,8 @@ void createVkRunnerTests (tcu::TestCaseGroup* vkRunnerTests)
                /* Need to call getShaders() manually to detect any issue in the
                 * shader test file, like invalid test commands or the file doesn't exist.
                 */
-               if (testCase->getShaders())
-                       vkRunnerTests->addChild(testCase);
-               else
-                       delete testCase;
+               testCase->getShaders();
+               vkRunnerTests->addChild(testCase);
        }
 
        // Add some tests of the sqrt function using the templating mechanism
@@ -85,10 +83,8 @@ void createVkRunnerTests (tcu::TestCaseGroup* vkRunnerTests)
                 * replacements in the shader test. Otherwise, VkRunner will fail when found
                 * unknown commands or invalid sentences when processing the shader test file.
                 */
-               if (testCase->getShaders())
-                       vkRunnerTests->addChild(testCase);
-               else
-                       delete testCase;
+               testCase->getShaders();
+               vkRunnerTests->addChild(testCase);
        }
 }
 
index 4725ec7..e463b1b 100644 (file)
@@ -126,6 +126,9 @@ bool VkRunnerTestCase::getShaders()
 
 TestInstance* VkRunnerTestCase::createInstance(Context& ctx) const
 {
+       if (m_testCaseData.script == DE_NULL)
+               TCU_THROW(InternalError, "Could not find script file");
+
        return new VkRunnerTestInstance(ctx, m_testCaseData);
 }