Avoid logging to stdout in buffer mem requirements tests
authorRicardo Garcia <rgarcia@igalia.com>
Thu, 3 Mar 2022 10:52:58 +0000 (11:52 +0100)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 10 Mar 2022 19:26:21 +0000 (19:26 +0000)
Redirect informative messages to the output QPA file instead.

Affected tests:
dEQP-VK.api.buffer_memory_requirements.*

Components: Vulkan
VK-GL-CTS issue: 3539

Change-Id: I6e2c9a04488ad86fcac83a27beedab6e0bf36cf3

external/vulkancts/modules/vulkan/api/vktApiBufferMemoryRequirementsTests.cpp

index 081ac5c..e855380 100644 (file)
@@ -303,12 +303,12 @@ struct Info
        friend std::ostringstream& operator<<(std::ostringstream& str, const Info& info) {
                switch (info.m_type) {
                case Create:
-                       str << "  Info (Create buffer with " << info.m_str.str() << " not supported by device at "
-                               << de::FilePath(info.m_file).getBaseName() << ":" << info.m_line << ")";
+                       str << "Create buffer with " << info.m_str.str() << " not supported by device at "
+                               << de::FilePath(info.m_file).getBaseName() << ":" << info.m_line;
                        break;
                case Usage:
-                       str << "  Info (Create buffer with " << info.m_str.str() << " not supported by device at "
-                               << de::FilePath(info.m_file).getBaseName() << ":" << info.m_line << ")";
+                       str << info.m_str.str() << " at "
+                               << de::FilePath(info.m_file).getBaseName() << ":" << info.m_line;
                        break;
                }
                return str;
@@ -369,6 +369,7 @@ void MemoryRequirementsTest::checkSupport (Context& context) const
 {
        const InstanceInterface&                                                intf                            = context.getInstanceInterface();
        const VkPhysicalDevice                                                  physDevice                      = context.getPhysicalDevice();
+       auto&                                                                                   log                                     = context.getTestContext().getLog();
 
        if (m_testConfig.useMethod2)
                context.requireDeviceFunctionality(VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME);
@@ -421,8 +422,8 @@ void MemoryRequirementsTest::checkSupport (Context& context) const
                }
                if (notSupported)
                {
-                       std::cout << str.str() << std::endl;
-                       TCU_THROW(NotSupportedError, "One or more create buffer flags not supported by device");
+                       log << tcu::TestLog::Message << str.str() << tcu::TestLog::EndMessage;
+                       TCU_THROW(NotSupportedError, "One or more create buffer flags not supported by device (check log for details)");
                }
        }
 
@@ -551,14 +552,14 @@ void MemoryRequirementsTest::checkSupport (Context& context) const
 
                if (usageFlags.empty())
                {
-                       std::cout << str.str() << std::endl;
-                       TCU_THROW(NotSupportedError, "One or more buffer usage flags not supported by device");
+                       log << tcu::TestLog::Message << str.str() << tcu::TestLog::EndMessage;
+                       TCU_THROW(NotSupportedError, "One or more buffer usage flags not supported by device (check log for details)");
                }
                else
                {
                        if (entryCount > 0)
                        {
-                               std::cout << str.str() << std::endl;
+                               log << tcu::TestLog::Message << str.str() << tcu::TestLog::EndMessage;
                        }
                        DE_ASSERT(m_instConfig.usageFlags.get());
                        m_instConfig.usageFlags->resize(usageFlags.size());