Commit 8edd75d1 by Jamie Madill

dEQP: Extend GoogleTest support.

This patch will enable a Chromium-side CL to build dEQP/ANGLE with GoogleTest. BUG=angleproject:998 BUG=500736 Change-Id: Ie480e3319c1bd77dd1de2c964f78ef97297fcfe9 Reviewed-on: https://chromium-review.googlesource.com/280856Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org>
parent e148f3d3
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
'includes': [ 'common_defines.gypi', ], 'includes': [ 'common_defines.gypi', ],
'variables': 'variables':
{ {
'angle_path%': '<(DEPTH)', 'angle_path': '<(DEPTH)',
'deqp_path': '<(angle_path)/src/tests/third_party/deqp',
'libpng_path': '<(angle_path)/src/tests/third_party/libpng',
'zlib_path': '<(angle_path)/src/tests/third_party/zlib',
'angle_build_winrt%': '0', 'angle_build_winrt%': '0',
'angle_build_winphone%': '0', 'angle_build_winphone%': '0',
'angle_build_winrt_app_type_revision%': '8.1', 'angle_build_winrt_app_type_revision%': '8.1',
......
...@@ -63,6 +63,8 @@ bool DebugAnnotationsActive(); ...@@ -63,6 +63,8 @@ bool DebugAnnotationsActive();
#define ANGLE_TRACE_ENABLED #define ANGLE_TRACE_ENABLED
#endif #endif
#define ANGLE_EMPTY_STATEMENT for (;;) break
// A macro to output a trace of a function call and its arguments to the debugging log // A macro to output a trace of a function call and its arguments to the debugging log
#if defined(ANGLE_TRACE_ENABLED) #if defined(ANGLE_TRACE_ENABLED)
#define TRACE(message, ...) gl::trace(true, gl::MESSAGE_TRACE, "trace: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__) #define TRACE(message, ...) gl::trace(true, gl::MESSAGE_TRACE, "trace: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
...@@ -101,11 +103,11 @@ bool DebugAnnotationsActive(); ...@@ -101,11 +103,11 @@ bool DebugAnnotationsActive();
// A macro asserting a condition and outputting failures to the debug log // A macro asserting a condition and outputting failures to the debug log
#if !defined(NDEBUG) #if !defined(NDEBUG)
#define ASSERT(expression) do { \ #define ASSERT(expression) { \
if(!(expression)) \ if(!(expression)) \
ERR("\t! Assert failed in %s(%d): "#expression"\n", __FUNCTION__, __LINE__); \ ERR("\t! Assert failed in %s(%d): "#expression"\n", __FUNCTION__, __LINE__); \
assert(expression); \ assert(expression); \
} while(0) } ANGLE_EMPTY_STATEMENT
#define UNUSED_ASSERTION_VARIABLE(variable) #define UNUSED_ASSERTION_VARIABLE(variable)
#else #else
#define ASSERT(expression) (void(0)) #define ASSERT(expression) (void(0))
...@@ -131,20 +133,20 @@ bool DebugAnnotationsActive(); ...@@ -131,20 +133,20 @@ bool DebugAnnotationsActive();
#endif #endif
#if !defined(NDEBUG) #if !defined(NDEBUG)
#define UNIMPLEMENTED() do { \ #define UNIMPLEMENTED() { \
FIXME("\t! Unimplemented: %s(%d)\n", __FUNCTION__, __LINE__); \ FIXME("\t! Unimplemented: %s(%d)\n", __FUNCTION__, __LINE__); \
assert(NOASSERT_UNIMPLEMENTED); \ assert(NOASSERT_UNIMPLEMENTED); \
} while(0) } ANGLE_EMPTY_STATEMENT
#else #else
#define UNIMPLEMENTED() FIXME("\t! Unimplemented: %s(%d)\n", __FUNCTION__, __LINE__) #define UNIMPLEMENTED() FIXME("\t! Unimplemented: %s(%d)\n", __FUNCTION__, __LINE__)
#endif #endif
// A macro for code which is not expected to be reached under valid assumptions // A macro for code which is not expected to be reached under valid assumptions
#if !defined(NDEBUG) #if !defined(NDEBUG)
#define UNREACHABLE() do { \ #define UNREACHABLE() { \
ERR("\t! Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__); \ ERR("\t! Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__); \
assert(false); \ assert(false); \
} while(0) } ANGLE_EMPTY_STATEMENT
#else #else
#define UNREACHABLE() ERR("\t! Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__) #define UNREACHABLE() ERR("\t! Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__)
#endif #endif
......
...@@ -5,10 +5,7 @@ ...@@ -5,10 +5,7 @@
{ {
'variables': 'variables':
{ {
'deqp_path': 'third_party/deqp', 'delibs_path': '<(deqp_path)/framework/delibs',
'delibs_path': 'third_party/deqp/framework/delibs',
'libpng_path': 'third_party/libpng',
'zlib_path': 'third_party/zlib',
'deqp_msvs_disabled_warnings': 'deqp_msvs_disabled_warnings':
[ [
'4100', '4100',
...@@ -34,11 +31,18 @@ ...@@ -34,11 +31,18 @@
'DEQP_GLES3_RUNTIME_LOAD=1', 'DEQP_GLES3_RUNTIME_LOAD=1',
'DEQP_GLES2_RUNTIME_LOAD=1', 'DEQP_GLES2_RUNTIME_LOAD=1',
'QP_SUPPORT_PNG=1', 'QP_SUPPORT_PNG=1',
'_HAS_EXCEPTIONS=1',
],
'deqp_undefines':
[
'WIN32_LEAN_AND_MEAN',
'NOMINMAX',
'_HAS_EXCEPTIONS=0',
], ],
'deqp_include_dirs': 'deqp_include_dirs':
[ [
'third_party/libpng', '<(libpng_path)',
'third_party/zlib', '<(zlib_path)',
'<(delibs_path)/debase', '<(delibs_path)/debase',
'<(delibs_path)/decpp', '<(delibs_path)/decpp',
'<(delibs_path)/depool', '<(delibs_path)/depool',
...@@ -810,11 +814,11 @@ ...@@ -810,11 +814,11 @@
'<(deqp_path)/modules/glshared/glsUniformBlockCase.cpp', '<(deqp_path)/modules/glshared/glsUniformBlockCase.cpp',
'<(deqp_path)/modules/glshared/glsVertexArrayTests.cpp', '<(deqp_path)/modules/glshared/glsVertexArrayTests.cpp',
# TODO(jmadill): other platforms # TODO(jmadill): other platforms
'deqp_support/tcuANGLEWin32NativeDisplayFactory.cpp', '<(angle_path)/src/tests/deqp_support/tcuANGLEWin32NativeDisplayFactory.cpp',
'deqp_support/tcuANGLEWin32NativeDisplayFactory.h', '<(angle_path)/src/tests/deqp_support/tcuANGLEWin32NativeDisplayFactory.h',
# TODO(jmadill): integrate with dEQP # TODO(jmadill): integrate with dEQP
'deqp_support/tcuRandomOrderExecutor.cpp', '<(angle_path)/src/tests/deqp_support/tcuRandomOrderExecutor.cpp',
'deqp_support/tcuRandomOrderExecutor.h', '<(angle_path)/src/tests/deqp_support/tcuRandomOrderExecutor.h',
], ],
}, },
...@@ -934,53 +938,55 @@ ...@@ -934,53 +938,55 @@
}, },
{ {
'target_name': 'angle_deqp_decpp', 'target_name': 'angle_deqp_support',
'type': 'static_library', 'type': 'none',
'msvs_disabled_warnings': 'direct_dependent_settings':
[
'<@(deqp_msvs_disabled_warnings)',
],
'msvs_settings':
{ {
'VCCLCompilerTool': 'configurations':
{ {
'AdditionalOptions': 'Common_Base':
[ {
'/EHsc', # dEQP requires exceptions 'msvs_configuration_attributes':
], {
# dEQP requires ASCII
'CharacterSet': '0',
},
'msvs_settings':
{
'VCCLCompilerTool':
{
# dEQP requires exceptions and RTTI
'ExceptionHandling': 1,
'RuntimeTypeInfo': 'true',
},
'VCLinkerTool':
{
'AdditionalDependencies':
[
'dbghelp.lib',
'gdi32.lib',
'user32.lib',
'ws2_32.lib',
],
},
},
},
}, },
},
'defines': ['<@(deqp_defines)'],
'include_dirs': ['<@(deqp_include_dirs)'],
'direct_dependent_settings':
{
'msvs_disabled_warnings': 'msvs_disabled_warnings':
[ [
'<@(deqp_msvs_disabled_warnings)', '<@(deqp_msvs_disabled_warnings)',
], ],
'msvs_settings':
{
'VCCLCompilerTool':
{
'AdditionalOptions':
[
'/EHsc', # dEQP requires exceptions
],
},
'VCLinkerTool':
{
'AdditionalDependencies':
[
'dbghelp.lib',
'gdi32.lib',
'user32.lib',
'ws2_32.lib',
],
},
},
'include_dirs': ['<@(deqp_include_dirs)'], 'include_dirs': ['<@(deqp_include_dirs)'],
'defines': ['<@(deqp_defines)'], 'defines': ['<@(deqp_defines)'],
'defines!': [ '<@(deqp_undefines)' ],
}, },
},
{
'target_name': 'angle_deqp_decpp',
'type': 'static_library',
'dependencies': [ 'angle_deqp_support' ],
'export_dependent_settings': [ 'angle_deqp_support' ],
'sources': 'sources':
[ [
'<(deqp_path)/framework/delibs/decpp/deArrayBuffer.cpp', '<(deqp_path)/framework/delibs/decpp/deArrayBuffer.cpp',
...@@ -1015,10 +1021,14 @@ ...@@ -1015,10 +1021,14 @@
'dependencies': 'dependencies':
[ [
'angle_deqp_decpp', 'angle_deqp_decpp',
'angle_libpng',
'<(angle_path)/src/angle.gyp:libEGL', '<(angle_path)/src/angle.gyp:libEGL',
'<(angle_path)/util/util.gyp:angle_util', '<(angle_path)/util/util.gyp:angle_util',
], ],
'export_dependent_settings':
[
'angle_deqp_decpp',
'<(angle_path)/util/util.gyp:angle_util',
],
'include_dirs': 'include_dirs':
[ [
'<(angle_path)/include', '<(angle_path)/include',
...@@ -1044,14 +1054,20 @@ ...@@ -1044,14 +1054,20 @@
], ],
}, },
}, },
'export_dependent_settings':
[
'angle_deqp_decpp',
],
'sources': 'sources':
[ [
'<@(deqp_libtester_sources)', '<@(deqp_libtester_sources)',
], ],
'conditions':
[
['angle_standalone==1',
{
'dependencies': [ 'angle_libpng' ],
},
{ # angle_standalone!=1
'dependencies': [ '<(DEPTH)/third_party/libpng/libpng.gyp:libpng' ],
}],
],
}, },
{ {
...@@ -1060,7 +1076,6 @@ ...@@ -1060,7 +1076,6 @@
'dependencies': 'dependencies':
[ [
'angle_deqp_libtester', 'angle_deqp_libtester',
'<(angle_path)/util/util.gyp:angle_util',
], ],
'defines': 'defines':
[ [
...@@ -1080,7 +1095,6 @@ ...@@ -1080,7 +1095,6 @@
'dependencies': 'dependencies':
[ [
'angle_deqp_libtester', 'angle_deqp_libtester',
'<(angle_path)/util/util.gyp:angle_util',
], ],
'defines': 'defines':
[ [
...@@ -1103,7 +1117,7 @@ ...@@ -1103,7 +1117,7 @@
# app locate the data folder without need # app locate the data folder without need
# for a copy. gyp recursive copies are not # for a copy. gyp recursive copies are not
# implemented properly on Windows. # implemented properly on Windows.
'ANGLE_DEQP_DIR="<(DEPTH)/src/tests/<(deqp_path)"', 'ANGLE_DEQP_DIR="<(deqp_path)"',
], ],
'dependencies': 'dependencies':
[ [
...@@ -1124,7 +1138,7 @@ ...@@ -1124,7 +1138,7 @@
# app locate the data folder without need # app locate the data folder without need
# for a copy. gyp recursive copies are not # for a copy. gyp recursive copies are not
# implemented properly on Windows. # implemented properly on Windows.
'ANGLE_DEQP_DIR="<(DEPTH)/src/tests/<(deqp_path)"', 'ANGLE_DEQP_DIR="<(deqp_path)"',
], ],
'dependencies': 'dependencies':
[ [
...@@ -1144,59 +1158,88 @@ ...@@ -1144,59 +1158,88 @@
[ [
'angle_deqp_libgles2', 'angle_deqp_libgles2',
'angle_test_support', 'angle_test_support',
'angle_zlib', '<(angle_path)/util/util.gyp:angle_util',
'angle_deqp_decpp',
'<(angle_path)/src/angle.gyp:angle_common',
], ],
'export_dependent_settings': 'export_dependent_settings':
[ [
'angle_test_support', 'angle_test_support',
'angle_zlib', '<(angle_path)/util/util.gyp:angle_util',
'angle_deqp_decpp',
'<(angle_path)/src/angle.gyp:angle_common',
], ],
'direct_dependent_settings': 'direct_dependent_settings':
{ {
'defines':
[
# Hard-code the path to dEQP. This lets the
# app locate the data folder without need
# for a copy. gyp recursive copies are not
# implemented properly on Windows.
'ANGLE_DEQP_DIR="<(DEPTH)/src/tests/<(deqp_path)"',
],
'include_dirs': 'include_dirs':
[ [
'deqp_support', 'deqp_support',
'third_party/gpu_test_expectations',
], ],
'sources': 'sources':
[ [
'deqp_support/angle_deqp_gtest.cpp', 'deqp_support/angle_deqp_gtest.cpp',
'third_party/gpu_test_expectations/gpu_info.cc',
'third_party/gpu_test_expectations/gpu_info.h',
'third_party/gpu_test_expectations/gpu_test_config.cc',
'third_party/gpu_test_expectations/gpu_test_config.h',
'third_party/gpu_test_expectations/gpu_test_expectations_parser.cc',
'third_party/gpu_test_expectations/gpu_test_expectations_parser.h',
],
'defines':
[
# Re-define the missing Windows macros
'<@(deqp_undefines)',
], ],
'copies':
[
{
'destination': '<(PRODUCT_DIR)/deqp_support',
'files':
[
'deqp_support/dEQP-GLES2-cases.txt.gz',
'deqp_support/dEQP-GLES3-cases.txt.gz',
'deqp_support/deqp_test_expectations.txt',
],
},
],
'msvs_settings':
{
'VCLinkerTool':
{
'AdditionalDependencies':
[
'user32.lib',
],
},
},
}, },
'conditions':
[
['angle_standalone==1',
{
'dependencies': [ 'angle_zlib' ],
'export_dependent_settings': [ 'angle_zlib' ],
},
{ # angle_standalone!=1
'dependencies': [ '<(zlib_path)/zlib.gyp:zlib' ],
'export_dependent_settings': [ '<(zlib_path)/zlib.gyp:zlib' ],
}],
],
}, },
{ {
'target_name': 'angle_deqp_googletest', 'target_name': 'angle_deqp_googletest',
'type': 'executable', 'type': 'executable',
'includes': [ '../../build/common_defines.gypi', ],
'dependencies': 'dependencies':
[ [
'angle_deqp_gtest_support', 'angle_deqp_gtest_support',
], ],
'include_dirs':
[
'third_party/gpu_test_expectations',
],
'sources': 'sources':
[ [
'deqp_support/angle_deqp_gtest_main.cpp', 'deqp_support/angle_deqp_gtest_main.cpp',
'third_party/gpu_test_expectations/gpu_info.cc',
'third_party/gpu_test_expectations/gpu_info.h',
'third_party/gpu_test_expectations/gpu_test_config.cc',
'third_party/gpu_test_expectations/gpu_test_config.h',
'third_party/gpu_test_expectations/gpu_test_expectations_parser.cc',
'third_party/gpu_test_expectations/gpu_test_expectations_parser.h',
], ],
}, },
], # targets ], # targets
......
...@@ -7,17 +7,16 @@ ...@@ -7,17 +7,16 @@
// dEQP and GoogleTest integration logic. Calls through to the random // dEQP and GoogleTest integration logic. Calls through to the random
// order executor. // order executor.
#include <gtest/gtest.h>
#include <stdint.h> #include <stdint.h>
#include <zlib.h> #include <zlib.h>
#include <algorithm> #include <gtest/gtest.h>
#include <fstream>
#include "angle_deqp_libtester.h" #include "angle_deqp_libtester.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "common/debug.h" #include "common/debug.h"
#include "gpu_test_expectations_parser.h" #include "gpu_test_expectations_parser.h"
#include "system_utils.h"
namespace namespace
{ {
...@@ -25,7 +24,7 @@ namespace ...@@ -25,7 +24,7 @@ namespace
class dEQPCaseList class dEQPCaseList
{ {
public: public:
dEQPCaseList(const char *caseListPath, const char *testExpectationsPath); dEQPCaseList(const std::string &caseListPath, const std::string &testExpectationsPath);
struct CaseInfo struct CaseInfo
{ {
...@@ -73,8 +72,10 @@ dEQPCaseList *dEQPCaseList::GetInstance() ...@@ -73,8 +72,10 @@ dEQPCaseList *dEQPCaseList::GetInstance()
{ {
if (mInstance == nullptr) if (mInstance == nullptr)
{ {
mInstance = new dEQPCaseList("deqp_support/dEQP-GLES2-cases.txt.gz", std::string exeDir = angle::GetExecutableDirectory();
"deqp_support/deqp_test_expectations.txt"); std::string caseListPath = exeDir + "/deqp_support/dEQP-GLES2-cases.txt.gz";
std::string testExpectationsPath = exeDir + "/deqp_support/deqp_test_expectations.txt";
mInstance = new dEQPCaseList(caseListPath, testExpectationsPath);
} }
return mInstance; return mInstance;
} }
...@@ -86,9 +87,9 @@ void dEQPCaseList::FreeInstance() ...@@ -86,9 +87,9 @@ void dEQPCaseList::FreeInstance()
SafeDelete(mInstance); SafeDelete(mInstance);
} }
dEQPCaseList::dEQPCaseList(const char *caseListPath, const char *testExpectationsPath) dEQPCaseList::dEQPCaseList(const std::string &caseListPath, const std::string &testExpectationsPath)
{ {
if (!mTestExpectationsParser.LoadTestExpectationsFromFile(std::string(testExpectationsPath))) if (!mTestExpectationsParser.LoadTestExpectationsFromFile(testExpectationsPath))
{ {
std::cerr << "Failed to load test expectations." << std::endl; std::cerr << "Failed to load test expectations." << std::endl;
for (const auto &message : mTestExpectationsParser.GetErrorMessages()) for (const auto &message : mTestExpectationsParser.GetErrorMessages())
...@@ -107,7 +108,7 @@ dEQPCaseList::dEQPCaseList(const char *caseListPath, const char *testExpectation ...@@ -107,7 +108,7 @@ dEQPCaseList::dEQPCaseList(const char *caseListPath, const char *testExpectation
std::stringstream caseListStream; std::stringstream caseListStream;
std::vector<char> buf(1024 * 1024 * 16); std::vector<char> buf(1024 * 1024 * 16);
gzFile *fi = static_cast<gzFile *>(gzopen(caseListPath, "rb")); gzFile *fi = static_cast<gzFile *>(gzopen(caseListPath.c_str(), "rb"));
if (fi == nullptr) if (fi == nullptr)
{ {
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
deqp_libtester_init_platform(argc, argv, ANGLE_DEQP_DIR "/data");
testing::InitGoogleTest(&argc, argv); testing::InitGoogleTest(&argc, argv);
int rt = RUN_ALL_TESTS(); int rt = RUN_ALL_TESTS();
deqp_libtester_shutdown_platform(); deqp_libtester_shutdown_platform();
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
// Exported to the tester app. // Exported to the tester app.
ANGLE_LIBTESTER_EXPORT int deqp_libtester_main(int argc, const char *argv[]); ANGLE_LIBTESTER_EXPORT int deqp_libtester_main(int argc, const char *argv[]);
ANGLE_LIBTESTER_EXPORT void deqp_libtester_init_platform(int argc, char **argv, const char *deqpDataDir);
ANGLE_LIBTESTER_EXPORT void deqp_libtester_shutdown_platform(); ANGLE_LIBTESTER_EXPORT void deqp_libtester_shutdown_platform();
ANGLE_LIBTESTER_EXPORT bool deqp_libtester_run(const char *caseName); ANGLE_LIBTESTER_EXPORT bool deqp_libtester_run(const char *caseName);
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <iostream> #include <iostream>
#include "angle_deqp_libtester.h" #include "angle_deqp_libtester.h"
#include "common/angleutils.h"
#include "deMath.h" #include "deMath.h"
#include "deUniquePtr.hpp" #include "deUniquePtr.hpp"
#include "tcuApp.hpp" #include "tcuApp.hpp"
...@@ -19,6 +20,10 @@ ...@@ -19,6 +20,10 @@
#include "tcuResource.hpp" #include "tcuResource.hpp"
#include "tcuTestLog.hpp" #include "tcuTestLog.hpp"
#if (DE_OS == DE_OS_WIN32)
#include <Windows.h>
#endif
// Located in tcuMain.cc in dEQP's sources. // Located in tcuMain.cc in dEQP's sources.
int main(int argc, const char* argv[]); int main(int argc, const char* argv[]);
tcu::Platform *createPlatform(); tcu::Platform *createPlatform();
...@@ -34,15 +39,48 @@ tcu::TestContext *g_testCtx = nullptr; ...@@ -34,15 +39,48 @@ tcu::TestContext *g_testCtx = nullptr;
tcu::TestPackageRoot *g_root = nullptr; tcu::TestPackageRoot *g_root = nullptr;
tcu::RandomOrderExecutor *g_executor = nullptr; tcu::RandomOrderExecutor *g_executor = nullptr;
const char *g_dEQPDataSearchDirs[] =
{
"data",
"third_party/deqp/data",
"../third_party/deqp/src/data",
"deqp_support/data",
"third_party/deqp/src/data",
"../../third_party/deqp/src/data"
};
// TODO(jmadill): upstream to dEQP?
#if (DE_OS == DE_OS_WIN32)
deBool deIsDir(const char *filename)
{
DWORD attribs = GetFileAttributesA(filename);
return (attribs != INVALID_FILE_ATTRIBUTES) &&
((attribs & FILE_ATTRIBUTE_DIRECTORY) > 0);
} }
#else
#error TODO(jmadill): support other platforms
//deBool deIsDir(const char *filename)
//{
// struct stat st;
// int result = stat(filename, &st);
// return result == 0 && ((st.st_mode & S_IFDIR) == S_IFDIR);
//}
#endif
// Exported to the tester app. const char *FindDataDir()
ANGLE_LIBTESTER_EXPORT int deqp_libtester_main(int argc, const char *argv[])
{ {
return main(argc, argv); for (size_t dirIndex = 0; dirIndex < ArraySize(g_dEQPDataSearchDirs); ++dirIndex)
{
if (deIsDir(g_dEQPDataSearchDirs[dirIndex]))
{
return g_dEQPDataSearchDirs[dirIndex];
}
}
return nullptr;
} }
ANGLE_LIBTESTER_EXPORT void deqp_libtester_init_platform(int argc, char **argv, const char *deqpDataDir) bool InitPlatform()
{ {
try try
{ {
...@@ -54,11 +92,21 @@ ANGLE_LIBTESTER_EXPORT void deqp_libtester_init_platform(int argc, char **argv, ...@@ -54,11 +92,21 @@ ANGLE_LIBTESTER_EXPORT void deqp_libtester_init_platform(int argc, char **argv,
if (!deSetRoundingMode(DE_ROUNDINGMODE_TO_NEAREST)) if (!deSetRoundingMode(DE_ROUNDINGMODE_TO_NEAREST))
{ {
throw std::runtime_error("Failed to set floating point rounding mode."); std::cout << "Failed to set floating point rounding mode." << std::endl;
return false;
}
const char *deqpDataDir = FindDataDir();
if (deqpDataDir == nullptr)
{
std::cout << "Failed to find dEQP data directory." << std::endl;
return false;
} }
// TODO(jmadill): filter arguments // TODO(jmadill): filter arguments
g_cmdLine = new tcu::CommandLine(1, argv); const char *emptyString = "";
g_cmdLine = new tcu::CommandLine(1, &emptyString);
g_archive = new tcu::DirArchive(deqpDataDir); g_archive = new tcu::DirArchive(deqpDataDir);
g_log = new tcu::TestLog(g_cmdLine->getLogFileName(), g_cmdLine->getLogFlags()); g_log = new tcu::TestLog(g_cmdLine->getLogFileName(), g_cmdLine->getLogFlags());
g_testCtx = new tcu::TestContext(*g_platform, *g_archive, *g_log, *g_cmdLine, DE_NULL); g_testCtx = new tcu::TestContext(*g_platform, *g_archive, *g_log, *g_cmdLine, DE_NULL);
...@@ -68,7 +116,18 @@ ANGLE_LIBTESTER_EXPORT void deqp_libtester_init_platform(int argc, char **argv, ...@@ -68,7 +116,18 @@ ANGLE_LIBTESTER_EXPORT void deqp_libtester_init_platform(int argc, char **argv,
catch (const std::exception& e) catch (const std::exception& e)
{ {
tcu::die("%s", e.what()); tcu::die("%s", e.what());
return false;
} }
return true;
}
} // anonymous namespace
// Exported to the tester app.
ANGLE_LIBTESTER_EXPORT int deqp_libtester_main(int argc, const char *argv[])
{
return main(argc, argv);
} }
ANGLE_LIBTESTER_EXPORT void deqp_libtester_shutdown_platform() ANGLE_LIBTESTER_EXPORT void deqp_libtester_shutdown_platform()
...@@ -84,9 +143,9 @@ ANGLE_LIBTESTER_EXPORT void deqp_libtester_shutdown_platform() ...@@ -84,9 +143,9 @@ ANGLE_LIBTESTER_EXPORT void deqp_libtester_shutdown_platform()
ANGLE_LIBTESTER_EXPORT bool deqp_libtester_run(const char *caseName) ANGLE_LIBTESTER_EXPORT bool deqp_libtester_run(const char *caseName)
{ {
if (!g_platform) if (g_platform == nullptr && !InitPlatform())
{ {
return false; tcu::die("Failed to initialize platform.");
} }
try try
......
diff --git a/angle_config.h b/angle_config.h diff --git a/src/tests/third_party/gpu_test_expectations/angle_config.h b/src/tests/third_party/gpu_test_expectations/angle_config.h
new file mode 100644 new file mode 100644
index 0000000..0d43371 index 0000000..7643346
--- /dev/null --- /dev/null
+++ b/angle_config.h +++ b/src/tests/third_party/gpu_test_expectations/angle_config.h
@@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
+// +//
+// Copyright 2015 The ANGLE Project Authors. All rights reserved. +// Copyright 2015 The ANGLE Project Authors. All rights reserved.
...@@ -25,7 +25,7 @@ index 0000000..0d43371 ...@@ -25,7 +25,7 @@ index 0000000..0d43371
+ +
+#define DCHECK_EQ(A,B) ASSERT((A) == (B)) +#define DCHECK_EQ(A,B) ASSERT((A) == (B))
+#define DCHECK_NE(A,B) ASSERT((A) != (B)) +#define DCHECK_NE(A,B) ASSERT((A) != (B))
+#define DCHECK ASSERT +#define DCHECK(X) ASSERT(X)
+#define LOG(X) std::cerr +#define LOG(X) std::cerr
+#define StringPrintf FormatString +#define StringPrintf FormatString
+ +
...@@ -43,23 +43,23 @@ index 0000000..0d43371 ...@@ -43,23 +43,23 @@ index 0000000..0d43371
+#define OS_WIN +#define OS_WIN
+ +
+#endif +#endif
diff --git a/gpu_info.cc b/gpu_info.cc diff --git a/src/tests/third_party/gpu_test_expectations/gpu_info.cc b/src/tests/third_party/gpu_test_expectations/gpu_info.cc
index 85d26fb..c8e2988 100644 index 85d26fb..c8e2988 100644
--- a/gpu_info.cc --- a/src/tests/third_party/gpu_test_expectations/gpu_info.cc
+++ b/gpu_info.cc +++ b/src/tests/third_party/gpu_test_expectations/gpu_info.cc
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
// 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/config/gpu_info.h" -#include "gpu/config/gpu_info.h"
+#include "gpu_info.h" +#include "gpu_info.h"
namespace { namespace {
@@ -17,31 +17,6 @@ void EnumerateGPUDevice(const gpu::GPUInfo::GPUDevice& device, @@ -17,31 +17,6 @@ void EnumerateGPUDevice(const gpu::GPUInfo::GPUDevice& device,
enumerator->EndGPUDevice(); enumerator->EndGPUDevice();
} }
-void EnumerateVideoDecodeAcceleratorSupportedProfile( -void EnumerateVideoDecodeAcceleratorSupportedProfile(
- const gpu::VideoDecodeAcceleratorSupportedProfile& profile, - const gpu::VideoDecodeAcceleratorSupportedProfile& profile,
- gpu::GPUInfo::Enumerator* enumerator) { - gpu::GPUInfo::Enumerator* enumerator) {
...@@ -86,7 +86,7 @@ index 85d26fb..c8e2988 100644 ...@@ -86,7 +86,7 @@ index 85d26fb..c8e2988 100644
-} -}
- -
} // namespace } // namespace
namespace gpu { namespace gpu {
@@ -66,23 +41,16 @@ GPUInfo::GPUInfo() @@ -66,23 +41,16 @@ GPUInfo::GPUInfo()
sandboxed(false), sandboxed(false),
...@@ -99,9 +99,9 @@ index 85d26fb..c8e2988 100644 ...@@ -99,9 +99,9 @@ index 85d26fb..c8e2988 100644
context_info_state(kCollectInfoNone) { context_info_state(kCollectInfoNone) {
-#endif -#endif
} }
GPUInfo::~GPUInfo() { } GPUInfo::~GPUInfo() { }
void GPUInfo::EnumerateFields(Enumerator* enumerator) const { void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
struct GPUInfoKnownFields { struct GPUInfoKnownFields {
- base::TimeDelta initialization_time; - base::TimeDelta initialization_time;
...@@ -125,11 +125,11 @@ index 85d26fb..c8e2988 100644 ...@@ -125,11 +125,11 @@ index 85d26fb..c8e2988 100644
- VideoEncodeAcceleratorSupportedProfiles - VideoEncodeAcceleratorSupportedProfiles
- video_encode_accelerator_supported_profiles; - video_encode_accelerator_supported_profiles;
}; };
// If this assert fails then most likely something below needs to be updated. // If this assert fails then most likely something below needs to be updated.
@@ -134,15 +94,9 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const { @@ -134,15 +94,9 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
EnumerateGPUDevice(secondary_gpu, enumerator); EnumerateGPUDevice(secondary_gpu, enumerator);
enumerator->BeginAuxAttributes(); enumerator->BeginAuxAttributes();
- enumerator->AddTimeDeltaInSecondsF("initializationTime", - enumerator->AddTimeDeltaInSecondsF("initializationTime",
- initialization_time); - initialization_time);
...@@ -157,15 +157,15 @@ index 85d26fb..c8e2988 100644 ...@@ -157,15 +157,15 @@ index 85d26fb..c8e2988 100644
- EnumerateVideoEncodeAcceleratorSupportedProfile(profile, enumerator); - EnumerateVideoEncodeAcceleratorSupportedProfile(profile, enumerator);
enumerator->EndAuxAttributes(); enumerator->EndAuxAttributes();
} }
diff --git a/gpu_info.h b/gpu_info.h diff --git a/src/tests/third_party/gpu_test_expectations/gpu_info.h b/src/tests/third_party/gpu_test_expectations/gpu_info.h
index f377698..35e791e 100644 index f377698..35e791e 100644
--- a/gpu_info.h --- a/src/tests/third_party/gpu_test_expectations/gpu_info.h
+++ b/gpu_info.h +++ b/src/tests/third_party/gpu_test_expectations/gpu_info.h
@@ -11,13 +11,7 @@ @@ -11,13 +11,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
-#include "base/basictypes.h" -#include "base/basictypes.h"
-#include "base/time/time.h" -#include "base/time/time.h"
-#include "base/version.h" -#include "base/version.h"
...@@ -174,13 +174,13 @@ index f377698..35e791e 100644 ...@@ -174,13 +174,13 @@ index f377698..35e791e 100644
-#include "gpu/gpu_export.h" -#include "gpu/gpu_export.h"
-#include "ui/gfx/geometry/size.h" -#include "ui/gfx/geometry/size.h"
+#include "angle_config.h" +#include "angle_config.h"
namespace gpu { namespace gpu {
@@ -54,25 +48,6 @@ enum VideoCodecProfile { @@ -54,25 +48,6 @@ enum VideoCodecProfile {
VIDEO_CODEC_PROFILE_MAX = VP9PROFILE_ANY, VIDEO_CODEC_PROFILE_MAX = VP9PROFILE_ANY,
}; };
-// 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 GPU_EXPORT VideoDecodeAcceleratorSupportedProfile {
- VideoCodecProfile profile; - VideoCodecProfile profile;
...@@ -206,25 +206,25 @@ index f377698..35e791e 100644 ...@@ -206,25 +206,25 @@ index f377698..35e791e 100644
@@ -104,10 +79,6 @@ struct GPU_EXPORT GPUInfo { @@ -104,10 +79,6 @@ struct GPU_EXPORT GPUInfo {
return !can_lose_context && !software_rendering; return !can_lose_context && !software_rendering;
} }
- // 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; - base::TimeDelta initialization_time;
- -
// Computer has NVIDIA Optimus // Computer has NVIDIA Optimus
bool optimus; bool optimus;
@@ -117,10 +88,6 @@ struct GPU_EXPORT GPUInfo { @@ -117,10 +88,6 @@ struct GPU_EXPORT GPUInfo {
// Lenovo dCute is installed. http://crbug.com/181665. // Lenovo dCute is installed. http://crbug.com/181665.
bool lenovo_dcute; bool lenovo_dcute;
- // Version of DisplayLink driver installed. Zero if not installed. - // Version of DisplayLink driver installed. Zero if not installed.
- // http://crbug.com/177611. - // http://crbug.com/177611.
- Version display_link_version; - Version display_link_version;
- -
// Primary GPU, for exmaple, the discrete GPU in a dual GPU machine. // Primary GPU, for exmaple, the discrete GPU in a dual GPU machine.
GPUDevice gpu; GPUDevice gpu;
@@ -210,17 +177,7 @@ struct GPU_EXPORT GPUInfo { @@ -210,17 +177,7 @@ struct GPU_EXPORT GPUInfo {
// if the collection fails or not. // if the collection fails or not.
CollectInfoResult basic_info_state; CollectInfoResult basic_info_state;
...@@ -235,34 +235,34 @@ index f377698..35e791e 100644 ...@@ -235,34 +235,34 @@ index f377698..35e791e 100644
- // The information returned by the DirectX Diagnostics Tool. - // The information returned by the DirectX Diagnostics Tool.
- DxDiagNode dx_diagnostics; - DxDiagNode dx_diagnostics;
-#endif -#endif
- VideoDecodeAcceleratorSupportedProfiles - VideoDecodeAcceleratorSupportedProfiles
- video_decode_accelerator_supported_profiles; - video_decode_accelerator_supported_profiles;
- VideoEncodeAcceleratorSupportedProfiles - VideoEncodeAcceleratorSupportedProfiles
- video_encode_accelerator_supported_profiles; - video_encode_accelerator_supported_profiles;
// Note: when adding new members, please remember to update EnumerateFields // Note: when adding new members, please remember to update EnumerateFields
// in gpu_info.cc. // in gpu_info.cc.
@@ -238,8 +195,6 @@ struct GPU_EXPORT GPUInfo { @@ -238,8 +195,6 @@ struct GPU_EXPORT GPUInfo {
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, - virtual void AddTimeDeltaInSecondsF(const char* name,
- const base::TimeDelta& value) = 0; - const base::TimeDelta& 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;
diff --git a/gpu_test_config.cc b/gpu_test_config.cc diff --git a/src/tests/third_party/gpu_test_expectations/gpu_test_config.cc b/src/tests/third_party/gpu_test_expectations/gpu_test_config.cc
index c062c4d..d2c6b5a 100644 index c062c4d..d9b0da2 100644
--- a/gpu_test_config.cc --- a/src/tests/third_party/gpu_test_expectations/gpu_test_config.cc
+++ b/gpu_test_config.cc +++ b/src/tests/third_party/gpu_test_expectations/gpu_test_config.cc
@@ -2,24 +2,73 @@ @@ -2,24 +2,73 @@
// 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/config/gpu_test_config.h" -#include "gpu/config/gpu_test_config.h"
+#include "gpu_test_config.h" +#include "gpu_test_config.h"
-#include "base/logging.h" -#include "base/logging.h"
-#include "base/sys_info.h" -#include "base/sys_info.h"
-#include "gpu/config/gpu_info.h" -#include "gpu/config/gpu_info.h"
...@@ -270,7 +270,7 @@ index c062c4d..d2c6b5a 100644 ...@@ -270,7 +270,7 @@ index c062c4d..d2c6b5a 100644
-#include "gpu/config/gpu_test_expectations_parser.h" -#include "gpu/config/gpu_test_expectations_parser.h"
+#include "gpu_info.h" +#include "gpu_info.h"
+#include "gpu_test_expectations_parser.h" +#include "gpu_test_expectations_parser.h"
-#if defined(OS_MACOSX) -#if defined(OS_MACOSX)
-#include "base/mac/mac_util.h" -#include "base/mac/mac_util.h"
-#elif defined(OS_WIN) -#elif defined(OS_WIN)
...@@ -296,11 +296,11 @@ index c062c4d..d2c6b5a 100644 ...@@ -296,11 +296,11 @@ index c062c4d..d2c6b5a 100644
+ *minor_version = version_info.dwMinorVersion; + *minor_version = version_info.dwMinorVersion;
+ *bugfix_version = version_info.dwBuildNumber; + *bugfix_version = version_info.dwBuildNumber;
+} +}
namespace gpu { namespace gpu {
namespace { namespace {
+void DeviceIDToVendorAndDevice(const std::string& id, +void DeviceIDToVendorAndDevice(const std::string& id,
+ uint32* vendor_id, + uint32* vendor_id,
+ uint32* device_id) { + uint32* device_id) {
...@@ -320,10 +320,10 @@ index c062c4d..d2c6b5a 100644 ...@@ -320,10 +320,10 @@ index c062c4d..d2c6b5a 100644
+ *device_id = 0; + *device_id = 0;
+ +
+ // Taken from http://developer.nvidia.com/object/device_ids.html + // Taken from http://developer.nvidia.com/object/device_ids.html
+ DISPLAY_DEVICE dd; + DISPLAY_DEVICEA dd;
+ dd.cb = sizeof(DISPLAY_DEVICE); + dd.cb = sizeof(DISPLAY_DEVICEA);
+ std::string id; + std::string id;
+ for (int i = 0; EnumDisplayDevices(NULL, i, &dd, 0); ++i) { + for (int i = 0; EnumDisplayDevicesA(NULL, i, &dd, 0); ++i) {
+ if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) { + if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) {
+ id = dd.DeviceID; + id = dd.DeviceID;
+ break; + break;
...@@ -344,7 +344,7 @@ index c062c4d..d2c6b5a 100644 ...@@ -344,7 +344,7 @@ index c062c4d..d2c6b5a 100644
@@ -282,21 +331,5 @@ bool GPUTestBotConfig::CurrentConfigMatches( @@ -282,21 +331,5 @@ bool GPUTestBotConfig::CurrentConfigMatches(
return false; return false;
} }
-// static -// static
-bool GPUTestBotConfig::GpuBlacklistedOnBot() { -bool GPUTestBotConfig::GpuBlacklistedOnBot() {
-#if defined(OS_MACOSX) -#if defined(OS_MACOSX)
...@@ -362,22 +362,22 @@ index c062c4d..d2c6b5a 100644 ...@@ -362,22 +362,22 @@ index c062c4d..d2c6b5a 100644
-} -}
- -
} // namespace gpu } // namespace gpu
diff --git a/gpu_test_config.h b/gpu_test_config.h diff --git a/src/tests/third_party/gpu_test_expectations/gpu_test_config.h b/src/tests/third_party/gpu_test_expectations/gpu_test_config.h
index 8b184d3..e628886 100644 index 8b184d3..e628886 100644
--- a/gpu_test_config.h --- a/src/tests/third_party/gpu_test_expectations/gpu_test_config.h
+++ b/gpu_test_config.h +++ b/src/tests/third_party/gpu_test_expectations/gpu_test_config.h
@@ -8,9 +8,7 @@ @@ -8,9 +8,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
-#include "base/basictypes.h" -#include "base/basictypes.h"
-#include "base/compiler_specific.h" -#include "base/compiler_specific.h"
-#include "gpu/gpu_export.h" -#include "gpu/gpu_export.h"
+#include "angle_config.h" +#include "angle_config.h"
namespace gpu { namespace gpu {
@@ -118,9 +116,6 @@ class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig { @@ -118,9 +116,6 @@ class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig {
// Check if this bot's config matches |config_data| or any of the |configs|. // 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::string& config_data);
...@@ -386,19 +386,19 @@ index 8b184d3..e628886 100644 ...@@ -386,19 +386,19 @@ index 8b184d3..e628886 100644
- // Check if the bot has blacklisted all GPU features. - // Check if the bot has blacklisted all GPU features.
- static bool GpuBlacklistedOnBot(); - static bool GpuBlacklistedOnBot();
}; };
} // namespace gpu } // namespace gpu
diff --git a/gpu_test_expectations_parser.cc b/gpu_test_expectations_parser.cc diff --git a/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.cc b/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.cc
index 8b3584a..092cf9b 100644 index 8b3584a..d6ba5c3 100644
--- a/gpu_test_expectations_parser.cc --- a/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.cc
+++ b/gpu_test_expectations_parser.cc +++ b/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.cc
@@ -2,14 +2,35 @@ @@ -2,14 +2,35 @@
// 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/config/gpu_test_expectations_parser.h" -#include "gpu/config/gpu_test_expectations_parser.h"
+#include "gpu_test_expectations_parser.h" +#include "gpu_test_expectations_parser.h"
-#include "base/files/file_util.h" -#include "base/files/file_util.h"
-#include "base/logging.h" -#include "base/logging.h"
-#include "base/strings/string_number_conversions.h" -#include "base/strings/string_number_conversions.h"
...@@ -432,43 +432,76 @@ index 8b3584a..092cf9b 100644 ...@@ -432,43 +432,76 @@ index 8b3584a..092cf9b 100644
+bool LowerCaseEqualsASCII(const std::string& a, const char* b) { +bool LowerCaseEqualsASCII(const std::string& a, const char* b) {
+ return DoLowerCaseEqualsASCII(a.begin(), a.end(), b); + return DoLowerCaseEqualsASCII(a.begin(), a.end(), b);
+} +}
namespace gpu { namespace gpu {
@@ -161,10 +182,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]));
+ static_assert(static_cast<unsigned int>(kNumberOfExactMatchTokens) ==
+ sizeof(kTokenData) / sizeof(kTokenData[0]), "sanity check");
+ static_assert(static_cast<unsigned int>(kNumberOfErrors) ==
+ sizeof(kErrorMessage) / sizeof(kErrorMessage[0]), "sanity check");
}
GPUTestExpectationsParser::~GPUTestExpectationsParser() {
@@ -189,8 +210,8 @@ bool GPUTestExpectationsParser::LoadTestExpectations(const std::string& data) { @@ -189,8 +210,8 @@ bool GPUTestExpectationsParser::LoadTestExpectations(const std::string& data) {
return rt; return rt;
} }
-bool GPUTestExpectationsParser::LoadTestExpectations( -bool GPUTestExpectationsParser::LoadTestExpectations(
- const base::FilePath& path) { - const base::FilePath& path) {
+bool GPUTestExpectationsParser::LoadTestExpectationsFromFile( +bool GPUTestExpectationsParser::LoadTestExpectationsFromFile(
+ const std::string& path) { + const std::string& path) {
entries_.clear(); entries_.clear();
error_messages_.clear(); error_messages_.clear();
diff --git a/gpu_test_expectations_parser.h b/gpu_test_expectations_parser.h @@ -370,7 +391,7 @@ bool GPUTestExpectationsParser::ParseLine(
stage++;
break;
default:
- DCHECK(false);
+ UNREACHABLE();
break;
}
}
@@ -446,7 +467,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig(
config->build_type() | kTokenData[token].flag);
break;
default:
- DCHECK(false);
+ UNREACHABLE();
break;
}
return true;
diff --git a/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.h b/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.h
index a69f7e9..a112700 100644 index a69f7e9..a112700 100644
--- a/gpu_test_expectations_parser.h --- a/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.h
+++ b/gpu_test_expectations_parser.h +++ b/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.h
@@ -8,10 +8,8 @@ @@ -8,10 +8,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
-#include "base/basictypes.h" -#include "base/basictypes.h"
-#include "base/files/file_path.h" -#include "base/files/file_path.h"
-#include "gpu/config/gpu_test_config.h" -#include "gpu/config/gpu_test_config.h"
-#include "gpu/gpu_export.h" -#include "gpu/gpu_export.h"
+#include "angle_config.h" +#include "angle_config.h"
+#include "gpu_test_config.h" +#include "gpu_test_config.h"
namespace gpu { namespace gpu {
@@ -32,7 +30,7 @@ class GPU_EXPORT GPUTestExpectationsParser { @@ -32,7 +30,7 @@ class GPU_EXPORT GPUTestExpectationsParser {
// save all the entries. Otherwise, generate error messages. // save all the entries. Otherwise, generate error messages.
// Return true if parsing succeeds. // Return true if parsing succeeds.
bool LoadTestExpectations(const std::string& data); bool LoadTestExpectations(const std::string& data);
- bool LoadTestExpectations(const base::FilePath& path); - bool LoadTestExpectations(const base::FilePath& path);
+ bool LoadTestExpectationsFromFile(const std::string& path); + bool LoadTestExpectationsFromFile(const std::string& path);
// Query error messages from the last LoadTestExpectations() call. // Query error messages from the last LoadTestExpectations() call.
const std::vector<std::string>& GetErrorMessages() const; const std::vector<std::string>& GetErrorMessages() const;
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#define DCHECK_EQ(A,B) ASSERT((A) == (B)) #define DCHECK_EQ(A,B) ASSERT((A) == (B))
#define DCHECK_NE(A,B) ASSERT((A) != (B)) #define DCHECK_NE(A,B) ASSERT((A) != (B))
#define DCHECK ASSERT #define DCHECK(X) ASSERT(X)
#define LOG(X) std::cerr #define LOG(X) std::cerr
#define StringPrintf FormatString #define StringPrintf FormatString
......
...@@ -51,10 +51,10 @@ CollectInfoResult CollectGpuID(uint32* vendor_id, uint32* device_id) { ...@@ -51,10 +51,10 @@ CollectInfoResult CollectGpuID(uint32* vendor_id, uint32* device_id) {
*device_id = 0; *device_id = 0;
// Taken from http://developer.nvidia.com/object/device_ids.html // Taken from http://developer.nvidia.com/object/device_ids.html
DISPLAY_DEVICE dd; DISPLAY_DEVICEA dd;
dd.cb = sizeof(DISPLAY_DEVICE); dd.cb = sizeof(DISPLAY_DEVICEA);
std::string id; std::string id;
for (int i = 0; EnumDisplayDevices(NULL, i, &dd, 0); ++i) { for (int i = 0; EnumDisplayDevicesA(NULL, i, &dd, 0); ++i) {
if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) { if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) {
id = dd.DeviceID; id = dd.DeviceID;
break; break;
......
...@@ -182,10 +182,10 @@ bool NamesMatching(const std::string& ref, const std::string& test_name) { ...@@ -182,10 +182,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), static_assert(static_cast<unsigned int>(kNumberOfExactMatchTokens) ==
sizeof(kTokenData) / sizeof(kTokenData[0])); sizeof(kTokenData) / sizeof(kTokenData[0]), "sanity check");
DCHECK_EQ(static_cast<unsigned int>(kNumberOfErrors), static_assert(static_cast<unsigned int>(kNumberOfErrors) ==
sizeof(kErrorMessage) / sizeof(kErrorMessage[0])); sizeof(kErrorMessage) / sizeof(kErrorMessage[0]), "sanity check");
} }
GPUTestExpectationsParser::~GPUTestExpectationsParser() { GPUTestExpectationsParser::~GPUTestExpectationsParser() {
...@@ -391,7 +391,7 @@ bool GPUTestExpectationsParser::ParseLine( ...@@ -391,7 +391,7 @@ bool GPUTestExpectationsParser::ParseLine(
stage++; stage++;
break; break;
default: default:
DCHECK(false); UNREACHABLE();
break; break;
} }
} }
...@@ -467,7 +467,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig( ...@@ -467,7 +467,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig(
config->build_type() | kTokenData[token].flag); config->build_type() | kTokenData[token].flag);
break; break;
default: default:
DCHECK(false); UNREACHABLE();
break; break;
} }
return true; return true;
......
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