Add dEQP-VK.info tests
authorPyry Haulos <phaulos@google.com>
Fri, 22 Jan 2016 22:24:17 +0000 (14:24 -0800)
committerPyry Haulos <phaulos@google.com>
Fri, 22 Jan 2016 22:36:50 +0000 (14:36 -0800)
Purpose of dEQP-VK.info tests is to automatically collect details
required for conformance submissions.

Change-Id: I86302dc24c95e30510faf3ff7480dcbf2899f037

external/vulkancts/modules/vulkan/CMakeLists.txt
external/vulkancts/modules/vulkan/vktInfoTests.cpp [new file with mode: 0644]
external/vulkancts/modules/vulkan/vktInfoTests.hpp [new file with mode: 0644]
external/vulkancts/modules/vulkan/vktTestPackage.cpp

index 4f4cb21..d7edecc 100644 (file)
@@ -45,6 +45,8 @@ set(DEQP_VK_COMMON_SRCS
        vktRenderPassTests.hpp
        vktTestGroupUtil.cpp
        vktTestGroupUtil.hpp
+       vktInfoTests.cpp
+       vktInfoTests.hpp
        )
 
 set(DEQP_VK_COMMON_LIBS
diff --git a/external/vulkancts/modules/vulkan/vktInfoTests.cpp b/external/vulkancts/modules/vulkan/vktInfoTests.cpp
new file mode 100644 (file)
index 0000000..da125ae
--- /dev/null
@@ -0,0 +1,176 @@
+/*-------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2016 Google Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and/or associated documentation files (the
+ * "Materials"), to deal in the Materials without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Materials, and to
+ * permit persons to whom the Materials are furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice(s) and this permission notice shall be
+ * included in all copies or substantial portions of the Materials.
+ *
+ * The Materials are Confidential Information as defined by the
+ * Khronos Membership Agreement until designated non-confidential by
+ * Khronos, at which point this condition clause shall be removed.
+ *
+ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ *
+ *//*!
+ * \file
+ * \brief Build and Device Tests
+ *//*--------------------------------------------------------------------*/
+
+#include "vktInfoTests.hpp"
+#include "vktTestCaseUtil.hpp"
+#include "vkPlatform.hpp"
+#include "vkApiVersion.hpp"
+#include "tcuTestLog.hpp"
+#include "tcuFormatUtil.hpp"
+#include "tcuCommandLine.hpp"
+#include "tcuPlatform.hpp"
+#include "deStringUtil.hpp"
+
+namespace vkt
+{
+
+namespace
+{
+
+using tcu::TestLog;
+using std::string;
+
+std::string getOsName (int os)
+{
+       switch (os)
+       {
+               case DE_OS_VANILLA:             return "DE_OS_VANILLA";
+               case DE_OS_WIN32:               return "DE_OS_WIN32";
+               case DE_OS_UNIX:                return "DE_OS_UNIX";
+               case DE_OS_WINCE:               return "DE_OS_WINCE";
+               case DE_OS_OSX:                 return "DE_OS_OSX";
+               case DE_OS_ANDROID:             return "DE_OS_ANDROID";
+               case DE_OS_SYMBIAN:             return "DE_OS_SYMBIAN";
+               case DE_OS_IOS:                 return "DE_OS_IOS";
+               default:
+                       return de::toString(os);
+       }
+}
+
+std::string getCompilerName (int compiler)
+{
+       switch (compiler)
+       {
+               case DE_COMPILER_VANILLA:       return "DE_COMPILER_VANILLA";
+               case DE_COMPILER_MSC:           return "DE_COMPILER_MSC";
+               case DE_COMPILER_GCC:           return "DE_COMPILER_GCC";
+               case DE_COMPILER_CLANG:         return "DE_COMPILER_CLANG";
+               default:
+                       return de::toString(compiler);
+       }
+}
+
+std::string getCpuName (int cpu)
+{
+       switch (cpu)
+       {
+               case DE_CPU_VANILLA:    return "DE_CPU_VANILLA";
+               case DE_CPU_ARM:                return "DE_CPU_ARM";
+               case DE_CPU_X86:                return "DE_CPU_X86";
+               case DE_CPU_X86_64:             return "DE_CPU_X86_64";
+               case DE_CPU_ARM_64:             return "DE_CPU_ARM_64";
+               case DE_CPU_MIPS:               return "DE_CPU_MIPS";
+               case DE_CPU_MIPS_64:    return "DE_CPU_MIPS_64";
+               default:
+                       return de::toString(cpu);
+       }
+}
+
+std::string getEndiannessName (int endianness)
+{
+       switch (endianness)
+       {
+               case DE_BIG_ENDIAN:             return "DE_BIG_ENDIAN";
+               case DE_LITTLE_ENDIAN:  return "DE_LITTLE_ENDIAN";
+               default:
+                       return de::toString(endianness);
+       }
+}
+
+tcu::TestStatus logBuildInfo (Context& context)
+{
+#if defined(DE_DEBUG)
+       const bool      isDebug = true;
+#else
+       const bool      isDebug = false;
+#endif
+
+       context.getTestContext().getLog()
+               << TestLog::Message
+               << "DE_OS: " << getOsName(DE_OS) << "\n"
+               << "DE_CPU: " << getCpuName(DE_CPU) << "\n"
+               << "DE_PTR_SIZE: " << DE_PTR_SIZE << "\n"
+               << "DE_ENDIANNESS: " << getEndiannessName(DE_ENDIANNESS) << "\n"
+               << "DE_COMPILER: " << getCompilerName(DE_COMPILER) << "\n"
+               << "DE_DEBUG: " << (isDebug ? "true" : "false") << "\n"
+               << TestLog::EndMessage;
+
+       return tcu::TestStatus::pass("Not validated");
+}
+
+tcu::TestStatus logDeviceInfo (Context& context)
+{
+       TestLog&                                                                log                     = context.getTestContext().getLog();
+       const vk::VkPhysicalDeviceProperties&   properties      = context.getDeviceProperties();
+
+       log << TestLog::Message
+               << "Using --deqp-vk-device-id="
+               << context.getTestContext().getCommandLine().getVKDeviceId()
+               << TestLog::EndMessage;
+
+       log << TestLog::Message
+               << "apiVersion: " << vk::unpackVersion(properties.apiVersion) << "\n"
+               << "driverVersion: " << tcu::toHex(properties.driverVersion) << "\n"
+               << "deviceName: " << (const char*)properties.deviceName << "\n"
+               << "vendorID: " << tcu::toHex(properties.vendorID) << "\n"
+               << "deviceID: " << tcu::toHex(properties.deviceID) << "\n"
+               << TestLog::EndMessage;
+
+       return tcu::TestStatus::pass("Not validated");
+}
+
+tcu::TestStatus logPlatformInfo (Context& context)
+{
+       std::ostringstream details;
+
+       context.getTestContext().getPlatform().getVulkanPlatform().describePlatform(details);
+
+       context.getTestContext().getLog()
+               << TestLog::Message
+               << details.str()
+               << TestLog::EndMessage;
+
+       return tcu::TestStatus::pass("Not validated");
+}
+
+} // anonymous
+
+void createInfoTests (tcu::TestCaseGroup* testGroup)
+{
+       addFunctionCase(testGroup, "build",             "Build Info",           logBuildInfo);
+       addFunctionCase(testGroup, "device",    "Device Info",          logDeviceInfo);
+       addFunctionCase(testGroup, "platform",  "Platform Info",        logPlatformInfo);
+}
+
+} // vkt
diff --git a/external/vulkancts/modules/vulkan/vktInfoTests.hpp b/external/vulkancts/modules/vulkan/vktInfoTests.hpp
new file mode 100644 (file)
index 0000000..1a76ea9
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef _VKTINFOTESTS_HPP
+#define _VKTINFOTESTS_HPP
+/*-------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2016 Google Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and/or associated documentation files (the
+ * "Materials"), to deal in the Materials without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Materials, and to
+ * permit persons to whom the Materials are furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice(s) and this permission notice shall be
+ * included in all copies or substantial portions of the Materials.
+ *
+ * The Materials are Confidential Information as defined by the
+ * Khronos Membership Agreement until designated non-confidential by
+ * Khronos, at which point this condition clause shall be removed.
+ *
+ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ *
+ *//*!
+ * \file
+ * \brief Build and Device Tests
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuDefs.hpp"
+#include "tcuTestCase.hpp"
+
+namespace vkt
+{
+
+void   createInfoTests         (tcu::TestCaseGroup* testGroup);
+
+} // vkt
+
+#endif // _VKTINFOTESTS_HPP
index 3a8c692..4d669fe 100644 (file)
@@ -71,6 +71,7 @@
 #include "vktDrawTests.hpp"
 #include "vktComputeTests.hpp"
 #include "vktImageTests.hpp"
+#include "vktInfoTests.hpp"
 
 #include <vector>
 #include <sstream>
@@ -310,6 +311,7 @@ tcu::TestCaseExecutor* TestPackage::createExecutor (void) const
 
 void TestPackage::init (void)
 {
+       addChild(createTestGroup                        (m_testCtx, "info", "Build and Device Info Tests", createInfoTests));
        addChild(api::createTests                       (m_testCtx));
        addChild(pipeline::createTests          (m_testCtx));
        addChild(BindingModel::createTests      (m_testCtx));