Commit 518c679d by Jonah Ryan-Davis Committed by Commit Bot

Clean up test_expectations to merge with angle style/convention.

Can rename/clean up the library to move from chrome style to angle style. Can also start pulling out chrome-specific definitions. More work to be done when moving gpu_info to use Angle's SystemInfo. Bug: angleproject:2677 Change-Id: I75fd4446aa4be85fba590cd00cd3a213a0b3752e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1538677 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 4864e0cd
...@@ -1144,14 +1144,14 @@ deqp_libtester_sources_android = [ ...@@ -1144,14 +1144,14 @@ deqp_libtester_sources_android = [
"$_deqp_path/framework/platform/android/tcuAndroidInternals.hpp", "$_deqp_path/framework/platform/android/tcuAndroidInternals.hpp",
] ]
deqp_test_expectations_sources = [ deqp_test_expectations_sources = [
"test_expectations/gpu_info.cpp", "test_expectations/GPUInfo.cpp",
"test_expectations/gpu_info.h", "test_expectations/GPUInfo.h",
"test_expectations/gpu_test_config.cpp", "test_expectations/GPUTestConfig.cpp",
"test_expectations/gpu_test_config.h", "test_expectations/GPUTestConfig.h",
"test_expectations/gpu_test_expectations_parser.cpp", "test_expectations/GPUTestExpectationsParser.cpp",
"test_expectations/gpu_test_expectations_parser.h", "test_expectations/GPUTestExpectationsParser.h",
] ]
deqp_test_expectations_sources_mac = [ deqp_test_expectations_sources_mac = [
"test_expectations/gpu_test_config_mac.mm", "test_expectations/GPUTestConfig_mac.mm",
"test_expectations/gpu_test_config_mac.h", "test_expectations/GPUTestConfig_mac.h",
] ]
...@@ -20,11 +20,15 @@ ...@@ -20,11 +20,15 @@
#include "common/platform.h" #include "common/platform.h"
#include "common/string_utils.h" #include "common/string_utils.h"
#include "platform/Platform.h" #include "platform/Platform.h"
#include "tests/test_expectations/gpu_test_expectations_parser.h" #include "tests/test_expectations/GPUTestExpectationsParser.h"
#include "util/system_utils.h" #include "util/system_utils.h"
namespace angle
{
namespace namespace
{ {
bool gGlobalError = false; bool gGlobalError = false;
bool gExpectError = false; bool gExpectError = false;
...@@ -81,15 +85,15 @@ const char *gTestExpectationsFiles[] = { ...@@ -81,15 +85,15 @@ const char *gTestExpectationsFiles[] = {
"deqp_egl_test_expectations.txt", "deqp_egl_test_expectations.txt",
}; };
using APIInfo = std::pair<const char *, gpu::GPUTestConfig::API>; using APIInfo = std::pair<const char *, angle::GPUTestConfig::API>;
const APIInfo gEGLDisplayAPIs[] = { const APIInfo gEGLDisplayAPIs[] = {
{"angle-d3d9", gpu::GPUTestConfig::kAPID3D9}, {"angle-d3d9", angle::GPUTestConfig::kAPID3D9},
{"angle-d3d11", gpu::GPUTestConfig::kAPID3D11}, {"angle-d3d11", angle::GPUTestConfig::kAPID3D11},
{"angle-gl", gpu::GPUTestConfig::kAPIGLDesktop}, {"angle-gl", angle::GPUTestConfig::kAPIGLDesktop},
{"angle-gles", gpu::GPUTestConfig::kAPIGLES}, {"angle-gles", angle::GPUTestConfig::kAPIGLES},
{"angle-null", gpu::GPUTestConfig::kAPIUnknown}, {"angle-null", angle::GPUTestConfig::kAPIUnknown},
{"angle-vulkan", gpu::GPUTestConfig::kAPIVulkan}, {"angle-vulkan", angle::GPUTestConfig::kAPIVulkan},
}; };
const char *gdEQPEGLString = "--deqp-egl-display-type="; const char *gdEQPEGLString = "--deqp-egl-display-type=";
...@@ -213,8 +217,8 @@ class dEQPCaseList ...@@ -213,8 +217,8 @@ class dEQPCaseList
private: private:
std::vector<CaseInfo> mCaseInfoList; std::vector<CaseInfo> mCaseInfoList;
gpu::GPUTestExpectationsParser mTestExpectationsParser; angle::GPUTestExpectationsParser mTestExpectationsParser;
gpu::GPUTestBotConfig mTestConfig; angle::GPUTestBotConfig mTestConfig;
size_t mTestModuleIndex; size_t mTestModuleIndex;
bool mInitialized; bool mInitialized;
}; };
...@@ -296,7 +300,7 @@ void dEQPCaseList::initialize() ...@@ -296,7 +300,7 @@ void dEQPCaseList::initialize()
continue; continue;
int expectation = mTestExpectationsParser.GetTestExpectation(dEQPName, mTestConfig); int expectation = mTestExpectationsParser.GetTestExpectation(dEQPName, mTestConfig);
if (expectation != gpu::GPUTestExpectationsParser::kGpuTestSkip) if (expectation != angle::GPUTestExpectationsParser::kGpuTestSkip)
{ {
mCaseInfoList.push_back(CaseInfo(dEQPName, gTestName, expectation)); mCaseInfoList.push_back(CaseInfo(dEQPName, gTestName, expectation));
} }
...@@ -357,7 +361,7 @@ class dEQPTest : public testing::TestWithParam<size_t> ...@@ -357,7 +361,7 @@ class dEQPTest : public testing::TestWithParam<size_t>
const auto &caseInfo = GetCaseList().getCaseInfo(GetParam()); const auto &caseInfo = GetCaseList().getCaseInfo(GetParam());
std::cout << caseInfo.mDEQPName << std::endl; std::cout << caseInfo.mDEQPName << std::endl;
gExpectError = (caseInfo.mExpectation != gpu::GPUTestExpectationsParser::kGpuTestPass); gExpectError = (caseInfo.mExpectation != angle::GPUTestExpectationsParser::kGpuTestPass);
TestResult result = deqp_libtester_run(caseInfo.mDEQPName.c_str()); TestResult result = deqp_libtester_run(caseInfo.mDEQPName.c_str());
bool testPassed = TestPassed(result); bool testPassed = TestPassed(result);
...@@ -369,7 +373,7 @@ class dEQPTest : public testing::TestWithParam<size_t> ...@@ -369,7 +373,7 @@ class dEQPTest : public testing::TestWithParam<size_t>
gGlobalError = false; gGlobalError = false;
} }
if (caseInfo.mExpectation == gpu::GPUTestExpectationsParser::kGpuTestPass) if (caseInfo.mExpectation == angle::GPUTestExpectationsParser::kGpuTestPass)
{ {
EXPECT_TRUE(testPassed); EXPECT_TRUE(testPassed);
sPasses += (testPassed ? 1u : 0u); sPasses += (testPassed ? 1u : 0u);
...@@ -548,8 +552,6 @@ void DeleteArg(int *argc, int argIndex, char **argv) ...@@ -548,8 +552,6 @@ void DeleteArg(int *argc, int argIndex, char **argv)
} // anonymous namespace } // anonymous namespace
// Called from main() to process command-line arguments. // Called from main() to process command-line arguments.
namespace angle
{
void InitTestHarness(int *argc, char **argv) void InitTestHarness(int *argc, char **argv)
{ {
int argIndex = 0; int argIndex = 0;
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved. //
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
//
#include <stdint.h> #include <stdint.h>
#include "gpu_info.h" #include "GPUInfo.h"
namespace namespace
{ {
void EnumerateGPUDevice(const gpu::GPUInfo::GPUDevice &device, gpu::GPUInfo::Enumerator *enumerator) void EnumerateGPUDevice(const angle::GPUInfo::GPUDevice &device,
angle::GPUInfo::Enumerator *enumerator)
{ {
enumerator->BeginGPUDevice(); enumerator->BeginGPUDevice();
enumerator->AddInt("vendorId", device.vendor_id); enumerator->AddInt("vendorId", device.vendor_id);
...@@ -25,8 +28,8 @@ void EnumerateGPUDevice(const gpu::GPUInfo::GPUDevice &device, gpu::GPUInfo::Enu ...@@ -25,8 +28,8 @@ void EnumerateGPUDevice(const gpu::GPUInfo::GPUDevice &device, gpu::GPUInfo::Enu
} }
void EnumerateVideoDecodeAcceleratorSupportedProfile( void EnumerateVideoDecodeAcceleratorSupportedProfile(
const gpu::VideoDecodeAcceleratorSupportedProfile &profile, const angle::VideoDecodeAcceleratorSupportedProfile &profile,
gpu::GPUInfo::Enumerator *enumerator) angle::GPUInfo::Enumerator *enumerator)
{ {
enumerator->BeginVideoDecodeAcceleratorSupportedProfile(); enumerator->BeginVideoDecodeAcceleratorSupportedProfile();
enumerator->AddInt("profile", profile.profile); enumerator->AddInt("profile", profile.profile);
...@@ -39,8 +42,8 @@ void EnumerateVideoDecodeAcceleratorSupportedProfile( ...@@ -39,8 +42,8 @@ void EnumerateVideoDecodeAcceleratorSupportedProfile(
} }
void EnumerateVideoEncodeAcceleratorSupportedProfile( void EnumerateVideoEncodeAcceleratorSupportedProfile(
const gpu::VideoEncodeAcceleratorSupportedProfile &profile, const angle::VideoEncodeAcceleratorSupportedProfile &profile,
gpu::GPUInfo::Enumerator *enumerator) angle::GPUInfo::Enumerator *enumerator)
{ {
enumerator->BeginVideoEncodeAcceleratorSupportedProfile(); enumerator->BeginVideoEncodeAcceleratorSupportedProfile();
enumerator->AddInt("profile", profile.profile); enumerator->AddInt("profile", profile.profile);
...@@ -51,32 +54,32 @@ void EnumerateVideoEncodeAcceleratorSupportedProfile( ...@@ -51,32 +54,32 @@ void EnumerateVideoEncodeAcceleratorSupportedProfile(
enumerator->EndVideoEncodeAcceleratorSupportedProfile(); enumerator->EndVideoEncodeAcceleratorSupportedProfile();
} }
const char *ImageDecodeAcceleratorTypeToString(gpu::ImageDecodeAcceleratorType type) const char *ImageDecodeAcceleratorTypeToString(angle::ImageDecodeAcceleratorType type)
{ {
switch (type) switch (type)
{ {
case gpu::ImageDecodeAcceleratorType::kJpeg: case angle::ImageDecodeAcceleratorType::kJpeg:
return "JPEG"; return "JPEG";
case gpu::ImageDecodeAcceleratorType::kUnknown: case angle::ImageDecodeAcceleratorType::kUnknown:
return "Unknown"; return "Unknown";
} }
} }
const char *ImageDecodeAcceleratorSubsamplingToString( const char *ImageDecodeAcceleratorSubsamplingToString(
gpu::ImageDecodeAcceleratorSubsampling subsampling) angle::ImageDecodeAcceleratorSubsampling subsampling)
{ {
switch (subsampling) switch (subsampling)
{ {
case gpu::ImageDecodeAcceleratorSubsampling::k420: case angle::ImageDecodeAcceleratorSubsampling::k420:
return "4:2:0"; return "4:2:0";
case gpu::ImageDecodeAcceleratorSubsampling::k422: case angle::ImageDecodeAcceleratorSubsampling::k422:
return "4:2:2"; return "4:2:2";
} }
} }
void EnumerateImageDecodeAcceleratorSupportedProfile( void EnumerateImageDecodeAcceleratorSupportedProfile(
const gpu::ImageDecodeAcceleratorSupportedProfile &profile, const angle::ImageDecodeAcceleratorSupportedProfile &profile,
gpu::GPUInfo::Enumerator *enumerator) angle::GPUInfo::Enumerator *enumerator)
{ {
enumerator->BeginImageDecodeAcceleratorSupportedProfile(); enumerator->BeginImageDecodeAcceleratorSupportedProfile();
enumerator->AddString("imageType", ImageDecodeAcceleratorTypeToString(profile.image_type)); enumerator->AddString("imageType", ImageDecodeAcceleratorTypeToString(profile.image_type));
...@@ -93,9 +96,9 @@ void EnumerateImageDecodeAcceleratorSupportedProfile( ...@@ -93,9 +96,9 @@ void EnumerateImageDecodeAcceleratorSupportedProfile(
enumerator->EndImageDecodeAcceleratorSupportedProfile(); enumerator->EndImageDecodeAcceleratorSupportedProfile();
} }
#if defined(OS_WIN) #if defined(ANGLE_PLATFORM_WINDOWS)
void EnumerateOverlayCapability(const gpu::OverlayCapability &cap, void EnumerateOverlayCapability(const angle::OverlayCapability &cap,
gpu::GPUInfo::Enumerator *enumerator) angle::GPUInfo::Enumerator *enumerator)
{ {
std::string key_string = "overlayCap"; std::string key_string = "overlayCap";
key_string += OverlayFormatToString(cap.format); key_string += OverlayFormatToString(cap.format);
...@@ -104,8 +107,8 @@ void EnumerateOverlayCapability(const gpu::OverlayCapability &cap, ...@@ -104,8 +107,8 @@ void EnumerateOverlayCapability(const gpu::OverlayCapability &cap,
enumerator->EndOverlayCapability(); enumerator->EndOverlayCapability();
} }
void EnumerateDx12VulkanVersionInfo(const gpu::Dx12VulkanVersionInfo &info, void EnumerateDx12VulkanVersionInfo(const angle::Dx12VulkanVersionInfo &info,
gpu::GPUInfo::Enumerator *enumerator) angle::GPUInfo::Enumerator *enumerator)
{ {
enumerator->BeginDx12VulkanVersionInfo(); enumerator->BeginDx12VulkanVersionInfo();
enumerator->AddBool("supportsDx12", info.supports_dx12); enumerator->AddBool("supportsDx12", info.supports_dx12);
...@@ -118,10 +121,10 @@ void EnumerateDx12VulkanVersionInfo(const gpu::Dx12VulkanVersionInfo &info, ...@@ -118,10 +121,10 @@ void EnumerateDx12VulkanVersionInfo(const gpu::Dx12VulkanVersionInfo &info,
} // namespace } // namespace
namespace gpu namespace angle
{ {
#if defined(OS_WIN) #if defined(ANGLE_PLATFORM_WINDOWS)
const char *OverlayFormatToString(OverlayFormat format) const char *OverlayFormatToString(OverlayFormat format)
{ {
switch (format) switch (format)
...@@ -215,7 +218,7 @@ const GPUInfo::GPUDevice &GPUInfo::active_gpu() const ...@@ -215,7 +218,7 @@ const GPUInfo::GPUDevice &GPUInfo::active_gpu() const
if (secondary_gpu.active) if (secondary_gpu.active)
return secondary_gpu; return secondary_gpu;
} }
DVLOG(2) << "No active GPU found, returning primary GPU.\n"; std::cerr << "No active GPU found, returning primary GPU.\n";
return gpu; return gpu;
} }
...@@ -228,7 +231,7 @@ void GPUInfo::EnumerateFields(Enumerator *enumerator) const ...@@ -228,7 +231,7 @@ void GPUInfo::EnumerateFields(Enumerator *enumerator) const
{ {
struct GPUInfoKnownFields struct GPUInfoKnownFields
{ {
base::TimeDelta initialization_time; int64_t initialization_time;
bool optimus; bool optimus;
bool amd_switchable; bool amd_switchable;
GPUDevice gpu; GPUDevice gpu;
...@@ -252,7 +255,7 @@ void GPUInfo::EnumerateFields(Enumerator *enumerator) const ...@@ -252,7 +255,7 @@ void GPUInfo::EnumerateFields(Enumerator *enumerator) const
bool in_process_gpu; bool in_process_gpu;
bool passthrough_cmd_decoder; bool passthrough_cmd_decoder;
bool can_support_threaded_texture_mailbox; bool can_support_threaded_texture_mailbox;
#if defined(OS_WIN) #if defined(ANGLE_PLATFORM_WINDOWS)
bool direct_composition; bool direct_composition;
bool supports_overlays; bool supports_overlays;
OverlayCapabilities overlay_capabilities; OverlayCapabilities overlay_capabilities;
...@@ -288,7 +291,7 @@ void GPUInfo::EnumerateFields(Enumerator *enumerator) const ...@@ -288,7 +291,7 @@ void GPUInfo::EnumerateFields(Enumerator *enumerator) const
EnumerateGPUDevice(secondary_gpu, enumerator); EnumerateGPUDevice(secondary_gpu, enumerator);
enumerator->BeginAuxAttributes(); enumerator->BeginAuxAttributes();
enumerator->AddTimeDeltaInSecondsF("initializationTime", initialization_time); enumerator->AddTimeDeltaInSeconds("initializationTime", initialization_time);
enumerator->AddBool("optimus", optimus); enumerator->AddBool("optimus", optimus);
enumerator->AddBool("amdSwitchable", amd_switchable); enumerator->AddBool("amdSwitchable", amd_switchable);
enumerator->AddString("pixelShaderVersion", pixel_shader_version); enumerator->AddString("pixelShaderVersion", pixel_shader_version);
...@@ -311,7 +314,7 @@ void GPUInfo::EnumerateFields(Enumerator *enumerator) const ...@@ -311,7 +314,7 @@ void GPUInfo::EnumerateFields(Enumerator *enumerator) const
enumerator->AddBool("passthroughCmdDecoder", passthrough_cmd_decoder); enumerator->AddBool("passthroughCmdDecoder", passthrough_cmd_decoder);
enumerator->AddBool("canSupportThreadedTextureMailbox", can_support_threaded_texture_mailbox); enumerator->AddBool("canSupportThreadedTextureMailbox", can_support_threaded_texture_mailbox);
// TODO(kbr): add dx_diagnostics on Windows. // TODO(kbr): add dx_diagnostics on Windows.
#if defined(OS_WIN) #if defined(ANGLE_PLATFORM_WINDOWS)
enumerator->AddBool("directComposition", direct_composition); enumerator->AddBool("directComposition", direct_composition);
enumerator->AddBool("supportsOverlays", supports_overlays); enumerator->AddBool("supportsOverlays", supports_overlays);
for (const auto &cap : overlay_capabilities) for (const auto &cap : overlay_capabilities)
...@@ -334,4 +337,4 @@ void GPUInfo::EnumerateFields(Enumerator *enumerator) const ...@@ -334,4 +337,4 @@ void GPUInfo::EnumerateFields(Enumerator *enumerator) const
enumerator->EndAuxAttributes(); enumerator->EndAuxAttributes();
} }
} // namespace gpu } // namespace angle
// Copyright (c) 2012 The Chromium Authors. All rights reserved. //
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
//
#ifndef ANGLE_GPU_CONFIG_GPU_INFO_H_ #ifndef TEST_EXPECTATIONS_GPU_INFO_H_
#define ANGLE_GPU_CONFIG_GPU_INFO_H_ #define TEST_EXPECTATIONS_GPU_INFO_H_
// Provides access to the GPU information for the system // Provides access to the GPU information for the system
// on which chrome is currently running. // on which chrome is currently running.
...@@ -13,13 +15,14 @@ ...@@ -13,13 +15,14 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "gpu_test_config.h" #include "GPUTestConfig.h"
#include "common/platform.h"
#if defined(USE_X11) #if defined(USE_X11)
typedef unsigned long VisualID; typedef unsigned long VisualID;
#endif #endif
namespace gpu namespace angle
{ {
// These values are persisted to logs. Entries should not be renumbered and // These values are persisted to logs. Entries should not be renumbered and
...@@ -82,7 +85,7 @@ enum VideoCodecProfile ...@@ -82,7 +85,7 @@ enum VideoCodecProfile
}; };
// Specification of a decoding profile supported by a hardware decoder. // Specification of a decoding profile supported by a hardware decoder.
struct GPU_EXPORT VideoDecodeAcceleratorSupportedProfile struct VideoDecodeAcceleratorSupportedProfile
{ {
VideoCodecProfile profile; VideoCodecProfile profile;
gfx::Size max_resolution; gfx::Size max_resolution;
...@@ -92,7 +95,7 @@ struct GPU_EXPORT VideoDecodeAcceleratorSupportedProfile ...@@ -92,7 +95,7 @@ struct GPU_EXPORT VideoDecodeAcceleratorSupportedProfile
using VideoDecodeAcceleratorSupportedProfiles = std::vector<VideoDecodeAcceleratorSupportedProfile>; using VideoDecodeAcceleratorSupportedProfiles = std::vector<VideoDecodeAcceleratorSupportedProfile>;
struct GPU_EXPORT VideoDecodeAcceleratorCapabilities struct VideoDecodeAcceleratorCapabilities
{ {
VideoDecodeAcceleratorCapabilities(); VideoDecodeAcceleratorCapabilities();
VideoDecodeAcceleratorCapabilities(const VideoDecodeAcceleratorCapabilities &other); VideoDecodeAcceleratorCapabilities(const VideoDecodeAcceleratorCapabilities &other);
...@@ -102,7 +105,7 @@ struct GPU_EXPORT VideoDecodeAcceleratorCapabilities ...@@ -102,7 +105,7 @@ struct GPU_EXPORT VideoDecodeAcceleratorCapabilities
}; };
// Specification of an encoding profile supported by a hardware encoder. // Specification of an encoding profile supported by a hardware encoder.
struct GPU_EXPORT VideoEncodeAcceleratorSupportedProfile struct VideoEncodeAcceleratorSupportedProfile
{ {
VideoCodecProfile profile; VideoCodecProfile profile;
gfx::Size max_resolution; gfx::Size max_resolution;
...@@ -126,7 +129,7 @@ enum class ImageDecodeAcceleratorSubsampling ...@@ -126,7 +129,7 @@ enum class ImageDecodeAcceleratorSubsampling
}; };
// Specification of an image decoding profile supported by a hardware decoder. // Specification of an image decoding profile supported by a hardware decoder.
struct GPU_EXPORT ImageDecodeAcceleratorSupportedProfile struct ImageDecodeAcceleratorSupportedProfile
{ {
ImageDecodeAcceleratorSupportedProfile(); ImageDecodeAcceleratorSupportedProfile();
ImageDecodeAcceleratorSupportedProfile(const ImageDecodeAcceleratorSupportedProfile &other); ImageDecodeAcceleratorSupportedProfile(const ImageDecodeAcceleratorSupportedProfile &other);
...@@ -150,7 +153,7 @@ struct GPU_EXPORT ImageDecodeAcceleratorSupportedProfile ...@@ -150,7 +153,7 @@ struct GPU_EXPORT ImageDecodeAcceleratorSupportedProfile
}; };
using ImageDecodeAcceleratorSupportedProfiles = std::vector<ImageDecodeAcceleratorSupportedProfile>; using ImageDecodeAcceleratorSupportedProfiles = std::vector<ImageDecodeAcceleratorSupportedProfile>;
#if defined(OS_WIN) #if defined(ANGLE_PLATFORM_WINDOWS)
// Common overlay formats that we're interested in. Must match the OverlayFormat // Common overlay formats that we're interested in. Must match the OverlayFormat
// enum in //tools/metrics/histograms/enums.xml. Mapped to corresponding DXGI // enum in //tools/metrics/histograms/enums.xml. Mapped to corresponding DXGI
// formats in DirectCompositionSurfaceWin. // formats in DirectCompositionSurfaceWin.
...@@ -162,9 +165,9 @@ enum class OverlayFormat ...@@ -162,9 +165,9 @@ enum class OverlayFormat
kMaxValue = kNV12 kMaxValue = kNV12
}; };
GPU_EXPORT const char *OverlayFormatToString(OverlayFormat format); const char *OverlayFormatToString(OverlayFormat format);
struct GPU_EXPORT OverlayCapability struct OverlayCapability
{ {
OverlayFormat format; OverlayFormat format;
bool is_scaling_supported; bool is_scaling_supported;
...@@ -172,7 +175,7 @@ struct GPU_EXPORT OverlayCapability ...@@ -172,7 +175,7 @@ struct GPU_EXPORT OverlayCapability
}; };
using OverlayCapabilities = std::vector<OverlayCapability>; using OverlayCapabilities = std::vector<OverlayCapability>;
struct GPU_EXPORT Dx12VulkanVersionInfo struct Dx12VulkanVersionInfo
{ {
bool IsEmpty() const { return !d3d12_feature_level && !vulkan_version; } bool IsEmpty() const { return !d3d12_feature_level && !vulkan_version; }
...@@ -190,9 +193,9 @@ struct GPU_EXPORT Dx12VulkanVersionInfo ...@@ -190,9 +193,9 @@ struct GPU_EXPORT Dx12VulkanVersionInfo
}; };
#endif #endif
struct GPU_EXPORT GPUInfo struct GPUInfo
{ {
struct GPU_EXPORT GPUDevice struct GPUDevice
{ {
GPUDevice(); GPUDevice();
GPUDevice(const GPUDevice &other); GPUDevice(const GPUDevice &other);
...@@ -240,7 +243,7 @@ struct GPU_EXPORT GPUInfo ...@@ -240,7 +243,7 @@ struct GPU_EXPORT GPUInfo
// The amount of time taken to get from the process starting to the message // The amount of time taken to get from the process starting to the message
// loop being pumped. // loop being pumped.
base::TimeDelta initialization_time; int64_t initialization_time;
// Computer has NVIDIA Optimus // Computer has NVIDIA Optimus
bool optimus; bool optimus;
...@@ -321,7 +324,7 @@ struct GPU_EXPORT GPUInfo ...@@ -321,7 +324,7 @@ struct GPU_EXPORT GPUInfo
// is only implemented on Android. // is only implemented on Android.
bool can_support_threaded_texture_mailbox = false; bool can_support_threaded_texture_mailbox = false;
#if defined(OS_WIN) #if defined(ANGLE_PLATFORM_WINDOWS)
// True if we use direct composition surface on Windows. // True if we use direct composition surface on Windows.
bool direct_composition = false; bool direct_composition = false;
...@@ -363,11 +366,11 @@ struct GPU_EXPORT GPUInfo ...@@ -363,11 +366,11 @@ struct GPU_EXPORT GPUInfo
// is the root object, but calls to BeginGPUDevice/EndGPUDevice and // is the root object, but calls to BeginGPUDevice/EndGPUDevice and
// BeginAuxAttributes/EndAuxAttributes change the object to which these // BeginAuxAttributes/EndAuxAttributes change the object to which these
// calls should apply. // calls should apply.
virtual void AddInt64(const char *name, int64_t value) = 0; virtual void AddInt64(const char *name, int64_t value) = 0;
virtual void AddInt(const char *name, int value) = 0; virtual void AddInt(const char *name, int value) = 0;
virtual void AddString(const char *name, const std::string &value) = 0; virtual void AddString(const char *name, const std::string &value) = 0;
virtual void AddBool(const char *name, bool value) = 0; virtual void AddBool(const char *name, bool value) = 0;
virtual void AddTimeDeltaInSecondsF(const char *name, const base::TimeDelta &value) = 0; virtual void AddTimeDeltaInSeconds(const char *name, const int64_t &value) = 0;
// Markers indicating that a GPUDevice is being described. // Markers indicating that a GPUDevice is being described.
virtual void BeginGPUDevice() = 0; virtual void BeginGPUDevice() = 0;
...@@ -407,6 +410,6 @@ struct GPU_EXPORT GPUInfo ...@@ -407,6 +410,6 @@ struct GPU_EXPORT GPUInfo
void EnumerateFields(Enumerator *enumerator) const; void EnumerateFields(Enumerator *enumerator) const;
}; };
} // namespace gpu } // namespace angle
#endif // ANGLE_GPU_CONFIG_GPU_INFO_H_ #endif // TEST_EXPECTATIONS_GPU_INFO_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. //#if
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
//
#include "gpu_test_config.h" #include "GPUTestConfig.h"
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include "gpu_info.h" #include "GPUInfo.h"
#include "gpu_test_expectations_parser.h" #include "GPUTestExpectationsParser.h"
#if defined(OS_MACOSX) #if defined(ANGLE_PLATFORM_APPLE)
# include "gpu_test_config_mac.h" # include "GPUTestConfig_mac.h"
#endif #endif
#if !defined(OS_ANDROID) #if !defined(ANGLE_PLATFORM_ANDROID)
# include "gpu_info_util/SystemInfo.h" # include "gpu_info_util/SystemInfo.h"
#endif #endif
#if defined(OS_WIN) #if defined(ANGLE_PLATFORM_WINDOWS)
namespace base namespace base
{ {
...@@ -51,9 +54,9 @@ void SysInfo::OperatingSystemVersionNumbers(int32_t *major_version, ...@@ -51,9 +54,9 @@ void SysInfo::OperatingSystemVersionNumbers(int32_t *major_version,
} // anonymous namespace } // anonymous namespace
} // namespace base } // namespace base
#endif // defined(OS_WIN) #endif // defined(ANGLE_PLATFORM_WINDOWS)
namespace gpu namespace angle
{ {
namespace namespace
...@@ -61,11 +64,9 @@ namespace ...@@ -61,11 +64,9 @@ namespace
GPUTestConfig::OS GetCurrentOS() GPUTestConfig::OS GetCurrentOS()
{ {
#if defined(OS_CHROMEOS) #if defined(ANGLE_PLATFORM_LINUX)
return GPUTestConfig::kOsChromeOS;
#elif defined(OS_LINUX) || defined(OS_OPENBSD)
return GPUTestConfig::kOsLinux; return GPUTestConfig::kOsLinux;
#elif defined(OS_WIN) #elif defined(ANGLE_PLATFORM_WINDOWS)
int32_t major_version = 0; int32_t major_version = 0;
int32_t minor_version = 0; int32_t minor_version = 0;
int32_t bugfix_version = 0; int32_t bugfix_version = 0;
...@@ -80,7 +81,7 @@ GPUTestConfig::OS GetCurrentOS() ...@@ -80,7 +81,7 @@ GPUTestConfig::OS GetCurrentOS()
return GPUTestConfig::kOsWin8; return GPUTestConfig::kOsWin8;
if (major_version == 10) if (major_version == 10)
return GPUTestConfig::kOsWin10; return GPUTestConfig::kOsWin10;
#elif defined(OS_MACOSX) #elif defined(ANGLE_PLATFORM_APPLE)
int32_t major_version = 0; int32_t major_version = 0;
int32_t minor_version = 0; int32_t minor_version = 0;
int32_t bugfix_version = 0; int32_t bugfix_version = 0;
...@@ -111,15 +112,15 @@ GPUTestConfig::OS GetCurrentOS() ...@@ -111,15 +112,15 @@ GPUTestConfig::OS GetCurrentOS()
return GPUTestConfig::kOsMacMojave; return GPUTestConfig::kOsMacMojave;
} }
} }
#elif defined(OS_ANDROID) #elif defined(ANGLE_PLATFORM_ANDROID)
return GPUTestConfig::kOsAndroid; return GPUTestConfig::kOsAndroid;
#elif defined(OS_FUCHSIA) #elif defined(ANGLE_PLATFORM_FUCHSIA)
return GPUTestConfig::kOsFuchsia; return GPUTestConfig::kOsFuchsia;
#endif #endif
return GPUTestConfig::kOsUnknown; return GPUTestConfig::kOsUnknown;
} }
#if !defined(OS_ANDROID) #if !defined(ANGLE_PLATFORM_ANDROID)
bool CollectBasicGraphicsInfo(GPUInfo *gpu_info) bool CollectBasicGraphicsInfo(GPUInfo *gpu_info)
{ {
angle::SystemInfo info; angle::SystemInfo info;
...@@ -141,7 +142,7 @@ bool CollectBasicGraphicsInfo(GPUInfo *gpu_info) ...@@ -141,7 +142,7 @@ bool CollectBasicGraphicsInfo(GPUInfo *gpu_info)
gpu_info->gpu.active = true; gpu_info->gpu.active = true;
return false; return false;
} }
#endif // defined(OS_ANDROID) #endif // defined(ANGLE_PLATFORM_ANDROID)
} // namespace } // namespace
GPUTestConfig::GPUTestConfig() GPUTestConfig::GPUTestConfig()
...@@ -158,15 +159,15 @@ GPUTestConfig::~GPUTestConfig() = default; ...@@ -158,15 +159,15 @@ GPUTestConfig::~GPUTestConfig() = default;
void GPUTestConfig::set_os(int32_t os) void GPUTestConfig::set_os(int32_t os)
{ {
DCHECK_EQ(0, os & ~(kOsAndroid | kOsWin | kOsMac | kOsLinux | kOsChromeOS | kOsFuchsia)); ASSERT((0) == (os & ~(kOsAndroid | kOsWin | kOsMac | kOsLinux | kOsFuchsia)));
os_ = os; os_ = os;
} }
void GPUTestConfig::AddGPUVendor(uint32_t gpu_vendor) void GPUTestConfig::AddGPUVendor(uint32_t gpu_vendor)
{ {
DCHECK_NE(0u, gpu_vendor); ASSERT((0u) != (gpu_vendor));
for (size_t i = 0; i < gpu_vendor_.size(); ++i) for (size_t i = 0; i < gpu_vendor_.size(); ++i)
DCHECK_NE(gpu_vendor_[i], gpu_vendor); ASSERT((gpu_vendor_[i]) != (gpu_vendor));
gpu_vendor_.push_back(gpu_vendor); gpu_vendor_.push_back(gpu_vendor);
} }
...@@ -177,13 +178,13 @@ void GPUTestConfig::set_gpu_device_id(uint32_t id) ...@@ -177,13 +178,13 @@ void GPUTestConfig::set_gpu_device_id(uint32_t id)
void GPUTestConfig::set_build_type(int32_t build_type) void GPUTestConfig::set_build_type(int32_t build_type)
{ {
DCHECK_EQ(0, build_type & ~(kBuildTypeRelease | kBuildTypeDebug)); ASSERT((0) == (build_type & ~(kBuildTypeRelease | kBuildTypeDebug)));
build_type_ = build_type; build_type_ = build_type;
} }
void GPUTestConfig::set_api(int32_t api) void GPUTestConfig::set_api(int32_t api)
{ {
DCHECK_EQ(0, api & ~(kAPID3D9 | kAPID3D11 | kAPIGLDesktop | kAPIGLES | kAPIVulkan)); ASSERT((0) == (api & ~(kAPID3D9 | kAPID3D11 | kAPIGLDesktop | kAPIGLES | kAPIVulkan)));
api_ = api; api_ = api;
} }
...@@ -198,8 +199,8 @@ bool GPUTestConfig::IsValid() const ...@@ -198,8 +199,8 @@ bool GPUTestConfig::IsValid() const
bool GPUTestConfig::OverlapsWith(const GPUTestConfig &config) const bool GPUTestConfig::OverlapsWith(const GPUTestConfig &config) const
{ {
DCHECK(IsValid()); ASSERT(IsValid());
DCHECK(config.IsValid()); ASSERT(config.IsValid());
if (config.os_ != kOsUnknown && os_ != kOsUnknown && (os_ & config.os_) == 0) if (config.os_ != kOsUnknown && os_ != kOsUnknown && (os_ & config.os_) == 0)
return false; return false;
if (config.gpu_vendor_.size() > 0 && gpu_vendor_.size() > 0) if (config.gpu_vendor_.size() > 0 && gpu_vendor_.size() > 0)
...@@ -244,13 +245,13 @@ GPUTestBotConfig::~GPUTestBotConfig() = default; ...@@ -244,13 +245,13 @@ GPUTestBotConfig::~GPUTestBotConfig() = default;
void GPUTestBotConfig::AddGPUVendor(uint32_t gpu_vendor) void GPUTestBotConfig::AddGPUVendor(uint32_t gpu_vendor)
{ {
DCHECK_EQ(0u, GPUTestConfig::gpu_vendor().size()); ASSERT((0u) == (GPUTestConfig::gpu_vendor().size()));
GPUTestConfig::AddGPUVendor(gpu_vendor); GPUTestConfig::AddGPUVendor(gpu_vendor);
} }
bool GPUTestBotConfig::SetGPUInfo(const GPUInfo &gpu_info) bool GPUTestBotConfig::SetGPUInfo(const GPUInfo &gpu_info)
{ {
DCHECK(validate_gpu_info_); ASSERT(validate_gpu_info_);
if (gpu_info.gpu.device_id == 0 || gpu_info.gpu.vendor_id == 0) if (gpu_info.gpu.device_id == 0 || gpu_info.gpu.vendor_id == 0)
return false; return false;
ClearGPUVendor(); ClearGPUVendor();
...@@ -279,7 +280,6 @@ bool GPUTestBotConfig::IsValid() const ...@@ -279,7 +280,6 @@ bool GPUTestBotConfig::IsValid() const
case kOsMacHighSierra: case kOsMacHighSierra:
case kOsMacMojave: case kOsMacMojave:
case kOsLinux: case kOsLinux:
case kOsChromeOS:
case kOsAndroid: case kOsAndroid:
case kOsFuchsia: case kOsFuchsia:
break; break;
...@@ -306,8 +306,8 @@ bool GPUTestBotConfig::IsValid() const ...@@ -306,8 +306,8 @@ bool GPUTestBotConfig::IsValid() const
bool GPUTestBotConfig::Matches(const GPUTestConfig &config) const bool GPUTestBotConfig::Matches(const GPUTestConfig &config) const
{ {
DCHECK(IsValid()); ASSERT(IsValid());
DCHECK(config.IsValid()); ASSERT(config.IsValid());
if (config.os() != kOsUnknown && (os() & config.os()) == 0) if (config.os() != kOsUnknown && (os() & config.os()) == 0)
return false; return false;
if (config.gpu_vendor().size() > 0) if (config.gpu_vendor().size() > 0)
...@@ -351,7 +351,7 @@ bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo *gpu_info) ...@@ -351,7 +351,7 @@ bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo *gpu_info)
GPUInfo my_gpu_info; GPUInfo my_gpu_info;
if (!CollectBasicGraphicsInfo(&my_gpu_info)) if (!CollectBasicGraphicsInfo(&my_gpu_info))
{ {
LOG(ERROR) << "Fail to identify GPU\n"; std::cerr << "Fail to identify GPU\n";
DisableGPUInfoValidation(); DisableGPUInfoValidation();
rt = true; rt = true;
} }
...@@ -367,7 +367,7 @@ bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo *gpu_info) ...@@ -367,7 +367,7 @@ bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo *gpu_info)
set_os(GetCurrentOS()); set_os(GetCurrentOS());
if (os() == kOsUnknown) if (os() == kOsUnknown)
{ {
LOG(ERROR) << "Unknown OS\n"; std::cerr << "Unknown OS\n";
rt = false; rt = false;
} }
#if defined(NDEBUG) #if defined(NDEBUG)
...@@ -407,4 +407,4 @@ bool GPUTestBotConfig::GpuBlacklistedOnBot() ...@@ -407,4 +407,4 @@ bool GPUTestBotConfig::GpuBlacklistedOnBot()
return false; return false;
} }
} // namespace gpu } // namespace angle
// Copyright (c) 2012 The Chromium Authors. All rights reserved. //
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
//
#ifndef ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_ #ifndef TEST_EXPECTATIONS_GPU_TEST_CONFIG_H_
#define ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_ #define TEST_EXPECTATIONS_GPU_TEST_CONFIG_H_
#include <stdint.h> #include <stdint.h>
#include <iostream> #include <iostream>
...@@ -11,33 +13,9 @@ ...@@ -11,33 +13,9 @@
#include <vector> #include <vector>
#include "common/debug.h" #include "common/debug.h"
#include "common/platform.h"
#include "common/string_utils.h" #include "common/string_utils.h"
#define DCHECK_EQ(A, B) ASSERT((A) == (B))
#define DCHECK_NE(A, B) ASSERT((A) != (B))
#define DCHECK(X) ASSERT(X)
#define DLOG(X) std::cerr
#define DVLOG(X) std::cerr
#define LOG(X) std::cerr
#define GPU_EXPORT
// Shim Chromium's types by importing symbols in the correct namespaces
namespace base
{
using angle::HexStringToUInt;
using angle::KEEP_WHITESPACE;
using angle::kWhitespaceASCII;
using angle::ReadFileToString;
using angle::SPLIT_WANT_ALL;
using angle::SPLIT_WANT_NONEMPTY;
using angle::SplitString;
using angle::SplitStringAlongWhitespace;
using angle::TRIM_WHITESPACE;
using TimeDelta = int;
} // namespace base
namespace gfx namespace gfx
{ {
class Size class Size
...@@ -52,29 +30,12 @@ class Size ...@@ -52,29 +30,12 @@ class Size
struct DxDiagNode struct DxDiagNode
{}; {};
// TODO(jmadill): other platforms namespace angle
// clang-format off
#if defined(_WIN32) || defined(_WIN64)
# define OS_WIN
#elif defined(ANDROID)
# define OS_ANDROID
#elif defined(__linux__)
# define OS_LINUX
#elif defined(__APPLE__)
# define OS_MACOSX
#elif defined(__Fuchsia__)
# define OS_FUCHSIA
#else
# error "Unsupported platform"
#endif
// clang-format on
namespace gpu
{ {
struct GPUInfo; struct GPUInfo;
class GPU_EXPORT GPUTestConfig class GPUTestConfig
{ {
public: public:
enum OS enum OS
...@@ -174,7 +135,7 @@ class GPU_EXPORT GPUTestConfig ...@@ -174,7 +135,7 @@ class GPU_EXPORT GPUTestConfig
int32_t api_; int32_t api_;
}; };
class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig class GPUTestBotConfig : public GPUTestConfig
{ {
public: public:
GPUTestBotConfig() = default; GPUTestBotConfig() = default;
...@@ -208,6 +169,6 @@ class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig ...@@ -208,6 +169,6 @@ class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig
static bool GpuBlacklistedOnBot(); static bool GpuBlacklistedOnBot();
}; };
} // namespace gpu } // namespace angle
#endif // ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_ #endif // TEST_EXPECTATIONS_GPU_TEST_CONFIG_H_
// //
// Copyright 2015 The ANGLE Project Authors. All rights reserved. // Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
// gpu_test_config_mac.h: // GPUTestConfig_mac.h:
// Helper functions for gpu_test_config that have to be compiled in ObjectiveC++ // Helper functions for GPUTestConfig that have to be compiled in ObjectiveC++
// //
#ifndef ANGLE_GPU_TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_ #ifndef TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_
#define ANGLE_GPU_TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_ #define TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_
#include "gpu_info.h" #include "GPUInfo.h"
namespace angle namespace angle
{ {
...@@ -21,4 +21,4 @@ void GetOperatingSystemVersionNumbers(int32_t *major_version, ...@@ -21,4 +21,4 @@ void GetOperatingSystemVersionNumbers(int32_t *major_version,
} // namespace angle } // namespace angle
#endif // ANGLE_GPU_TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_ #endif // TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. //
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
//
// gpu_test_config_mac.mm: // GPUTestConfig_mac.mm:
// Helper functions for gpu_test_config that have to be compiled in ObjectiveC++ // Helper functions for gpu_test_config that have to be compiled in ObjectiveC++
#include "gpu_test_config_mac.h" #include "GPUTestConfig_mac.h"
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved. //
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
//
#include "gpu_test_expectations_parser.h" #include "GPUTestExpectationsParser.h"
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
...@@ -47,7 +49,7 @@ bool LowerCaseEqualsASCII(const std::string &a, const char *b) ...@@ -47,7 +49,7 @@ bool LowerCaseEqualsASCII(const std::string &a, const char *b)
} // namespace base } // namespace base
namespace gpu namespace angle
{ {
namespace namespace
...@@ -230,10 +232,10 @@ bool NamesMatching(const std::string &ref, const std::string &test_name) ...@@ -230,10 +232,10 @@ bool NamesMatching(const std::string &ref, const std::string &test_name)
GPUTestExpectationsParser::GPUTestExpectationsParser() GPUTestExpectationsParser::GPUTestExpectationsParser()
{ {
// Some sanity check. // Some sanity check.
DCHECK_EQ(static_cast<unsigned int>(kNumberOfExactMatchTokens), ASSERT((static_cast<unsigned int>(kNumberOfExactMatchTokens)) ==
sizeof(kTokenData) / sizeof(kTokenData[0])); (sizeof(kTokenData) / sizeof(kTokenData[0])));
DCHECK_EQ(static_cast<unsigned int>(kNumberOfErrors), ASSERT((static_cast<unsigned int>(kNumberOfErrors)) ==
sizeof(kErrorMessage) / sizeof(kErrorMessage[0])); (sizeof(kErrorMessage) / sizeof(kErrorMessage[0])));
} }
GPUTestExpectationsParser::~GPUTestExpectationsParser() = default; GPUTestExpectationsParser::~GPUTestExpectationsParser() = default;
...@@ -243,9 +245,8 @@ bool GPUTestExpectationsParser::LoadTestExpectations(const std::string &data) ...@@ -243,9 +245,8 @@ bool GPUTestExpectationsParser::LoadTestExpectations(const std::string &data)
entries_.clear(); entries_.clear();
error_messages_.clear(); error_messages_.clear();
std::vector<std::string> lines = std::vector<std::string> lines = SplitString(data, "\n", TRIM_WHITESPACE, SPLIT_WANT_ALL);
base::SplitString(data, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); bool rt = true;
bool rt = true;
for (size_t i = 0; i < lines.size(); ++i) for (size_t i = 0; i < lines.size(); ++i)
{ {
if (!ParseLine(lines[i], i + 1)) if (!ParseLine(lines[i], i + 1))
...@@ -266,7 +267,7 @@ bool GPUTestExpectationsParser::LoadTestExpectationsFromFile(const std::string & ...@@ -266,7 +267,7 @@ bool GPUTestExpectationsParser::LoadTestExpectationsFromFile(const std::string &
error_messages_.clear(); error_messages_.clear();
std::string data; std::string data;
if (!base::ReadFileToString(path, &data)) if (!ReadFileToString(path, &data))
{ {
error_messages_.push_back(kErrorMessage[kErrorFileIO]); error_messages_.push_back(kErrorMessage[kErrorFileIO]);
return false; return false;
...@@ -293,9 +294,9 @@ const std::vector<std::string> &GPUTestExpectationsParser::GetErrorMessages() co ...@@ -293,9 +294,9 @@ const std::vector<std::string> &GPUTestExpectationsParser::GetErrorMessages() co
bool GPUTestExpectationsParser::ParseConfig(const std::string &config_data, GPUTestConfig *config) bool GPUTestExpectationsParser::ParseConfig(const std::string &config_data, GPUTestConfig *config)
{ {
DCHECK(config); ASSERT(config);
std::vector<std::string> tokens = base::SplitString( std::vector<std::string> tokens =
config_data, base::kWhitespaceASCII, base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); SplitString(config_data, kWhitespaceASCII, KEEP_WHITESPACE, SPLIT_WANT_NONEMPTY);
for (size_t i = 0; i < tokens.size(); ++i) for (size_t i = 0; i < tokens.size(); ++i)
{ {
...@@ -354,8 +355,8 @@ bool GPUTestExpectationsParser::ParseConfig(const std::string &config_data, GPUT ...@@ -354,8 +355,8 @@ bool GPUTestExpectationsParser::ParseConfig(const std::string &config_data, GPUT
bool GPUTestExpectationsParser::ParseLine(const std::string &line_data, size_t line_number) bool GPUTestExpectationsParser::ParseLine(const std::string &line_data, size_t line_number)
{ {
std::vector<std::string> tokens = base::SplitString( std::vector<std::string> tokens =
line_data, base::kWhitespaceASCII, base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); SplitString(line_data, kWhitespaceASCII, KEEP_WHITESPACE, SPLIT_WANT_NONEMPTY);
int32_t stage = kLineParserBegin; int32_t stage = kLineParserBegin;
GPUTestExpectationEntry entry; GPUTestExpectationEntry entry;
entry.line_number = line_number; entry.line_number = line_number;
...@@ -477,7 +478,7 @@ bool GPUTestExpectationsParser::ParseLine(const std::string &line_data, size_t l ...@@ -477,7 +478,7 @@ bool GPUTestExpectationsParser::ParseLine(const std::string &line_data, size_t l
stage++; stage++;
break; break;
default: default:
DCHECK(false); ASSERT(false);
break; break;
} }
} }
...@@ -504,7 +505,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig(GPUTestConfig *config, ...@@ -504,7 +505,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig(GPUTestConfig *config,
int32_t token, int32_t token,
size_t line_number) size_t line_number)
{ {
DCHECK(config); ASSERT(config);
switch (token) switch (token)
{ {
case kConfigWinXP: case kConfigWinXP:
...@@ -573,7 +574,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig(GPUTestConfig *config, ...@@ -573,7 +574,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig(GPUTestConfig *config,
config->set_api(config->api() | kTokenData[token].flag); config->set_api(config->api() | kTokenData[token].flag);
break; break;
default: default:
DCHECK(false); ASSERT(false);
break; break;
} }
return true; return true;
...@@ -583,9 +584,9 @@ bool GPUTestExpectationsParser::UpdateTestConfig(GPUTestConfig *config, ...@@ -583,9 +584,9 @@ bool GPUTestExpectationsParser::UpdateTestConfig(GPUTestConfig *config,
const std::string &gpu_device_id, const std::string &gpu_device_id,
size_t line_number) size_t line_number)
{ {
DCHECK(config); ASSERT(config);
uint32_t device_id = 0; uint32_t device_id = 0;
if (config->gpu_device_id() != 0 || !base::HexStringToUInt(gpu_device_id, &device_id) || if (config->gpu_device_id() != 0 || !HexStringToUInt(gpu_device_id, &device_id) ||
device_id == 0) device_id == 0)
{ {
PushErrorMessage(kErrorMessage[kErrorEntryWithGpuDeviceIdConflicts], line_number); PushErrorMessage(kErrorMessage[kErrorEntryWithGpuDeviceIdConflicts], line_number);
...@@ -631,4 +632,4 @@ GPUTestExpectationsParser::GPUTestExpectationEntry::GPUTestExpectationEntry() ...@@ -631,4 +632,4 @@ GPUTestExpectationsParser::GPUTestExpectationEntry::GPUTestExpectationEntry()
: test_expectation(0), line_number(0) : test_expectation(0), line_number(0)
{} {}
} // namespace gpu } // namespace angle
// Copyright (c) 2012 The Chromium Authors. All rights reserved. //
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
//
#ifndef ANGLE_GPU_CONFIG_GPU_TEST_EXPECTATIONS_PARSER_H_ #ifndef TEST_EXPECTATIONS_GPU_TEST_EXPECTATIONS_PARSER_H_
#define ANGLE_GPU_CONFIG_GPU_TEST_EXPECTATIONS_PARSER_H_ #define TEST_EXPECTATIONS_GPU_TEST_EXPECTATIONS_PARSER_H_
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
...@@ -11,12 +13,12 @@ ...@@ -11,12 +13,12 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "gpu_test_config.h" #include "GPUTestConfig.h"
namespace gpu namespace angle
{ {
class GPU_EXPORT GPUTestExpectationsParser class GPUTestExpectationsParser
{ {
public: public:
enum GPUTestExpectation enum GPUTestExpectation
...@@ -85,6 +87,6 @@ class GPU_EXPORT GPUTestExpectationsParser ...@@ -85,6 +87,6 @@ class GPU_EXPORT GPUTestExpectationsParser
std::vector<std::string> error_messages_; std::vector<std::string> error_messages_;
}; };
} // namespace gpu } // namespace angle
#endif // ANGLE_GPU_CONFIG_GPU_TEST_EXPECTATIONS_PARSER_H_ #endif // TEST_EXPECTATIONS_GPU_TEST_EXPECTATIONS_PARSER_H_
Because the ```gpu_test_expectations``` directory is based on parts of Chromium's ```gpu/config```
directory, we want to keep a patch of the changes added to make it compile with ANGLE. This
will allow us to merge Chromium changes easily in our ```gpu_test_expectations```.
In order to make a change to this directory, do the following:
* copy the directory somewhere like in ```gpu_test_expectations_reverted```
* in ```gpu_test_expectations_reverted``` run ```patch -p 1 -R < angle-mods.patch```
* do your changes in ```gpu_test_expectations```
* delete angle-mods.patch in both directories
* run ```diff -rupN gpu_test_expectations_reverted gpu_test_expectations > angle-mods.patch```
* copy ```angle-mods.patch``` in ```gpu_test_expectations```
How to update from Chromium:
* ```git apply -R angle-mods.patch```, ```git add . -u```, ```git commit```
* Copy over Chromium files, ```git add . -u```, ```git commit```
* ```git revert HEAD~```
* ```rm angle-mods.patch```
* ```git diff HEAD~ (`)ls(`) > angle-mods.patch```,```git add angle-mods.patch```, ```git commit --amend```
* ```git rebase -i``` to squash the three patches into one.
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