23 StdAssetManager(
const char*
p) : fPrefix(
p) {
32 std::vector<std::string>
iterateDir(
const char* directory,
const char* extension)
override {
33 std::vector<std::string> paths;
38 while (iter.next(&
name,
false)) {
40 paths.push_back(
path.c_str());
58 " [~][^]substring[$] [...] of name to run.\n"
59 " Multiple matches may be separated by spaces.\n"
60 " ~ causes a matching name to always be skipped\n"
61 " ^ requires the start of the name to match\n"
62 " $ requires the end of the name to match\n"
63 " ^ and $ requires an exact match\n"
64 " If a name does not match any list entry,\n"
65 " it is skipped unless some list entry starts with ~\n";
68 size_t testLen = strlen(
name);
69 bool anyExclude =
count == 0;
71 const char* matchName = rules[
i];
72 size_t matchLen = strlen(matchName);
73 bool matchExclude, matchStart, matchEnd;
74 if ((matchExclude = matchName[0] ==
'~')) {
79 if ((matchStart = matchName[0] ==
'^')) {
83 if ((matchEnd = matchName[matchLen - 1] ==
'$')) {
86 if (matchStart ? (!matchEnd || matchLen == testLen)
87 && strncmp(
name, matchName, matchLen) == 0
88 : matchEnd ? matchLen <= testLen
89 && strncmp(
name + testLen - matchLen, matchName, matchLen) == 0
90 : strstr(
name, matchName) !=
nullptr) {
99 std::cerr <<
"Usage:\n " <<
argv[0] <<
" ASSET_DIR OUTPUT_DIR [TEST_MATCH_RULES]\n"
113 std::cerr <<
"sk_mkdir(" <<
args.outputDir <<
") failed.\n";
117 StdAssetManager mgr(
args.assetDir);
122 const char*
const* matchRules = &
argv[3];
123 size_t matchRulesCount = (size_t)(argc - 3);
131 std::cout <<
"Starting: " <<
testName <<
" ";
134 std::cout <<
"[FAILED: " <<
errors.size() <<
" error(s)]" << std::endl;
136 std::cout <<
" " <<
error << std::endl;
140 std::cout <<
"[PASSED]" << std::endl;
void SetResourcePath(const char *resource)
SkString GetResourcePath(const char *resource)
bool sk_mkdir(const char *path)
static sk_sp< SkData > MakeFromFileName(const char path[])
static SkString Join(const char *rootPath, const char *relativePath)
virtual sk_sp< SkData > open(const char *path)=0
virtual std::vector< std::string > iterateDir(const char *directory, const char *extension)=0
const std::vector< UnitTest > & getUnitTests() const
std::vector< std::string > executeTest(UnitTest)
void init(SkQPAssetManager *assetManager, const char *reportDirectory)
static const char * GetUnitTestName(UnitTest)
const char * c_str() const
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const uint8_t uint32_t uint32_t GError ** error
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
def subpath(path, base_dir)
int main(int argc, char *argv[])
static bool should_skip(const char *const *rules, size_t count, const char *name)
static constexpr char kSkipUsage[]
static void parse_args(int argc, char *argv[], Args *args)