Remove GLES2 texture unit tests from the mustpass. am: 0678398f7a
[platform/upstream/VK-GL-CTS.git] / external / vulkancts / modules / vulkan / vktInfoTests.cpp
1 /*-------------------------------------------------------------------------
2  * Vulkan Conformance Tests
3  * ------------------------
4  *
5  * Copyright (c) 2016 Google Inc.
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a
8  * copy of this software and/or associated documentation files (the
9  * "Materials"), to deal in the Materials without restriction, including
10  * without limitation the rights to use, copy, modify, merge, publish,
11  * distribute, sublicense, and/or sell copies of the Materials, and to
12  * permit persons to whom the Materials are furnished to do so, subject to
13  * the following conditions:
14  *
15  * The above copyright notice(s) and this permission notice shall be
16  * included in all copies or substantial portions of the Materials.
17  *
18  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
25  *
26  *//*!
27  * \file
28  * \brief Build and Device Tests
29  *//*--------------------------------------------------------------------*/
30
31 #include "vktInfoTests.hpp"
32 #include "vktTestCaseUtil.hpp"
33 #include "vkPlatform.hpp"
34 #include "vkApiVersion.hpp"
35 #include "tcuTestLog.hpp"
36 #include "tcuFormatUtil.hpp"
37 #include "tcuCommandLine.hpp"
38 #include "tcuPlatform.hpp"
39 #include "deStringUtil.hpp"
40
41 namespace vkt
42 {
43
44 namespace
45 {
46
47 using tcu::TestLog;
48 using std::string;
49
50 std::string getOsName (int os)
51 {
52         switch (os)
53         {
54                 case DE_OS_VANILLA:             return "DE_OS_VANILLA";
55                 case DE_OS_WIN32:               return "DE_OS_WIN32";
56                 case DE_OS_UNIX:                return "DE_OS_UNIX";
57                 case DE_OS_WINCE:               return "DE_OS_WINCE";
58                 case DE_OS_OSX:                 return "DE_OS_OSX";
59                 case DE_OS_ANDROID:             return "DE_OS_ANDROID";
60                 case DE_OS_SYMBIAN:             return "DE_OS_SYMBIAN";
61                 case DE_OS_IOS:                 return "DE_OS_IOS";
62                 default:
63                         return de::toString(os);
64         }
65 }
66
67 std::string getCompilerName (int compiler)
68 {
69         switch (compiler)
70         {
71                 case DE_COMPILER_VANILLA:       return "DE_COMPILER_VANILLA";
72                 case DE_COMPILER_MSC:           return "DE_COMPILER_MSC";
73                 case DE_COMPILER_GCC:           return "DE_COMPILER_GCC";
74                 case DE_COMPILER_CLANG:         return "DE_COMPILER_CLANG";
75                 default:
76                         return de::toString(compiler);
77         }
78 }
79
80 std::string getCpuName (int cpu)
81 {
82         switch (cpu)
83         {
84                 case DE_CPU_VANILLA:    return "DE_CPU_VANILLA";
85                 case DE_CPU_ARM:                return "DE_CPU_ARM";
86                 case DE_CPU_X86:                return "DE_CPU_X86";
87                 case DE_CPU_X86_64:             return "DE_CPU_X86_64";
88                 case DE_CPU_ARM_64:             return "DE_CPU_ARM_64";
89                 case DE_CPU_MIPS:               return "DE_CPU_MIPS";
90                 case DE_CPU_MIPS_64:    return "DE_CPU_MIPS_64";
91                 default:
92                         return de::toString(cpu);
93         }
94 }
95
96 std::string getEndiannessName (int endianness)
97 {
98         switch (endianness)
99         {
100                 case DE_BIG_ENDIAN:             return "DE_BIG_ENDIAN";
101                 case DE_LITTLE_ENDIAN:  return "DE_LITTLE_ENDIAN";
102                 default:
103                         return de::toString(endianness);
104         }
105 }
106
107 tcu::TestStatus logBuildInfo (Context& context)
108 {
109 #if defined(DE_DEBUG)
110         const bool      isDebug = true;
111 #else
112         const bool      isDebug = false;
113 #endif
114
115         context.getTestContext().getLog()
116                 << TestLog::Message
117                 << "DE_OS: " << getOsName(DE_OS) << "\n"
118                 << "DE_CPU: " << getCpuName(DE_CPU) << "\n"
119                 << "DE_PTR_SIZE: " << DE_PTR_SIZE << "\n"
120                 << "DE_ENDIANNESS: " << getEndiannessName(DE_ENDIANNESS) << "\n"
121                 << "DE_COMPILER: " << getCompilerName(DE_COMPILER) << "\n"
122                 << "DE_DEBUG: " << (isDebug ? "true" : "false") << "\n"
123                 << TestLog::EndMessage;
124
125         return tcu::TestStatus::pass("Not validated");
126 }
127
128 tcu::TestStatus logDeviceInfo (Context& context)
129 {
130         TestLog&                                                                log                     = context.getTestContext().getLog();
131         const vk::VkPhysicalDeviceProperties&   properties      = context.getDeviceProperties();
132
133         log << TestLog::Message
134                 << "Using --deqp-vk-device-id="
135                 << context.getTestContext().getCommandLine().getVKDeviceId()
136                 << TestLog::EndMessage;
137
138         log << TestLog::Message
139                 << "apiVersion: " << vk::unpackVersion(properties.apiVersion) << "\n"
140                 << "driverVersion: " << tcu::toHex(properties.driverVersion) << "\n"
141                 << "deviceName: " << (const char*)properties.deviceName << "\n"
142                 << "vendorID: " << tcu::toHex(properties.vendorID) << "\n"
143                 << "deviceID: " << tcu::toHex(properties.deviceID) << "\n"
144                 << TestLog::EndMessage;
145
146         return tcu::TestStatus::pass("Not validated");
147 }
148
149 tcu::TestStatus logPlatformInfo (Context& context)
150 {
151         std::ostringstream details;
152
153         context.getTestContext().getPlatform().getVulkanPlatform().describePlatform(details);
154
155         context.getTestContext().getLog()
156                 << TestLog::Message
157                 << details.str()
158                 << TestLog::EndMessage;
159
160         return tcu::TestStatus::pass("Not validated");
161 }
162
163 } // anonymous
164
165 void createInfoTests (tcu::TestCaseGroup* testGroup)
166 {
167         addFunctionCase(testGroup, "build",             "Build Info",           logBuildInfo);
168         addFunctionCase(testGroup, "device",    "Device Info",          logDeviceInfo);
169         addFunctionCase(testGroup, "platform",  "Platform Info",        logPlatformInfo);
170 }
171
172 } // vkt