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 = [
"$_deqp_path/framework/platform/android/tcuAndroidInternals.hpp",
]
deqp_test_expectations_sources = [
"test_expectations/gpu_info.cpp",
"test_expectations/gpu_info.h",
"test_expectations/gpu_test_config.cpp",
"test_expectations/gpu_test_config.h",
"test_expectations/gpu_test_expectations_parser.cpp",
"test_expectations/gpu_test_expectations_parser.h",
"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/gpu_test_config_mac.mm",
"test_expectations/gpu_test_config_mac.h",
"test_expectations/GPUTestConfig_mac.mm",
"test_expectations/GPUTestConfig_mac.h",
]
......@@ -20,11 +20,15 @@
#include "common/platform.h"
#include "common/string_utils.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"
namespace angle
{
namespace
{
bool gGlobalError = false;
bool gExpectError = false;
......@@ -81,15 +85,15 @@ const char *gTestExpectationsFiles[] = {
"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[] = {
{"angle-d3d9", gpu::GPUTestConfig::kAPID3D9},
{"angle-d3d11", gpu::GPUTestConfig::kAPID3D11},
{"angle-gl", gpu::GPUTestConfig::kAPIGLDesktop},
{"angle-gles", gpu::GPUTestConfig::kAPIGLES},
{"angle-null", gpu::GPUTestConfig::kAPIUnknown},
{"angle-vulkan", gpu::GPUTestConfig::kAPIVulkan},
{"angle-d3d9", angle::GPUTestConfig::kAPID3D9},
{"angle-d3d11", angle::GPUTestConfig::kAPID3D11},
{"angle-gl", angle::GPUTestConfig::kAPIGLDesktop},
{"angle-gles", angle::GPUTestConfig::kAPIGLES},
{"angle-null", angle::GPUTestConfig::kAPIUnknown},
{"angle-vulkan", angle::GPUTestConfig::kAPIVulkan},
};
const char *gdEQPEGLString = "--deqp-egl-display-type=";
......@@ -213,8 +217,8 @@ class dEQPCaseList
private:
std::vector<CaseInfo> mCaseInfoList;
gpu::GPUTestExpectationsParser mTestExpectationsParser;
gpu::GPUTestBotConfig mTestConfig;
angle::GPUTestExpectationsParser mTestExpectationsParser;
angle::GPUTestBotConfig mTestConfig;
size_t mTestModuleIndex;
bool mInitialized;
};
......@@ -296,7 +300,7 @@ void dEQPCaseList::initialize()
continue;
int expectation = mTestExpectationsParser.GetTestExpectation(dEQPName, mTestConfig);
if (expectation != gpu::GPUTestExpectationsParser::kGpuTestSkip)
if (expectation != angle::GPUTestExpectationsParser::kGpuTestSkip)
{
mCaseInfoList.push_back(CaseInfo(dEQPName, gTestName, expectation));
}
......@@ -357,7 +361,7 @@ class dEQPTest : public testing::TestWithParam<size_t>
const auto &caseInfo = GetCaseList().getCaseInfo(GetParam());
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());
bool testPassed = TestPassed(result);
......@@ -369,7 +373,7 @@ class dEQPTest : public testing::TestWithParam<size_t>
gGlobalError = false;
}
if (caseInfo.mExpectation == gpu::GPUTestExpectationsParser::kGpuTestPass)
if (caseInfo.mExpectation == angle::GPUTestExpectationsParser::kGpuTestPass)
{
EXPECT_TRUE(testPassed);
sPasses += (testPassed ? 1u : 0u);
......@@ -548,8 +552,6 @@ void DeleteArg(int *argc, int argIndex, char **argv)
} // anonymous namespace
// Called from main() to process command-line arguments.
namespace angle
{
void InitTestHarness(int *argc, char **argv)
{
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
// found in the LICENSE file.
//
#include <stdint.h>
#include "gpu_info.h"
#include "GPUInfo.h"
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->AddInt("vendorId", device.vendor_id);
......@@ -25,8 +28,8 @@ void EnumerateGPUDevice(const gpu::GPUInfo::GPUDevice &device, gpu::GPUInfo::Enu
}
void EnumerateVideoDecodeAcceleratorSupportedProfile(
const gpu::VideoDecodeAcceleratorSupportedProfile &profile,
gpu::GPUInfo::Enumerator *enumerator)
const angle::VideoDecodeAcceleratorSupportedProfile &profile,
angle::GPUInfo::Enumerator *enumerator)
{
enumerator->BeginVideoDecodeAcceleratorSupportedProfile();
enumerator->AddInt("profile", profile.profile);
......@@ -39,8 +42,8 @@ void EnumerateVideoDecodeAcceleratorSupportedProfile(
}
void EnumerateVideoEncodeAcceleratorSupportedProfile(
const gpu::VideoEncodeAcceleratorSupportedProfile &profile,
gpu::GPUInfo::Enumerator *enumerator)
const angle::VideoEncodeAcceleratorSupportedProfile &profile,
angle::GPUInfo::Enumerator *enumerator)
{
enumerator->BeginVideoEncodeAcceleratorSupportedProfile();
enumerator->AddInt("profile", profile.profile);
......@@ -51,32 +54,32 @@ void EnumerateVideoEncodeAcceleratorSupportedProfile(
enumerator->EndVideoEncodeAcceleratorSupportedProfile();
}
const char *ImageDecodeAcceleratorTypeToString(gpu::ImageDecodeAcceleratorType type)
const char *ImageDecodeAcceleratorTypeToString(angle::ImageDecodeAcceleratorType type)
{
switch (type)
{
case gpu::ImageDecodeAcceleratorType::kJpeg:
case angle::ImageDecodeAcceleratorType::kJpeg:
return "JPEG";
case gpu::ImageDecodeAcceleratorType::kUnknown:
case angle::ImageDecodeAcceleratorType::kUnknown:
return "Unknown";
}
}
const char *ImageDecodeAcceleratorSubsamplingToString(
gpu::ImageDecodeAcceleratorSubsampling subsampling)
angle::ImageDecodeAcceleratorSubsampling subsampling)
{
switch (subsampling)
{
case gpu::ImageDecodeAcceleratorSubsampling::k420:
case angle::ImageDecodeAcceleratorSubsampling::k420:
return "4:2:0";
case gpu::ImageDecodeAcceleratorSubsampling::k422:
case angle::ImageDecodeAcceleratorSubsampling::k422:
return "4:2:2";
}
}
void EnumerateImageDecodeAcceleratorSupportedProfile(
const gpu::ImageDecodeAcceleratorSupportedProfile &profile,
gpu::GPUInfo::Enumerator *enumerator)
const angle::ImageDecodeAcceleratorSupportedProfile &profile,
angle::GPUInfo::Enumerator *enumerator)
{
enumerator->BeginImageDecodeAcceleratorSupportedProfile();
enumerator->AddString("imageType", ImageDecodeAcceleratorTypeToString(profile.image_type));
......@@ -93,9 +96,9 @@ void EnumerateImageDecodeAcceleratorSupportedProfile(
enumerator->EndImageDecodeAcceleratorSupportedProfile();
}
#if defined(OS_WIN)
void EnumerateOverlayCapability(const gpu::OverlayCapability &cap,
gpu::GPUInfo::Enumerator *enumerator)
#if defined(ANGLE_PLATFORM_WINDOWS)
void EnumerateOverlayCapability(const angle::OverlayCapability &cap,
angle::GPUInfo::Enumerator *enumerator)
{
std::string key_string = "overlayCap";
key_string += OverlayFormatToString(cap.format);
......@@ -104,8 +107,8 @@ void EnumerateOverlayCapability(const gpu::OverlayCapability &cap,
enumerator->EndOverlayCapability();
}
void EnumerateDx12VulkanVersionInfo(const gpu::Dx12VulkanVersionInfo &info,
gpu::GPUInfo::Enumerator *enumerator)
void EnumerateDx12VulkanVersionInfo(const angle::Dx12VulkanVersionInfo &info,
angle::GPUInfo::Enumerator *enumerator)
{
enumerator->BeginDx12VulkanVersionInfo();
enumerator->AddBool("supportsDx12", info.supports_dx12);
......@@ -118,10 +121,10 @@ void EnumerateDx12VulkanVersionInfo(const gpu::Dx12VulkanVersionInfo &info,
} // namespace
namespace gpu
namespace angle
{
#if defined(OS_WIN)
#if defined(ANGLE_PLATFORM_WINDOWS)
const char *OverlayFormatToString(OverlayFormat format)
{
switch (format)
......@@ -215,7 +218,7 @@ const GPUInfo::GPUDevice &GPUInfo::active_gpu() const
if (secondary_gpu.active)
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;
}
......@@ -228,7 +231,7 @@ void GPUInfo::EnumerateFields(Enumerator *enumerator) const
{
struct GPUInfoKnownFields
{
base::TimeDelta initialization_time;
int64_t initialization_time;
bool optimus;
bool amd_switchable;
GPUDevice gpu;
......@@ -252,7 +255,7 @@ void GPUInfo::EnumerateFields(Enumerator *enumerator) const
bool in_process_gpu;
bool passthrough_cmd_decoder;
bool can_support_threaded_texture_mailbox;
#if defined(OS_WIN)
#if defined(ANGLE_PLATFORM_WINDOWS)
bool direct_composition;
bool supports_overlays;
OverlayCapabilities overlay_capabilities;
......@@ -288,7 +291,7 @@ void GPUInfo::EnumerateFields(Enumerator *enumerator) const
EnumerateGPUDevice(secondary_gpu, enumerator);
enumerator->BeginAuxAttributes();
enumerator->AddTimeDeltaInSecondsF("initializationTime", initialization_time);
enumerator->AddTimeDeltaInSeconds("initializationTime", initialization_time);
enumerator->AddBool("optimus", optimus);
enumerator->AddBool("amdSwitchable", amd_switchable);
enumerator->AddString("pixelShaderVersion", pixel_shader_version);
......@@ -311,7 +314,7 @@ void GPUInfo::EnumerateFields(Enumerator *enumerator) const
enumerator->AddBool("passthroughCmdDecoder", passthrough_cmd_decoder);
enumerator->AddBool("canSupportThreadedTextureMailbox", can_support_threaded_texture_mailbox);
// TODO(kbr): add dx_diagnostics on Windows.
#if defined(OS_WIN)
#if defined(ANGLE_PLATFORM_WINDOWS)
enumerator->AddBool("directComposition", direct_composition);
enumerator->AddBool("supportsOverlays", supports_overlays);
for (const auto &cap : overlay_capabilities)
......@@ -334,4 +337,4 @@ void GPUInfo::EnumerateFields(Enumerator *enumerator) const
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
// found in the LICENSE file.
//
#ifndef ANGLE_GPU_CONFIG_GPU_INFO_H_
#define ANGLE_GPU_CONFIG_GPU_INFO_H_
#ifndef TEST_EXPECTATIONS_GPU_INFO_H_
#define TEST_EXPECTATIONS_GPU_INFO_H_
// Provides access to the GPU information for the system
// on which chrome is currently running.
......@@ -13,13 +15,14 @@
#include <string>
#include <vector>
#include "gpu_test_config.h"
#include "GPUTestConfig.h"
#include "common/platform.h"
#if defined(USE_X11)
typedef unsigned long VisualID;
#endif
namespace gpu
namespace angle
{
// These values are persisted to logs. Entries should not be renumbered and
......@@ -82,7 +85,7 @@ enum VideoCodecProfile
};
// Specification of a decoding profile supported by a hardware decoder.
struct GPU_EXPORT VideoDecodeAcceleratorSupportedProfile
struct VideoDecodeAcceleratorSupportedProfile
{
VideoCodecProfile profile;
gfx::Size max_resolution;
......@@ -92,7 +95,7 @@ struct GPU_EXPORT VideoDecodeAcceleratorSupportedProfile
using VideoDecodeAcceleratorSupportedProfiles = std::vector<VideoDecodeAcceleratorSupportedProfile>;
struct GPU_EXPORT VideoDecodeAcceleratorCapabilities
struct VideoDecodeAcceleratorCapabilities
{
VideoDecodeAcceleratorCapabilities();
VideoDecodeAcceleratorCapabilities(const VideoDecodeAcceleratorCapabilities &other);
......@@ -102,7 +105,7 @@ struct GPU_EXPORT VideoDecodeAcceleratorCapabilities
};
// Specification of an encoding profile supported by a hardware encoder.
struct GPU_EXPORT VideoEncodeAcceleratorSupportedProfile
struct VideoEncodeAcceleratorSupportedProfile
{
VideoCodecProfile profile;
gfx::Size max_resolution;
......@@ -126,7 +129,7 @@ enum class ImageDecodeAcceleratorSubsampling
};
// Specification of an image decoding profile supported by a hardware decoder.
struct GPU_EXPORT ImageDecodeAcceleratorSupportedProfile
struct ImageDecodeAcceleratorSupportedProfile
{
ImageDecodeAcceleratorSupportedProfile();
ImageDecodeAcceleratorSupportedProfile(const ImageDecodeAcceleratorSupportedProfile &other);
......@@ -150,7 +153,7 @@ struct GPU_EXPORT 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
// enum in //tools/metrics/histograms/enums.xml. Mapped to corresponding DXGI
// formats in DirectCompositionSurfaceWin.
......@@ -162,9 +165,9 @@ enum class OverlayFormat
kMaxValue = kNV12
};
GPU_EXPORT const char *OverlayFormatToString(OverlayFormat format);
const char *OverlayFormatToString(OverlayFormat format);
struct GPU_EXPORT OverlayCapability
struct OverlayCapability
{
OverlayFormat format;
bool is_scaling_supported;
......@@ -172,7 +175,7 @@ struct GPU_EXPORT OverlayCapability
};
using OverlayCapabilities = std::vector<OverlayCapability>;
struct GPU_EXPORT Dx12VulkanVersionInfo
struct Dx12VulkanVersionInfo
{
bool IsEmpty() const { return !d3d12_feature_level && !vulkan_version; }
......@@ -190,9 +193,9 @@ struct GPU_EXPORT Dx12VulkanVersionInfo
};
#endif
struct GPU_EXPORT GPUInfo
struct GPUInfo
{
struct GPU_EXPORT GPUDevice
struct GPUDevice
{
GPUDevice();
GPUDevice(const GPUDevice &other);
......@@ -240,7 +243,7 @@ struct GPU_EXPORT GPUInfo
// The amount of time taken to get from the process starting to the message
// loop being pumped.
base::TimeDelta initialization_time;
int64_t initialization_time;
// Computer has NVIDIA Optimus
bool optimus;
......@@ -321,7 +324,7 @@ struct GPU_EXPORT GPUInfo
// is only implemented on Android.
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.
bool direct_composition = false;
......@@ -363,11 +366,11 @@ struct GPU_EXPORT GPUInfo
// is the root object, but calls to BeginGPUDevice/EndGPUDevice and
// BeginAuxAttributes/EndAuxAttributes change the object to which these
// calls should apply.
virtual void AddInt64(const char *name, int64_t value) = 0;
virtual void AddInt(const char *name, int value) = 0;
virtual void AddString(const char *name, const std::string &value) = 0;
virtual void AddBool(const char *name, bool value) = 0;
virtual void AddTimeDeltaInSecondsF(const char *name, const base::TimeDelta &value) = 0;
virtual void AddInt64(const char *name, int64_t value) = 0;
virtual void AddInt(const char *name, int value) = 0;
virtual void AddString(const char *name, const std::string &value) = 0;
virtual void AddBool(const char *name, bool value) = 0;
virtual void AddTimeDeltaInSeconds(const char *name, const int64_t &value) = 0;
// Markers indicating that a GPUDevice is being described.
virtual void BeginGPUDevice() = 0;
......@@ -407,6 +410,6 @@ struct GPU_EXPORT GPUInfo
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
// found in the LICENSE file.
//
#include "gpu_test_config.h"
#include "GPUTestConfig.h"
#include <stddef.h>
#include <stdint.h>
#include "gpu_info.h"
#include "gpu_test_expectations_parser.h"
#include "GPUInfo.h"
#include "GPUTestExpectationsParser.h"
#if defined(OS_MACOSX)
# include "gpu_test_config_mac.h"
#if defined(ANGLE_PLATFORM_APPLE)
# include "GPUTestConfig_mac.h"
#endif
#if !defined(OS_ANDROID)
#if !defined(ANGLE_PLATFORM_ANDROID)
# include "gpu_info_util/SystemInfo.h"
#endif
#if defined(OS_WIN)
#if defined(ANGLE_PLATFORM_WINDOWS)
namespace base
{
......@@ -51,9 +54,9 @@ void SysInfo::OperatingSystemVersionNumbers(int32_t *major_version,
} // anonymous namespace
} // namespace base
#endif // defined(OS_WIN)
#endif // defined(ANGLE_PLATFORM_WINDOWS)
namespace gpu
namespace angle
{
namespace
......@@ -61,11 +64,9 @@ namespace
GPUTestConfig::OS GetCurrentOS()
{
#if defined(OS_CHROMEOS)
return GPUTestConfig::kOsChromeOS;
#elif defined(OS_LINUX) || defined(OS_OPENBSD)
#if defined(ANGLE_PLATFORM_LINUX)
return GPUTestConfig::kOsLinux;
#elif defined(OS_WIN)
#elif defined(ANGLE_PLATFORM_WINDOWS)
int32_t major_version = 0;
int32_t minor_version = 0;
int32_t bugfix_version = 0;
......@@ -80,7 +81,7 @@ GPUTestConfig::OS GetCurrentOS()
return GPUTestConfig::kOsWin8;
if (major_version == 10)
return GPUTestConfig::kOsWin10;
#elif defined(OS_MACOSX)
#elif defined(ANGLE_PLATFORM_APPLE)
int32_t major_version = 0;
int32_t minor_version = 0;
int32_t bugfix_version = 0;
......@@ -111,15 +112,15 @@ GPUTestConfig::OS GetCurrentOS()
return GPUTestConfig::kOsMacMojave;
}
}
#elif defined(OS_ANDROID)
#elif defined(ANGLE_PLATFORM_ANDROID)
return GPUTestConfig::kOsAndroid;
#elif defined(OS_FUCHSIA)
#elif defined(ANGLE_PLATFORM_FUCHSIA)
return GPUTestConfig::kOsFuchsia;
#endif
return GPUTestConfig::kOsUnknown;
}
#if !defined(OS_ANDROID)
#if !defined(ANGLE_PLATFORM_ANDROID)
bool CollectBasicGraphicsInfo(GPUInfo *gpu_info)
{
angle::SystemInfo info;
......@@ -141,7 +142,7 @@ bool CollectBasicGraphicsInfo(GPUInfo *gpu_info)
gpu_info->gpu.active = true;
return false;
}
#endif // defined(OS_ANDROID)
#endif // defined(ANGLE_PLATFORM_ANDROID)
} // namespace
GPUTestConfig::GPUTestConfig()
......@@ -158,15 +159,15 @@ GPUTestConfig::~GPUTestConfig() = default;
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;
}
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)
DCHECK_NE(gpu_vendor_[i], gpu_vendor);
ASSERT((gpu_vendor_[i]) != (gpu_vendor));
gpu_vendor_.push_back(gpu_vendor);
}
......@@ -177,13 +178,13 @@ void GPUTestConfig::set_gpu_device_id(uint32_t id)
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;
}
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;
}
......@@ -198,8 +199,8 @@ bool GPUTestConfig::IsValid() const
bool GPUTestConfig::OverlapsWith(const GPUTestConfig &config) const
{
DCHECK(IsValid());
DCHECK(config.IsValid());
ASSERT(IsValid());
ASSERT(config.IsValid());
if (config.os_ != kOsUnknown && os_ != kOsUnknown && (os_ & config.os_) == 0)
return false;
if (config.gpu_vendor_.size() > 0 && gpu_vendor_.size() > 0)
......@@ -244,13 +245,13 @@ GPUTestBotConfig::~GPUTestBotConfig() = default;
void GPUTestBotConfig::AddGPUVendor(uint32_t gpu_vendor)
{
DCHECK_EQ(0u, GPUTestConfig::gpu_vendor().size());
ASSERT((0u) == (GPUTestConfig::gpu_vendor().size()));
GPUTestConfig::AddGPUVendor(gpu_vendor);
}
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)
return false;
ClearGPUVendor();
......@@ -279,7 +280,6 @@ bool GPUTestBotConfig::IsValid() const
case kOsMacHighSierra:
case kOsMacMojave:
case kOsLinux:
case kOsChromeOS:
case kOsAndroid:
case kOsFuchsia:
break;
......@@ -306,8 +306,8 @@ bool GPUTestBotConfig::IsValid() const
bool GPUTestBotConfig::Matches(const GPUTestConfig &config) const
{
DCHECK(IsValid());
DCHECK(config.IsValid());
ASSERT(IsValid());
ASSERT(config.IsValid());
if (config.os() != kOsUnknown && (os() & config.os()) == 0)
return false;
if (config.gpu_vendor().size() > 0)
......@@ -351,7 +351,7 @@ bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo *gpu_info)
GPUInfo my_gpu_info;
if (!CollectBasicGraphicsInfo(&my_gpu_info))
{
LOG(ERROR) << "Fail to identify GPU\n";
std::cerr << "Fail to identify GPU\n";
DisableGPUInfoValidation();
rt = true;
}
......@@ -367,7 +367,7 @@ bool GPUTestBotConfig::LoadCurrentConfig(const GPUInfo *gpu_info)
set_os(GetCurrentOS());
if (os() == kOsUnknown)
{
LOG(ERROR) << "Unknown OS\n";
std::cerr << "Unknown OS\n";
rt = false;
}
#if defined(NDEBUG)
......@@ -407,4 +407,4 @@ bool GPUTestBotConfig::GpuBlacklistedOnBot()
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
// found in the LICENSE file.
//
#ifndef ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_
#define ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_
#ifndef TEST_EXPECTATIONS_GPU_TEST_CONFIG_H_
#define TEST_EXPECTATIONS_GPU_TEST_CONFIG_H_
#include <stdint.h>
#include <iostream>
......@@ -11,33 +13,9 @@
#include <vector>
#include "common/debug.h"
#include "common/platform.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
{
class Size
......@@ -52,29 +30,12 @@ class Size
struct DxDiagNode
{};
// TODO(jmadill): other platforms
// 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
namespace angle
{
struct GPUInfo;
class GPU_EXPORT GPUTestConfig
class GPUTestConfig
{
public:
enum OS
......@@ -174,7 +135,7 @@ class GPU_EXPORT GPUTestConfig
int32_t api_;
};
class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig
class GPUTestBotConfig : public GPUTestConfig
{
public:
GPUTestBotConfig() = default;
......@@ -208,6 +169,6 @@ class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig
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
// found in the LICENSE file.
//
// gpu_test_config_mac.h:
// Helper functions for gpu_test_config that have to be compiled in ObjectiveC++
// GPUTestConfig_mac.h:
// Helper functions for GPUTestConfig that have to be compiled in ObjectiveC++
//
#ifndef ANGLE_GPU_TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_
#define ANGLE_GPU_TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_
#ifndef TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_
#define TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_
#include "gpu_info.h"
#include "GPUInfo.h"
namespace angle
{
......@@ -21,4 +21,4 @@ void GetOperatingSystemVersionNumbers(int32_t *major_version,
} // 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
// 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++
#include "gpu_test_config_mac.h"
#include "GPUTestConfig_mac.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
// found in the LICENSE file.
//
#include "gpu_test_expectations_parser.h"
#include "GPUTestExpectationsParser.h"
#include <stddef.h>
#include <stdint.h>
......@@ -47,7 +49,7 @@ bool LowerCaseEqualsASCII(const std::string &a, const char *b)
} // namespace base
namespace gpu
namespace angle
{
namespace
......@@ -230,10 +232,10 @@ bool NamesMatching(const std::string &ref, const std::string &test_name)
GPUTestExpectationsParser::GPUTestExpectationsParser()
{
// Some sanity check.
DCHECK_EQ(static_cast<unsigned int>(kNumberOfExactMatchTokens),
sizeof(kTokenData) / sizeof(kTokenData[0]));
DCHECK_EQ(static_cast<unsigned int>(kNumberOfErrors),
sizeof(kErrorMessage) / sizeof(kErrorMessage[0]));
ASSERT((static_cast<unsigned int>(kNumberOfExactMatchTokens)) ==
(sizeof(kTokenData) / sizeof(kTokenData[0])));
ASSERT((static_cast<unsigned int>(kNumberOfErrors)) ==
(sizeof(kErrorMessage) / sizeof(kErrorMessage[0])));
}
GPUTestExpectationsParser::~GPUTestExpectationsParser() = default;
......@@ -243,9 +245,8 @@ bool GPUTestExpectationsParser::LoadTestExpectations(const std::string &data)
entries_.clear();
error_messages_.clear();
std::vector<std::string> lines =
base::SplitString(data, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
bool rt = true;
std::vector<std::string> lines = SplitString(data, "\n", TRIM_WHITESPACE, SPLIT_WANT_ALL);
bool rt = true;
for (size_t i = 0; i < lines.size(); ++i)
{
if (!ParseLine(lines[i], i + 1))
......@@ -266,7 +267,7 @@ bool GPUTestExpectationsParser::LoadTestExpectationsFromFile(const std::string &
error_messages_.clear();
std::string data;
if (!base::ReadFileToString(path, &data))
if (!ReadFileToString(path, &data))
{
error_messages_.push_back(kErrorMessage[kErrorFileIO]);
return false;
......@@ -293,9 +294,9 @@ const std::vector<std::string> &GPUTestExpectationsParser::GetErrorMessages() co
bool GPUTestExpectationsParser::ParseConfig(const std::string &config_data, GPUTestConfig *config)
{
DCHECK(config);
std::vector<std::string> tokens = base::SplitString(
config_data, base::kWhitespaceASCII, base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
ASSERT(config);
std::vector<std::string> tokens =
SplitString(config_data, kWhitespaceASCII, KEEP_WHITESPACE, SPLIT_WANT_NONEMPTY);
for (size_t i = 0; i < tokens.size(); ++i)
{
......@@ -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)
{
std::vector<std::string> tokens = base::SplitString(
line_data, base::kWhitespaceASCII, base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
std::vector<std::string> tokens =
SplitString(line_data, kWhitespaceASCII, KEEP_WHITESPACE, SPLIT_WANT_NONEMPTY);
int32_t stage = kLineParserBegin;
GPUTestExpectationEntry entry;
entry.line_number = line_number;
......@@ -477,7 +478,7 @@ bool GPUTestExpectationsParser::ParseLine(const std::string &line_data, size_t l
stage++;
break;
default:
DCHECK(false);
ASSERT(false);
break;
}
}
......@@ -504,7 +505,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig(GPUTestConfig *config,
int32_t token,
size_t line_number)
{
DCHECK(config);
ASSERT(config);
switch (token)
{
case kConfigWinXP:
......@@ -573,7 +574,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig(GPUTestConfig *config,
config->set_api(config->api() | kTokenData[token].flag);
break;
default:
DCHECK(false);
ASSERT(false);
break;
}
return true;
......@@ -583,9 +584,9 @@ bool GPUTestExpectationsParser::UpdateTestConfig(GPUTestConfig *config,
const std::string &gpu_device_id,
size_t line_number)
{
DCHECK(config);
ASSERT(config);
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)
{
PushErrorMessage(kErrorMessage[kErrorEntryWithGpuDeviceIdConflicts], line_number);
......@@ -631,4 +632,4 @@ GPUTestExpectationsParser::GPUTestExpectationEntry::GPUTestExpectationEntry()
: 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
// found in the LICENSE file.
//
#ifndef ANGLE_GPU_CONFIG_GPU_TEST_EXPECTATIONS_PARSER_H_
#define ANGLE_GPU_CONFIG_GPU_TEST_EXPECTATIONS_PARSER_H_
#ifndef TEST_EXPECTATIONS_GPU_TEST_EXPECTATIONS_PARSER_H_
#define TEST_EXPECTATIONS_GPU_TEST_EXPECTATIONS_PARSER_H_
#include <stddef.h>
#include <stdint.h>
......@@ -11,12 +13,12 @@
#include <string>
#include <vector>
#include "gpu_test_config.h"
#include "GPUTestConfig.h"
namespace gpu
namespace angle
{
class GPU_EXPORT GPUTestExpectationsParser
class GPUTestExpectationsParser
{
public:
enum GPUTestExpectation
......@@ -85,6 +87,6 @@ class GPU_EXPORT GPUTestExpectationsParser
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