Commit 34cbc544 by Jonah Ryan-Davis Committed by Commit Bot

Use ANGLE's gpu_info_util libraries for test expectations

3. Remove gpu_info.h and gpu_info.cc and use ANGLE's own gpu_info_util to to gather device info instead. - Support collecting info for and parsing expectations of specific Android devices such as Nexus 5X and Pixel 2. - Change parser behavior to more closely follow: bit.ly/chromium-test-list-format Bug: angleproject:2677 Change-Id: I4c0b9342142b718e884484a6bcaac2dff3ac575a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1553822 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 893ccb48
......@@ -37,6 +37,8 @@ std::string VendorName(VendorID vendor)
return "Vivante";
case kVendorID_VeriSilicon:
return "VeriSilicon";
case kVendorID_VMWare:
return "VMWare";
case kVendorID_Kazan:
return "Kazan";
default:
......@@ -132,6 +134,11 @@ bool IsVeriSilicon(VendorID vendorId)
return vendorId == kVendorID_VeriSilicon;
}
bool IsVMWare(VendorID vendorId)
{
return vendorId == kVendorID_VMWare;
}
bool IsVivante(VendorID vendorId)
{
return vendorId == kVendorID_Vivante;
......
......@@ -93,6 +93,7 @@ constexpr VendorID kVendorID_ImgTec = 0x1010;
constexpr VendorID kVendorID_Intel = 0x8086;
constexpr VendorID kVendorID_NVIDIA = 0x10DE;
constexpr VendorID kVendorID_Qualcomm = 0x5143;
constexpr VendorID kVendorID_VMWare = 0x15ad;
// Known non-PCI (i.e. Khronos-registered) vendor IDs
constexpr VendorID kVendorID_Vivante = 0x10001;
......@@ -108,6 +109,7 @@ bool IsKazan(VendorID vendorId);
bool IsNVIDIA(VendorID vendorId);
bool IsQualcomm(VendorID vendorId);
bool IsVeriSilicon(VendorID vendorId);
bool IsVMWare(VendorID vendorId);
bool IsVivante(VendorID vendorId);
// Dumps the system info to stdout.
......
......@@ -98,6 +98,37 @@ angle_test("angle_unittests_helper") {
]
}
test_expectations_sources = [
"test_expectations/GPUTestConfig.cpp",
"test_expectations/GPUTestConfig.h",
"test_expectations/GPUTestExpectationsParser.cpp",
"test_expectations/GPUTestExpectationsParser.h",
]
if (is_mac) {
test_expectations_sources_mac = [
"test_expectations/GPUTestConfig_mac.mm",
"test_expectations/GPUTestConfig_mac.h",
]
}
config("angle_test_expectations_config") {
include_dirs = [ "${angle_root}:angle_common" ]
}
angle_static_library("angle_test_expectations") {
public_configs += [ ":angle_test_expectations_config" ]
public_deps = [
"${angle_root}:angle_common",
"${angle_root}:angle_gpu_info_util",
"${angle_root}:angle_util",
]
sources = test_expectations_sources
if (is_mac) {
sources += test_expectations_sources_mac
libs = [ "Cocoa.framework" ]
}
}
angle_test("angle_unittests") {
sources = angle_unittests_sources
......@@ -108,6 +139,7 @@ angle_test("angle_unittests") {
deps = googletest_deps + [
"${angle_root}:libANGLE",
":angle_test_expectations",
"${angle_root}:preprocessor",
"${angle_root}:translator",
"${angle_root}:libfeature_support${angle_libs_suffix}",
......@@ -152,6 +184,7 @@ if (is_win || is_linux || is_mac || is_android || is_fuchsia) {
deps = [
":angle_end2end_tests_main",
":angle_test_expectations",
"${angle_root}:angle_gpu_info_util",
"${angle_root}:angle_image_util",
"${angle_root}:angle_util",
......@@ -659,38 +692,17 @@ if (build_angle_deqp_tests && !is_fuchsia) {
}
}
config("angle_deqp_test_expectations_config") {
include_dirs = [ "${angle_root}:angle_common" ]
}
angle_static_library("angle_deqp_test_expectations") {
public_configs += [ ":angle_deqp_test_expectations_config" ]
public_deps = [
"${angle_root}:angle_common",
"${angle_root}:angle_util",
]
sources = deqp_test_expectations_sources
if (is_mac) {
sources += deqp_test_expectations_sources_mac
libs = [ "Cocoa.framework" ]
}
}
angle_source_set("angle_deqp_gtest_support") {
testonly = true
public_deps = [
":angle_deqp_test_expectations",
":angle_deqp_tests_main",
":angle_test_expectations",
"${angle_root}:angle_common",
"${angle_root}:angle_util",
]
libs = []
if (!is_android) {
public_deps += [ "${angle_root}:angle_gpu_info_util" ]
}
}
api_names = [
......
......@@ -139,6 +139,7 @@ angle_end2end_tests_sources = [
"egl_tests/EGLSurfacelessContextTest.cpp",
"egl_tests/EGLSurfaceTest.cpp",
"egl_tests/EGLSyncTest.cpp",
"test_expectations/GPUTestExpectationsTest.cpp",
"test_utils/ANGLETest.cpp",
"test_utils/ANGLETest.h",
"test_utils/MultiviewTest.cpp",
......
......@@ -102,6 +102,7 @@ angle_unittests_sources = [
"../tests/compiler_tests/VectorizeVectorScalarArithmetic_test.cpp",
"../tests/compiler_tests/WEBGL_multiview_test.cpp",
"../tests/compiler_tests/WorkGroupSize_test.cpp",
"../tests/test_expectations/GPUTestExpectationsParser_unittest.cpp",
"../tests/preprocessor_tests/char_test.cpp",
"../tests/preprocessor_tests/comment_test.cpp",
"../tests/preprocessor_tests/define_test.cpp",
......
......@@ -1143,15 +1143,3 @@ deqp_libtester_sources_android = [
"$_deqp_path/framework/platform/android/tcuAndroidInternals.cpp",
"$_deqp_path/framework/platform/android/tcuAndroidInternals.hpp",
]
deqp_test_expectations_sources = [
"test_expectations/GPUInfo.cpp",
"test_expectations/GPUInfo.h",
"test_expectations/GPUTestConfig.cpp",
"test_expectations/GPUTestConfig.h",
"test_expectations/GPUTestExpectationsParser.cpp",
"test_expectations/GPUTestExpectationsParser.h",
]
deqp_test_expectations_sources_mac = [
"test_expectations/GPUTestConfig_mac.mm",
"test_expectations/GPUTestConfig_mac.h",
]
......@@ -20,6 +20,7 @@
#include "common/platform.h"
#include "common/string_utils.h"
#include "platform/Platform.h"
#include "tests/test_expectations/GPUTestConfig.h"
#include "tests/test_expectations/GPUTestExpectationsParser.h"
#include "util/system_utils.h"
......@@ -218,7 +219,6 @@ class dEQPCaseList
private:
std::vector<CaseInfo> mCaseInfoList;
angle::GPUTestExpectationsParser mTestExpectationsParser;
angle::GPUTestBotConfig mTestConfig;
size_t mTestModuleIndex;
bool mInitialized;
};
......@@ -252,10 +252,20 @@ void dEQPCaseList::initialize()
Die();
}
if (!mTestExpectationsParser.LoadTestExpectationsFromFile(testExpectationsPath.value()))
angle::GPUTestConfig::API api = GetDefaultAPIInfo()->second;
// Set the API from the command line, or using the default platform API.
if (gInitAPI)
{
api = gInitAPI->second;
}
angle::GPUTestConfig testConfig = angle::GPUTestConfig(api);
if (!mTestExpectationsParser.loadTestExpectationsFromFile(testConfig,
testExpectationsPath.value()))
{
std::stringstream errorMsgStream;
for (const auto &message : mTestExpectationsParser.GetErrorMessages())
for (const auto &message : mTestExpectationsParser.getErrorMessages())
{
errorMsgStream << std::endl << " " << message;
}
......@@ -264,22 +274,6 @@ void dEQPCaseList::initialize()
Die();
}
if (!mTestConfig.LoadCurrentConfig(nullptr))
{
std::cerr << "Failed to load test configuration." << std::endl;
Die();
}
// Set the API from the command line, or using the default platform API.
if (gInitAPI)
{
mTestConfig.set_api(gInitAPI->second);
}
else
{
mTestConfig.set_api(GetDefaultAPIInfo()->second);
}
std::ifstream caseListStream(caseListPath.value());
if (caseListStream.fail())
{
......@@ -299,7 +293,7 @@ void dEQPCaseList::initialize()
if (gTestName.empty())
continue;
int expectation = mTestExpectationsParser.GetTestExpectation(dEQPName, mTestConfig);
int expectation = mTestExpectationsParser.getTestExpectation(dEQPName);
if (expectation != angle::GPUTestExpectationsParser::kGpuTestSkip)
{
mCaseInfoList.push_back(CaseInfo(dEQPName, gTestName, expectation));
......
......@@ -6,27 +6,33 @@
// format is:
// {BUG#} {MODIFIERS} : {TEST_NAME} = {PASS,FAIL,FLAKY,TIMEOUT,SKIP}
//
// MODIFIERS can be a combination of the below list:
// WIN XP VISTA WIN7 MAC LEOPARD SNOWLEOPARD LION LINUX CHROMEOS MOUNTAINLION
// MAVERICKS
// MODIFIERS can be a combination of the below list, combined with a logical AND:
// WIN XP VISTA WIN7 WIN8 WIN10
// MAC LEOPARD SNOWLEOPARD LION MOUNTAINLION MAVERICKS YOSEMITE ELCAPITAN SIERRA HIGHSIERRA MOJAVE
// LINUX CHROMEOS ANDROID
// NVIDIA AMD INTEL
// 0xabcd - GPU PCI device ID. Specifying a PCI id requires a vendor.
// DEBUG RELEASE
// TODO(jmadill): Add ANGLE Renderer selection modifiers
// D3D9 D3D11 OPENGL GLES VULKAN
// NEXUS5X PIXEL2
// QUADROP400
//
//
// TEST_NAME can be a specific test name, or have a '*' in the end, which
// indicates a prefix matching.
//
// Examples:
// 91530 MAC WIN LINUX : context_lost_restored = TIMEOUT
// 91533 WIN : gl_min_uniforms = FAIL
// 91531 MAC WIN LINUX : conformance_more_* = SKIP
// 91532 MAC NVIDIA 0x0640 : tex_image_and_sub_image_2d_with_video = PASS FAIL
// fails on both windows and mac (crash)
// 91530 WIN : context_lost_restored = SKIP
// 91530 MAC : context_lost_restored = SKIP
// fails on windows using NVIDIA GPUs
// 91533 WIN NVIDIA : gl_min_uniforms = FAIL
// fails on Nexus5X with GLES backend (hangs)
// 91531 NEXUS5X GLES : conformance_more_* = SKIP
// ANGLE does not yet support multithreading
1340 WIN MAC LINUX : dEQP-EGL.functional.sharing.gles2.multithread.* = SKIP
1340 WIN MAC LINUX : dEQP-EGL.functional.multithread.* = SKIP
1340 WIN MAC LINUX : dEQP-EGL.functional.render.multi_thread.* = SKIP
1340 : dEQP-EGL.functional.sharing.gles2.multithread.* = SKIP
1340 : dEQP-EGL.functional.multithread.* = SKIP
1340 : dEQP-EGL.functional.render.multi_thread.* = SKIP
// dEQP doesn't handle configs created for extensions
1662 WIN : dEQP-EGL.functional.color_clears.single_context.gles2.other = FAIL
......@@ -52,7 +58,7 @@
1662 WIN : dEQP-EGL.functional.native_color_mapping.native_window.other_render = SKIP
// Intentionally causes TDRs that eventually blacklist the application
2319 DEBUG RELEASE : dEQP-EGL.functional.robustness.reset_context.shaders.infinite_loop.* = SKIP
2319 : dEQP-EGL.functional.robustness.reset_context.shaders.infinite_loop.* = SKIP
////////////////////////////////////////////////////////////////////////////////
//
......@@ -169,9 +175,6 @@
2567 ANDROID GLES : dEQP-EGL.functional.image.api.create_image_gles2_tex2d_rg = FAIL
2716 ANDROID GLES : dEQP-EGL.functional.preserve_swap.preserve.* = FAIL
// Seems to crash on the 5x. Possibly other Android devices.
3113 ANDROID GLES : dEQP-EGL.functional.reusable_sync.* = SKIP
// Android failures
2546 ANDROID : dEQP-EGL.functional.buffer_age.* = FAIL
3270 ANDROID : dEQP-EGL.functional.choose_config.simple.selection_only.transparent_red_value = FAIL
......@@ -183,7 +186,6 @@
2546 ANDROID : dEQP-EGL.functional.color_clears.multi_context.* = SKIP
2546 ANDROID : dEQP-EGL.functional.color_clears.multi_thread.* = SKIP
2546 ANDROID : dEQP-EGL.functional.color_clears.single_context.* = SKIP
2546 ANDROID : dEQP-EGL.functional.multithread.* = SKIP
2546 ANDROID : dEQP-EGL.functional.native_color_mapping.native_window.* = SKIP
2546 ANDROID : dEQP-EGL.functional.native_coord_mapping.native_window.* = SKIP
2546 ANDROID : dEQP-EGL.functional.negative_api.copy_buffers = FAIL
......@@ -195,9 +197,7 @@
2546 ANDROID : dEQP-EGL.functional.query_context.get_current_surface.r* = FAIL
2546 ANDROID : dEQP-EGL.functional.query_context.query_context.* = SKIP
2546 ANDROID : dEQP-EGL.functional.render.multi_context.* = SKIP
2546 ANDROID : dEQP-EGL.functional.render.multi_thread.* = SKIP
2546 ANDROID : dEQP-EGL.functional.render.single_context.* = FAIL
2546 ANDROID : dEQP-EGL.functional.sharing.gles2.multithread.* = SKIP
2546 ANDROID : dEQP-EGL.functional.thread_cleanup.multi_context_* = SKIP
2546 ANDROID : dEQP-EGL.functional.thread_cleanup.single_context_* = FAIL
......@@ -218,17 +218,23 @@
2546 ANDROID VULKAN : dEQP-EGL.functional.wide_color.window* = SKIP
// ES 1 tests
2306 WIN MAC LINUX : dEQP-EGL.functional.color_clears.single_context.gles1* = FAIL
2306 WIN MAC LINUX : dEQP-EGL.functional.color_clears.multi_context.gles1* = FAIL
2306 WIN MAC LINUX : dEQP-EGL.functional.color_clears.multi_thread.gles1* = FAIL
2306 WIN : dEQP-EGL.functional.color_clears.single_context.gles1* = FAIL
2306 WIN : dEQP-EGL.functional.color_clears.multi_context.gles1* = FAIL
2306 WIN : dEQP-EGL.functional.color_clears.multi_thread.gles1* = FAIL
2306 MAC : dEQP-EGL.functional.color_clears.single_context.gles1* = FAIL
2306 MAC : dEQP-EGL.functional.color_clears.multi_context.gles1* = FAIL
2306 MAC : dEQP-EGL.functional.color_clears.multi_thread.gles1* = FAIL
2306 LINUX : dEQP-EGL.functional.color_clears.single_context.gles1* = FAIL
2306 LINUX : dEQP-EGL.functional.color_clears.multi_context.gles1* = FAIL
2306 LINUX : dEQP-EGL.functional.color_clears.multi_thread.gles1* = FAIL
// Tests failing since the Jan 2018 roll of dEQP
2341 DEBUG RELEASE : dEQP-EGL.functional.swap_buffers.* = SKIP
2330 DEBUG RELEASE : dEQP-EGL.functional.robustness.create_context.no_reset_notification = SKIP
2330 DEBUG RELEASE : dEQP-EGL.functional.robustness.create_context.lose_context_on_reset = SKIP
2330 DEBUG RELEASE : dEQP-EGL.functional.robustness.reset_context.fixed_function_pipeline.reset_status.index_buffer_out_of_bounds = SKIP
2330 DEBUG RELEASE : dEQP-EGL.functional.robustness.reset_context.fixed_function_pipeline.reset_status.vertex_buffer_out_of_bounds = SKIP
2341 : dEQP-EGL.functional.swap_buffers.* = SKIP
2330 : dEQP-EGL.functional.robustness.create_context.no_reset_notification = SKIP
2330 : dEQP-EGL.functional.robustness.create_context.lose_context_on_reset = SKIP
2330 : dEQP-EGL.functional.robustness.reset_context.fixed_function_pipeline.reset_status.index_buffer_out_of_bounds = SKIP
2330 : dEQP-EGL.functional.robustness.reset_context.fixed_function_pipeline.reset_status.vertex_buffer_out_of_bounds = SKIP
// Tests were being hidden by flakiness (anglebug.com/3271)
3325 WIN MAC LINUX : dEQP-EGL.functional.fence_sync.* = SKIP
3325 WIN MAC LINUX : dEQP-EGL.functional.reusable_sync.* = SKIP
3325 : dEQP-EGL.functional.fence_sync.* = SKIP
3325 : dEQP-EGL.functional.reusable_sync.* = SKIP
......@@ -6,31 +6,37 @@
// format is:
// {BUG#} {MODIFIERS} : {TEST_NAME} = {PASS,FAIL,FLAKY,TIMEOUT,SKIP}
//
// MODIFIERS can be a combination of the below list:
// WIN XP VISTA WIN7 MAC LEOPARD SNOWLEOPARD LION LINUX CHROMEOS MOUNTAINLION
// MAVERICKS
// MODIFIERS can be a combination of the below list, combined with a logical AND:
// WIN XP VISTA WIN7 WIN8 WIN10
// MAC LEOPARD SNOWLEOPARD LION MOUNTAINLION MAVERICKS YOSEMITE ELCAPITAN SIERRA HIGHSIERRA MOJAVE
// LINUX CHROMEOS ANDROID
// NVIDIA AMD INTEL
// 0xabcd - GPU PCI device ID. Specifying a PCI id requires a vendor.
// DEBUG RELEASE
// TODO(jmadill): Add ANGLE Renderer selection modifiers
// D3D9 D3D11 OPENGL GLES VULKAN
// NEXUS5X PIXEL2
// QUADROP400
//
//
// TEST_NAME can be a specific test name, or have a '*' in the end, which
// indicates a prefix matching.
//
// Examples:
// 91530 MAC WIN LINUX : context_lost_restored = TIMEOUT
// 91533 WIN : gl_min_uniforms = FAIL
// 91531 MAC WIN LINUX : conformance_more_* = SKIP
// 91532 MAC NVIDIA 0x0640 : tex_image_and_sub_image_2d_with_video = PASS FAIL
// fails on both windows and mac (crash)
// 91530 WIN : context_lost_restored = SKIP
// 91530 MAC : context_lost_restored = SKIP
// fails on windows using NVIDIA GPUs
// 91533 WIN NVIDIA : gl_min_uniforms = FAIL
// fails on Nexus5X with GLES backend (hangs)
// 91531 NEXUS5X GLES : conformance_more_* = SKIP
// Don't run these tests for faster turnover
998 DEBUG RELEASE : dEQP-GLES3.performance.* = SKIP
998 DEBUG RELEASE : dEQP-GLES3.stress.* = SKIP
1101 DEBUG RELEASE : dEQP-GLES3.functional.flush_finish.* = SKIP
998 : dEQP-GLES3.performance.* = SKIP
998 : dEQP-GLES3.stress.* = SKIP
1101 : dEQP-GLES3.functional.flush_finish.* = SKIP
// Figure out why this caused this regression in Chrome:
// https://bugs.chromium.org/p/chromium/issues/detail?id=833809#
2321 DEBUG RELEASE : dEQP-GLES3.functional.state_query.fbo.framebuffer_unspecified_attachment_x_size_rbo = FAIL
2321 : dEQP-GLES3.functional.state_query.fbo.framebuffer_unspecified_attachment_x_size_rbo = FAIL
// TODO(jmadill): Figure out why these fail on the bots, but not locally.
1108 WIN D3D11 : dEQP-GLES3.functional.shaders.struct.local.dynamic_loop_struct_array_fragment = FAIL
......@@ -104,14 +110,15 @@
2222 D3D11 NVIDIA : dEQP-GLES3.functional.texture.mipmap.cube.min_lod.nearest_nearest = FAIL
// Failing everywhere
2322 DEBUG RELEASE : dEQP-GLES3.functional.shaders.metamorphic.* = FAIL
2322 : dEQP-GLES3.functional.shaders.metamorphic.* = FAIL
// Bind aliasing is not working currently
3252 DEBUG RELEASE : dEQP-GLES3.functional.attribute_location.bind_aliasing.cond* = FAIL
3252 DEBUG RELEASE : dEQP-GLES3.functional.attribute_location.bind_aliasing.max_cond* = FAIL
3252 : dEQP-GLES3.functional.attribute_location.bind_aliasing.cond* = FAIL
3252 : dEQP-GLES3.functional.attribute_location.bind_aliasing.max_cond* = FAIL
// Windows and Linux failures
1095 WIN LINUX : dEQP-GLES3.functional.texture.mipmap.2d.projected.* = FAIL
1095 WIN : dEQP-GLES3.functional.texture.mipmap.2d.projected.* = FAIL
1095 LINUX : dEQP-GLES3.functional.texture.mipmap.2d.projected.* = FAIL
// Windows only failure
1092 WIN D3D11 : dEQP-GLES3.functional.shaders.texture_functions.textureoffset.sampler3d_fixed_fragment = FAIL
......@@ -254,7 +261,8 @@
2349 D3D11 INTEL : dEQP-GLES3.functional.rasterization.fbo.rbo_multisample_max.interpolation.lines = FAIL
// Failing Tests on Windows and Mac on Intel HD 630
2137 WIN MAC INTEL : dEQP-GLES3.functional.fbo.color.repeated_clear.sample.tex2d.* = FAIL
2137 WIN INTEL : dEQP-GLES3.functional.fbo.color.repeated_clear.sample.tex2d.* = FAIL
2137 MAC INTEL : dEQP-GLES3.functional.fbo.color.repeated_clear.sample.tex2d.* = FAIL
// Linux only failures
......@@ -507,11 +515,11 @@
2567 ANDROID GLES : dEQP-GLES3.functional.fbo.completeness.renderable.texture.stencil.rg_unsigned_byte = FAIL
// Nexus 5x failures
3308 ANDROID GLES : dEQP-GLES3.functional.polygon_offset.default_result_depth_clamp = FAIL
3308 ANDROID GLES : dEQP-GLES3.functional.polygon_offset.fixed24_result_depth_clamp = FAIL
3308 ANDROID GLES : dEQP-GLES3.functional.transform_feedback.random.interleaved.lines.3 = FAIL
3308 ANDROID GLES : dEQP-GLES3.functional.transform_feedback.random.interleaved.triangles.8 = FAIL
3308 ANDROID GLES : dEQP-GLES3.functional.transform_feedback.random.interleaved.triangles.10 = FAIL
3308 NEXUS5X GLES : dEQP-GLES3.functional.polygon_offset.default_result_depth_clamp = FAIL
3308 NEXUS5X GLES : dEQP-GLES3.functional.polygon_offset.fixed24_result_depth_clamp = FAIL
3308 NEXUS5X GLES : dEQP-GLES3.functional.transform_feedback.random.interleaved.lines.3 = FAIL
3308 NEXUS5X GLES : dEQP-GLES3.functional.transform_feedback.random.interleaved.triangles.8 = FAIL
3308 NEXUS5X GLES : dEQP-GLES3.functional.transform_feedback.random.interleaved.triangles.10 = FAIL
// Seems to fail on all desktop GL
2960 OPENGL : dEQP-GLES3.functional.fbo.blit.default_framebuffer.srgb8_alpha8 = FAIL
......
......@@ -7,166 +7,73 @@
#ifndef TEST_EXPECTATIONS_GPU_TEST_CONFIG_H_
#define TEST_EXPECTATIONS_GPU_TEST_CONFIG_H_
#include <stdint.h>
#include <iostream>
#include <string>
#include <vector>
#include "common/debug.h"
#include "common/platform.h"
#include "common/string_utils.h"
namespace gfx
{
class Size
{
public:
int width() const { return 0; }
int height() const { return 0; }
std::string ToString() const { return "0x0"; }
};
} // namespace gfx
struct DxDiagNode
{};
#include <array>
namespace angle
{
struct GPUInfo;
class GPUTestConfig
struct GPUTestConfig
{
public:
enum OS
enum API
{
kOsUnknown = 0,
kOsWinXP = 1 << 0,
kOsWinVista = 1 << 1,
kOsWin7 = 1 << 2,
kOsWin8 = 1 << 3,
kOsMacLeopard = 1 << 4,
kOsMacSnowLeopard = 1 << 5,
kOsMacLion = 1 << 6,
kOsMacMountainLion = 1 << 7,
kOsMacMavericks = 1 << 8,
kOsMacYosemite = 1 << 9,
kOsMacElCapitan = 1 << 10,
kOsMacSierra = 1 << 11,
kOsMacHighSierra = 1 << 12,
kOsMacMojave = 1 << 13,
kOsMac = kOsMacLeopard | kOsMacSnowLeopard | kOsMacLion | kOsMacMountainLion |
kOsMacMavericks | kOsMacYosemite | kOsMacElCapitan | kOsMacSierra |
kOsMacHighSierra | kOsMacMojave,
kOsLinux = 1 << 14,
kOsChromeOS = 1 << 15,
kOsAndroid = 1 << 16,
kOsWin10 = 1 << 17,
kOsWin = kOsWinXP | kOsWinVista | kOsWin7 | kOsWin8 | kOsWin10,
kOsFuchsia = 1 << 18,
kAPIUnknown = 0,
kAPID3D9,
kAPID3D11,
kAPIGLDesktop,
kAPIGLES,
kAPIVulkan,
};
enum BuildType
enum Condition
{
kBuildTypeUnknown = 0,
kBuildTypeRelease = 1 << 0,
kBuildTypeDebug = 1 << 1,
kConditionNone = 0,
kConditionWinXP,
kConditionWinVista,
kConditionWin7,
kConditionWin8,
kConditionWin10,
kConditionWin,
kConditionMacLeopard,
kConditionMacSnowLeopard,
kConditionMacLion,
kConditionMacMountainLion,
kConditionMacMavericks,
kConditionMacYosemite,
kConditionMacElCapitan,
kConditionMacSierra,
kConditionMacHighSierra,
kConditionMacMojave,
kConditionMac,
kConditionLinux,
kConditionAndroid,
kConditionNVIDIA,
kConditionAMD,
kConditionIntel,
kConditionVMWare,
kConditionRelease,
kConditionDebug,
kConditionD3D9,
kConditionD3D11,
kConditionGLDesktop,
kConditionGLES,
kConditionVulkan,
kConditionNexus5X,
kConditionPixel2,
kConditionNVIDIAQuadroP400,
kNumberOfConditions,
};
enum API
{
kAPIUnknown = 0,
kAPID3D9 = 1 << 0,
kAPID3D11 = 1 << 1,
kAPIGLDesktop = 1 << 2,
kAPIGLES = 1 << 3,
kAPIVulkan = 1 << 4,
};
typedef std::array<bool, GPUTestConfig::kNumberOfConditions> ConditionArray;
GPUTestConfig();
GPUTestConfig(const GPUTestConfig &other);
virtual ~GPUTestConfig();
void set_os(int32_t os);
void set_gpu_device_id(uint32_t id);
void set_build_type(int32_t build_type);
void set_api(int32_t api);
virtual void AddGPUVendor(uint32_t gpu_vendor);
int32_t os() const { return os_; }
const std::vector<uint32_t> &gpu_vendor() const { return gpu_vendor_; }
uint32_t gpu_device_id() const { return gpu_device_id_; }
int32_t build_type() const { return build_type_; }
int32_t api() const { return api_; }
// Check if the config is valid. For example, if gpu_device_id_ is set, but
// gpu_vendor_ is unknown, then it's invalid.
virtual bool IsValid() const;
// Check if two configs overlap, i.e., if there exists a config that matches
// both configs.
bool OverlapsWith(const GPUTestConfig &config) const;
GPUTestConfig(const API &api);
// Disable validation of GPU vendor and device ids.
void DisableGPUInfoValidation();
const GPUTestConfig::ConditionArray &getConditions() const;
protected:
void ClearGPUVendor();
// Indicates that the OS has the notion of a numeric GPU vendor and device id
// and this data should be validated.
bool validate_gpu_info_;
private:
// operating system.
int32_t os_;
// GPU vendor.
std::vector<uint32_t> gpu_vendor_;
// GPU device id (unique to each vendor).
uint32_t gpu_device_id_;
// Release or Debug.
int32_t build_type_;
// Back-end rendering APIs.
int32_t api_;
};
class GPUTestBotConfig : public GPUTestConfig
{
public:
GPUTestBotConfig() = default;
~GPUTestBotConfig() override;
// This should only be called when no gpu_vendor is added.
void AddGPUVendor(uint32_t gpu_vendor) override;
// Return false if gpu_info does not have valid vendor_id and device_id.
bool SetGPUInfo(const GPUInfo &gpu_info);
// Check if the bot config is valid, i.e., if it is one valid test-bot
// environment. For example, if a field is unknown, or if OS is not one
// fully defined OS, then it's valid.
bool IsValid() const override;
// Check if a bot config matches a test config, i.e., the test config is a
// superset of the bot config.
bool Matches(const GPUTestConfig &config) const;
bool Matches(const std::string &config_data) const;
// Setup the config with the current gpu testing environment.
// If gpu_info is nullptr, collect GPUInfo first.
bool LoadCurrentConfig(const GPUInfo *gpu_info);
// Check if this bot's config matches |config_data| or any of the |configs|.
static bool CurrentConfigMatches(const std::string &config_data);
static bool CurrentConfigMatches(const std::vector<std::string> &configs);
// Check if the bot has blacklisted all GPU features.
static bool GpuBlacklistedOnBot();
GPUTestConfig::ConditionArray mConditions;
};
} // namespace angle
......
......@@ -10,14 +10,12 @@
#ifndef TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_
#define TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_
#include "GPUInfo.h"
#include <stdint.h>
namespace angle
{
void GetOperatingSystemVersionNumbers(int32_t *major_version,
int32_t *minor_version,
int32_t *bugfix_version);
void GetOperatingSystemVersionNumbers(int32_t *majorVersion, int32_t *minorVersion);
} // namespace angle
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
// GPUTestConfig_mac.mm:
// Helper functions for gpu_test_config that have to be compiled in ObjectiveC++
// Helper functions for GPUTestConfig that have to be compiled in ObjectiveC++
#include "GPUTestConfig_mac.h"
......@@ -21,28 +21,23 @@
namespace angle
{
void GetOperatingSystemVersionNumbers(int32_t *major_version,
int32_t *minor_version,
int32_t *bugfix_version)
void GetOperatingSystemVersionNumbers(int32_t *majorVersion, int32_t *minorVersion)
{
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
Gestalt(gestaltSystemVersionMajor, reinterpret_cast<SInt32 *>(major_version));
Gestalt(gestaltSystemVersionMinor, reinterpret_cast<SInt32 *>(minor_version));
Gestalt(gestaltSystemVersionBugFix, reinterpret_cast<SInt32 *>(bugfix_version));
Gestalt(gestaltSystemVersionMajor, reinterpret_cast<SInt32 *>(majorVersion));
Gestalt(gestaltSystemVersionMinor, reinterpret_cast<SInt32 *>(minorVersion));
#else
if (@available(macOS 10.10, *))
{
NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
*major_version = version.majorVersion;
*minor_version = version.minorVersion;
*bugfix_version = version.patchVersion;
*majorVersion = version.majorVersion;
*minorVersion = version.minorVersion;
}
else
{
// This can only happen on 10.9
*major_version = 10;
*minor_version = 9;
*bugfix_version = 0;
*majorVersion = 10;
*minorVersion = 9;
}
#endif
}
......
......@@ -13,11 +13,11 @@
#include <string>
#include <vector>
#include "GPUTestConfig.h"
namespace angle
{
struct GPUTestConfig;
class GPUTestExpectationsParser
{
public:
......@@ -36,55 +36,47 @@ class GPUTestExpectationsParser
// Parse the text expectations, and if no error is encountered,
// save all the entries. Otherwise, generate error messages.
// Return true if parsing succeeds.
bool LoadTestExpectations(const std::string &data);
bool LoadTestExpectationsFromFile(const std::string &path);
bool loadTestExpectations(const GPUTestConfig &config, const std::string &data);
bool loadTestExpectationsFromFile(const GPUTestConfig &config, const std::string &path);
// Query error messages from the last LoadTestExpectations() call.
const std::vector<std::string> &GetErrorMessages() const;
const std::vector<std::string> &getErrorMessages() const;
// Get the test expectation of a given test on a given bot.
int32_t GetTestExpectation(const std::string &test_name,
const GPUTestBotConfig &bot_config) const;
// Parse a list of config modifiers. If we have a valid entry with no
// conflicts, | config | stores it, and the function returns true.
bool ParseConfig(const std::string &config_data, GPUTestConfig *config);
int32_t getTestExpectation(const std::string &testName) const;
private:
struct GPUTestExpectationEntry
{
GPUTestExpectationEntry();
std::string test_name;
GPUTestConfig test_config;
int32_t test_expectation;
size_t line_number;
std::string mTestName;
int32_t mTestExpectation;
size_t mLineNumber;
};
// Parse a line of text. If we have a valid entry, save it; otherwise,
// generate error messages.
bool ParseLine(const std::string &line_data, size_t line_number);
// Update OS/GPUVendor/BuildType modifiers. May generate an error message.
bool UpdateTestConfig(GPUTestConfig *config, int32_t token, size_t line_number);
bool parseLine(const GPUTestConfig &config, const std::string &lineData, size_t lineNumber);
// Update GPUDeviceID modifier. May generate an error message.
bool UpdateTestConfig(GPUTestConfig *config,
const std::string &gpu_device_id,
size_t line_number);
// Check a the condition assigned to a particular token.
bool checkTokenCondition(const GPUTestConfig &config,
bool &err,
int32_t token,
size_t lineNumber);
// Check if two entries' config overlap with each other. May generate an
// error message.
bool DetectConflictsBetweenEntries();
bool detectConflictsBetweenEntries();
// Save an error message, which can be queried later.
void PushErrorMessage(const std::string &message, size_t line_number);
void PushErrorMessage(const std::string &message,
size_t entry1_line_number,
size_t entry2_line_number);
void pushErrorMessage(const std::string &message, size_t lineNumber);
void pushErrorMessage(const std::string &message,
size_t entry1LineNumber,
size_t entry2LineNumber);
std::vector<GPUTestExpectationEntry> entries_;
std::vector<std::string> error_messages_;
std::vector<GPUTestExpectationEntry> mEntries;
std::vector<std::string> mErrorMessages;
};
} // namespace angle
......
//
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// GPUTestExpectationsTest.cpp : Tests of the test_expectations library.
#include "test_expectations/GPUTestConfig.h"
#include "test_expectations/GPUTestExpectationsParser.h"
#include "test_utils/ANGLETest.h"
namespace angle
{
class GPUTestConfigTest : public ANGLETest
{
protected:
GPUTestConfigTest() {}
// todo(jonahr): Eventually could add support for all conditions/operating
// systems, but these are the ones in use for now
void validateConfigBase(const GPUTestConfig &config)
{
EXPECT_EQ(IsWindows(), config.getConditions()[GPUTestConfig::kConditionWin]);
EXPECT_EQ(IsOSX(), config.getConditions()[GPUTestConfig::kConditionMac]);
EXPECT_EQ(IsLinux(), config.getConditions()[GPUTestConfig::kConditionLinux]);
EXPECT_EQ(IsAndroid(), config.getConditions()[GPUTestConfig::kConditionAndroid]);
EXPECT_EQ(IsNexus5X(), config.getConditions()[GPUTestConfig::kConditionNexus5X]);
EXPECT_EQ(IsPixel2(), config.getConditions()[GPUTestConfig::kConditionPixel2]);
EXPECT_EQ(IsIntel(), config.getConditions()[GPUTestConfig::kConditionIntel]);
EXPECT_EQ(IsAMD(), config.getConditions()[GPUTestConfig::kConditionAMD]);
EXPECT_EQ(IsNVIDIA(), config.getConditions()[GPUTestConfig::kConditionNVIDIA]);
EXPECT_EQ(IsDebug(), config.getConditions()[GPUTestConfig::kConditionDebug]);
EXPECT_EQ(IsRelease(), config.getConditions()[GPUTestConfig::kConditionRelease]);
}
void validateConfigAPI(const GPUTestConfig &config, const GPUTestConfig::API &api)
{
bool D3D9 = false;
bool D3D11 = false;
bool GLDesktop = false;
bool GLES = false;
bool Vulkan = false;
switch (api)
{
case GPUTestConfig::kAPID3D9:
D3D9 = true;
break;
case GPUTestConfig::kAPID3D11:
D3D11 = true;
break;
case GPUTestConfig::kAPIGLDesktop:
GLDesktop = true;
break;
case GPUTestConfig::kAPIGLES:
GLES = true;
break;
case GPUTestConfig::kAPIVulkan:
Vulkan = true;
break;
case GPUTestConfig::kAPIUnknown:
default:
break;
}
EXPECT_EQ(D3D9, config.getConditions()[GPUTestConfig::kConditionD3D9]);
EXPECT_EQ(D3D11, config.getConditions()[GPUTestConfig::kConditionD3D11]);
EXPECT_EQ(GLDesktop, config.getConditions()[GPUTestConfig::kConditionGLDesktop]);
EXPECT_EQ(GLES, config.getConditions()[GPUTestConfig::kConditionGLES]);
EXPECT_EQ(Vulkan, config.getConditions()[GPUTestConfig::kConditionVulkan]);
}
};
// Create a new GPUTestConfig and make sure all the condition flags were set
// correctly based on the hardware.
TEST_P(GPUTestConfigTest, GPUTestConfigConditions)
{
GPUTestConfig config;
validateConfigBase(config);
}
// Create a new GPUTestConfig with each backend specified and validate the
// condition flags are set correctly.
TEST_P(GPUTestConfigTest, GPUTestConfigConditions_D3D9)
{
GPUTestConfig config(GPUTestConfig::kAPID3D9);
validateConfigAPI(config, GPUTestConfig::kAPID3D9);
}
TEST_P(GPUTestConfigTest, GPUTestConfigConditions_D3D11)
{
GPUTestConfig config(GPUTestConfig::kAPID3D11);
validateConfigAPI(config, GPUTestConfig::kAPID3D11);
}
TEST_P(GPUTestConfigTest, GPUTestConfigConditions_GLDesktop)
{
GPUTestConfig config(GPUTestConfig::kAPIGLDesktop);
validateConfigAPI(config, GPUTestConfig::kAPIGLDesktop);
}
TEST_P(GPUTestConfigTest, GPUTestConfigConditions_GLES)
{
GPUTestConfig config(GPUTestConfig::kAPIGLES);
validateConfigAPI(config, GPUTestConfig::kAPIGLES);
}
TEST_P(GPUTestConfigTest, GPUTestConfigConditions_Vulkan)
{
GPUTestConfig config(GPUTestConfig::kAPIVulkan);
validateConfigAPI(config, GPUTestConfig::kAPIVulkan);
}
// Use this to select which configurations (e.g. which renderer, which GLES major version) these
// tests should be run against.
ANGLE_INSTANTIATE_TEST(GPUTestConfigTest,
ES2_D3D9(),
ES2_D3D11(),
ES3_D3D11(),
ES2_D3D11_FL9_3(),
ES2_OPENGL(),
ES3_OPENGL(),
ES2_OPENGLES(),
ES3_OPENGLES(),
ES2_VULKAN());
} // namespace angle
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment