33#ifdef SK_BUILD_FOR_ANDROID
34#include <sys/system_properties.h>
43static std::vector<SkQP::UnitTest>
get_unit_tests(
int enforcedAndroidAPILevel) {
44 std::vector<SkQP::UnitTest> unitTests;
46 const auto ctsMode =
test.fCTSEnforcement.eval(enforcedAndroidAPILevel);
49 "Non-GPU test was included in SkQP: %s\n",
test.fName);
50 unitTests.push_back(&
test);
54 std::sort(unitTests.begin(), unitTests.end(), lt);
71 int enforcedAndroidAPILevel) {
72 std::vector<SkQP::SkSLErrorTest> skslErrorTests;
73 auto iterateFn = [&](
const char* directory,
const char* extension) {
74 std::vector<std::string> paths = assetManager->
iterateDir(directory, extension);
75 for (
const std::string&
path : paths) {
78 if (std::regex_match(
name.c_str(), exclusionEntry.first) &&
79 exclusionEntry.second.eval(enforcedAndroidAPILevel) ==
88 skslErrorTests.push_back({
90 std::string(
static_cast<const char*
>(shaderText->
data()), shaderText->
size())
96 iterateFn(
"sksl/errors/",
".rts");
97 iterateFn(
"sksl/runtime_errors/",
".rts");
100 return a.name <
b.name;
102 std::sort(skslErrorTests.begin(), skslErrorTests.end(), lt);
103 return skslErrorTests;
122 fReportDirectory = reportDirectory;
127#ifdef SK_BUILD_FOR_ANDROID
134 char minAPIVersionStr[PROP_VALUE_MAX];
135 int strLength = __system_property_get(
"ro.vendor.api_level", minAPIVersionStr);
136 if (strLength != 0) {
137 fEnforcedAndroidAPILevel = atoi(minAPIVersionStr);
144 printBackendInfo((fReportDirectory +
"/grdump.txt").c_str());
149 std::vector<std::string> fErrors;
152 fErrors.push_back(std::string(
desc.c_str(),
desc.size()));
158 if (
test->fCTSEnforcement.eval(fEnforcedAndroidAPILevel) ==
160 options.fDisableDriverCorrectnessWorkarounds =
true;
162 if (
test->fGaneshContextOptionsProc) {
170 if (
test->fCTSEnforcement.eval(fEnforcedAndroidAPILevel) ==
172 options.fContextOptions.fDisableDriverCorrectnessWorkarounds =
true;
174 if (
test->fGraphiteContextOptionsProc) {
175 test->fGraphiteContextOptionsProc(&
options.fContextOptions);
181 fTestResults.push_back(TestResult{
test->fName, r.fErrors});
193 if (!
sk_isdir(fReportDirectory.c_str())) {
194 SkDebugf(
"Report destination does not exist: '%s'\n", fReportDirectory.c_str());
199 for (
const SkQP::TestResult&
result : fTestResults) {
201 if (
result.errors.empty()) {
205 for (
const std::string& err :
result.errors) {
sk_sp< SkData > GetResourceAsData(const char *resource)
#define SkASSERT_RELEASE(cond)
#define SkASSERTF(cond, fmt,...)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
bool sk_isdir(const char *path)
static std::vector< SkPDFIndirectReference > sort(const THashSet< SkPDFIndirectReference > &src)
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
const void * data() const
static SkString Join(const char *rootPath, const char *relativePath)
static SkString Basename(const char *fullPath)
virtual std::vector< std::string > iterateDir(const char *directory, const char *extension)=0
std::vector< std::string > executeTest(UnitTest)
void init(SkQPAssetManager *assetManager, const char *reportDirectory)
static const char * GetUnitTestName(UnitTest)
const char * c_str() const
virtual bool write(const void *buffer, size_t size)=0
bool writeText(const char text[])
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_SWITCHES_START aot vmservice shared library name
void write(SkWStream *wStream, const T &text)
static const std::pair< std::regex, CtsEnforcement > sExclusionRulesForSkSLTests[]
static std::vector< SkQP::UnitTest > get_unit_tests(int enforcedAndroidAPILevel)
static constexpr char kUnitTestReportPath[]
TestHarness CurrentTestHarness()
static std::vector< SkQP::SkSLErrorTest > get_sksl_error_tests(SkQPAssetManager *assetManager, int enforcedAndroidAPILevel)
SkString toString() const