Commit 4628f386 by Yuly Novikov Committed by Commit Bot

Add dEQP search paths on Android devices

Including: test expectations and list, dEQP data and test results. Hardcode chromium_tests_root for now, to avoid adding a new API to pass the path from test runner to ANGLE. BUG=angleproject:1471 Change-Id: I654fa4727c436d743b3d6344ad17cb030934cde2 Reviewed-on: https://chromium-review.googlesource.com/368984 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent b2e4863c
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "common/angleutils.h" #include "common/angleutils.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/Optional.h" #include "common/Optional.h"
#include "common/platform.h"
#include "common/string_utils.h" #include "common/string_utils.h"
#include "gpu_test_expectations_parser.h" #include "gpu_test_expectations_parser.h"
#include "system_utils.h" #include "system_utils.h"
...@@ -23,11 +24,16 @@ ...@@ -23,11 +24,16 @@
namespace namespace
{ {
#if defined(ANGLE_PLATFORM_ANDROID)
const char *g_CaseListRelativePath =
"/../../sdcard/chromium_tests_root/third_party/deqp/src/android/cts/master/";
#else
const char *g_CaseListRelativePath = "/../../third_party/deqp/src/android/cts/master/"; const char *g_CaseListRelativePath = "/../../third_party/deqp/src/android/cts/master/";
#endif
const char *g_TestExpectationsSearchPaths[] = { const char *g_TestExpectationsSearchPaths[] = {
"/../../src/tests/deqp_support/", "/../../third_party/angle/src/tests/deqp_support/", "/../../src/tests/deqp_support/", "/../../third_party/angle/src/tests/deqp_support/",
"/deqp_support/", "/deqp_support/", "/../../sdcard/chromium_tests_root/third_party/angle/src/tests/deqp_support/",
}; };
const char *g_CaseListFiles[] = { const char *g_CaseListFiles[] = {
......
...@@ -44,15 +44,15 @@ tcu::TestContext *g_testCtx = nullptr; ...@@ -44,15 +44,15 @@ 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[] = const char *g_dEQPDataSearchDirs[] = {
{
"data", "data",
"third_party/deqp/data", "third_party/deqp/data",
"../third_party/deqp/src/data", "../third_party/deqp/src/data",
"deqp_support/data", "deqp_support/data",
"third_party/deqp/src/data", "third_party/deqp/src/data",
"../../third_party/deqp/src/data", "../../third_party/deqp/src/data",
"../../../third_party/deqp/src/data" "../../../third_party/deqp/src/data",
"../../sdcard/chromium_tests_root/third_party/deqp/src/data",
}; };
// TODO(jmadill): upstream to dEQP? // TODO(jmadill): upstream to dEQP?
...@@ -85,14 +85,14 @@ bool FindDataDir(std::string *dataDir) ...@@ -85,14 +85,14 @@ bool FindDataDir(std::string *dataDir)
{ {
for (auto searchDir : g_dEQPDataSearchDirs) for (auto searchDir : g_dEQPDataSearchDirs)
{ {
if (deIsDir(searchDir)) if (deIsDir((std::string(searchDir) + "/gles2").c_str()))
{ {
*dataDir = searchDir; *dataDir = searchDir;
return true; return true;
} }
std::string directory = angle::GetExecutableDirectory() + "/" + searchDir; std::string directory = angle::GetExecutableDirectory() + "/" + searchDir;
if (deIsDir(directory.c_str())) if (deIsDir((directory + "/gles2").c_str()))
{ {
*dataDir = directory; *dataDir = directory;
return true; return true;
...@@ -102,6 +102,16 @@ bool FindDataDir(std::string *dataDir) ...@@ -102,6 +102,16 @@ bool FindDataDir(std::string *dataDir)
return false; return false;
} }
std::string GetLogFileName(std::string deqpDataDir)
{
#if (DE_OS == DE_OS_ANDROID)
// On Android executable dir is not writable, so use data dir instead
return deqpDataDir + "/" + g_cmdLine->getLogFileName();
#else
return g_cmdLine->getLogFileName();
#endif
}
bool InitPlatform(int argc, const char *argv[]) bool InitPlatform(int argc, const char *argv[])
{ {
try try
...@@ -127,7 +137,7 @@ bool InitPlatform(int argc, const char *argv[]) ...@@ -127,7 +137,7 @@ bool InitPlatform(int argc, const char *argv[])
g_cmdLine = new tcu::CommandLine(argc, argv); g_cmdLine = new tcu::CommandLine(argc, argv);
g_archive = new tcu::DirArchive(deqpDataDir.c_str()); g_archive = new tcu::DirArchive(deqpDataDir.c_str());
g_log = new tcu::TestLog(g_cmdLine->getLogFileName(), g_cmdLine->getLogFlags()); g_log = new tcu::TestLog(GetLogFileName(deqpDataDir).c_str(), 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);
g_root = new tcu::TestPackageRoot(*g_testCtx, tcu::TestPackageRegistry::getSingleton()); g_root = new tcu::TestPackageRoot(*g_testCtx, tcu::TestPackageRegistry::getSingleton());
g_executor = new tcu::RandomOrderExecutor(*g_root, *g_testCtx); g_executor = new tcu::RandomOrderExecutor(*g_root, *g_testCtx);
......
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