Skip to content

Commit

Permalink
Clean up test_expectations to merge with angle style/convention.
Browse files Browse the repository at this point in the history
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: Geoff Lang <geofflang@chromium.org>
  • Loading branch information
jonahryandavis authored and Commit Bot committed Mar 26, 2019
1 parent 4864e0c commit 518c679
Show file tree
Hide file tree
Showing 13 changed files with 190 additions and 836 deletions.
16 changes: 8 additions & 8 deletions src/tests/deqp.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
32 changes: 17 additions & 15 deletions src/tests/deqp_support/angle_deqp_gtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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=";
Expand Down Expand Up @@ -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;
};
Expand Down Expand Up @@ -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));
}
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
// 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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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));
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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)
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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)
Expand All @@ -334,4 +337,4 @@ void GPUInfo::EnumerateFields(Enumerator *enumerator) const
enumerator->EndAuxAttributes();
}

} // namespace gpu
} // namespace angle
Loading

0 comments on commit 518c679

Please sign in to comment.