Add fuzz executable to GN

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2389853002

Review-Url: https://codereview.chromium.org/2389853002
This commit is contained in:
kjlubick 2016-10-03 11:49:45 -07:00 committed by Commit bot
parent e2f732f475
commit 14f984bc6b
2 changed files with 19 additions and 3 deletions

View File

@ -987,4 +987,20 @@ if (skia_enable_tools) {
]
testonly = true
}
executable("fuzz") {
sources = [
"fuzz/FilterFuzz.cpp",
"fuzz/FuzzGradients.cpp",
"fuzz/FuzzParsePath.cpp",
"fuzz/FuzzPathop.cpp",
"fuzz/FuzzScaleToSides.cpp",
"fuzz/fuzz.cpp",
]
deps = [
":flags",
":skia",
]
testonly = true
}
}

View File

@ -13,7 +13,7 @@
// Most of this is taken from random_parse_path.cpp and adapted to use the Fuzz
// instead of SKRandom
const struct Legal {
static const struct Legal {
char fSymbol;
int fScalars;
} gLegal[] = {
@ -29,10 +29,10 @@ const struct Legal {
{ 'Z', 0 },
};
bool gEasy = false; // set to true while debugging to suppress unusual whitespace
static bool gEasy = false; // set to true while debugging to suppress unusual whitespace
// mostly do nothing, then bias towards spaces
const char gWhiteSpace[] = { 0, 0, 0, 0, 0, 0, 0, 0, ' ', ' ', ' ', ' ', 0x09, 0x0D, 0x0A };
static const char gWhiteSpace[] = { 0, 0, 0, 0, 0, 0, 0, 0, ' ', ' ', ' ', ' ', 0x09, 0x0D, 0x0A };
static void add_white(Fuzz* fuzz, SkString* atom) {
if (gEasy) {