Commit 63526069 authored by machenbach's avatar machenbach Committed by Commit bot

[gn] Add fuzzer targets.

This adds the v8-side fuzzer executables for smoke testing.
This also renames the old gyp targets to stay consistent
with chromium.

Naming convention for type X after the rename:
library: X_fuzzer (gn), X_fuzzer_lib (gyp)
executable v8: v8_simple_X_fuzzer
executable chromium: v8_X_fuzzer

BUG=chromium:474921

Review-Url: https://codereview.chromium.org/2032363002
Cr-Commit-Position: refs/heads/master@{#36713}
parent 39442cf7
......@@ -2007,6 +2007,14 @@ v8_source_set("fuzzer_support") {
]
}
v8_source_set("simple_fuzzer") {
sources = [
"test/fuzzer/fuzzer.cc",
]
configs = [ ":internal_config_base" ]
}
###############################################################################
# Executables
#
......@@ -2052,6 +2060,11 @@ group("gn_all") {
deps = [
":d8",
":v8_simple_json_fuzzer",
":v8_simple_parser_fuzzer",
":v8_simple_regexp_fuzzer",
":v8_simple_wasm_fuzzer",
":v8_simple_wasm_asmjs_fuzzer",
]
if (want_v8_shell) {
......@@ -2179,6 +2192,19 @@ if (want_v8_shell) {
}
}
template("v8_fuzzer") {
name = target_name
forward_variables_from(invoker, "*")
executable("v8_simple_" + name) {
deps = [
":" + name,
":simple_fuzzer",
]
configs += [ ":external_config" ]
}
}
v8_source_set("json_fuzzer") {
sources = [
"test/fuzzer/json.cc",
......@@ -2191,6 +2217,8 @@ v8_source_set("json_fuzzer") {
configs = [ ":internal_config" ]
}
v8_fuzzer("json_fuzzer") {}
v8_source_set("parser_fuzzer") {
sources = [
"test/fuzzer/parser.cc",
......@@ -2203,6 +2231,8 @@ v8_source_set("parser_fuzzer") {
configs = [ ":internal_config" ]
}
v8_fuzzer("parser_fuzzer") {}
v8_source_set("regexp_fuzzer") {
sources = [
"test/fuzzer/regexp.cc",
......@@ -2215,6 +2245,8 @@ v8_source_set("regexp_fuzzer") {
configs = [ ":internal_config" ]
}
v8_fuzzer("regexp_fuzzer") {}
v8_source_set("wasm_fuzzer") {
sources = [
"test/fuzzer/wasm.cc",
......@@ -2227,6 +2259,8 @@ v8_source_set("wasm_fuzzer") {
configs = [ ":internal_config" ]
}
v8_fuzzer("wasm_fuzzer") {}
v8_source_set("wasm_asmjs_fuzzer") {
sources = [
"test/fuzzer/wasm-asmjs.cc",
......@@ -2238,3 +2272,5 @@ v8_source_set("wasm_asmjs_fuzzer") {
configs = [ ":internal_config" ]
}
v8_fuzzer("wasm_asmjs_fuzzer") {}
......@@ -9,7 +9,7 @@
'includes': ['../../gypfiles/toolchain.gypi', '../../gypfiles/features.gypi'],
'targets': [
{
'target_name': 'json_fuzzer',
'target_name': 'v8_simple_json_fuzzer',
'type': 'executable',
'dependencies': [
'json_fuzzer_lib',
......@@ -35,7 +35,7 @@
],
},
{
'target_name': 'parser_fuzzer',
'target_name': 'v8_simple_parser_fuzzer',
'type': 'executable',
'dependencies': [
'parser_fuzzer_lib',
......@@ -61,7 +61,7 @@
],
},
{
'target_name': 'regexp_fuzzer',
'target_name': 'v8_simple_regexp_fuzzer',
'type': 'executable',
'dependencies': [
'regexp_fuzzer_lib',
......@@ -87,7 +87,7 @@
],
},
{
'target_name': 'wasm_fuzzer',
'target_name': 'v8_simple_wasm_fuzzer',
'type': 'executable',
'dependencies': [
'wasm_fuzzer_lib',
......@@ -113,7 +113,7 @@
],
},
{
'target_name': 'wasm_asmjs_fuzzer',
'target_name': 'v8_simple_wasm_asmjs_fuzzer',
'type': 'executable',
'dependencies': [
'wasm_asmjs_fuzzer_lib',
......@@ -169,9 +169,11 @@
'target_name': 'fuzzer_run',
'type': 'none',
'dependencies': [
'json_fuzzer',
'parser_fuzzer',
'regexp_fuzzer',
'v8_simple_json_fuzzer',
'v8_simple_parser_fuzzer',
'v8_simple_regexp_fuzzer',
'v8_simple_wasm_fuzzer',
'v8_simple_wasm_asmjs_fuzzer',
],
'includes': [
'../../gypfiles/isolate.gypi',
......
......@@ -5,11 +5,11 @@
{
'variables': {
'files': [
'<(PRODUCT_DIR)/json_fuzzer<(EXECUTABLE_SUFFIX)',
'<(PRODUCT_DIR)/parser_fuzzer<(EXECUTABLE_SUFFIX)',
'<(PRODUCT_DIR)/regexp_fuzzer<(EXECUTABLE_SUFFIX)',
'<(PRODUCT_DIR)/wasm_fuzzer<(EXECUTABLE_SUFFIX)',
'<(PRODUCT_DIR)/wasm_asmjs_fuzzer<(EXECUTABLE_SUFFIX)',
'<(PRODUCT_DIR)/v8_simple_json_fuzzer<(EXECUTABLE_SUFFIX)',
'<(PRODUCT_DIR)/v8_simple_parser_fuzzer<(EXECUTABLE_SUFFIX)',
'<(PRODUCT_DIR)/v8_simple_regexp_fuzzer<(EXECUTABLE_SUFFIX)',
'<(PRODUCT_DIR)/v8_simple_wasm_fuzzer<(EXECUTABLE_SUFFIX)',
'<(PRODUCT_DIR)/v8_simple_wasm_asmjs_fuzzer<(EXECUTABLE_SUFFIX)',
'./fuzzer.status',
'./testcfg.py',
'./json/',
......
......@@ -26,7 +26,7 @@ class FuzzerTestSuite(testsuite.TestSuite):
def ListTests(self, context):
tests = []
for subtest in FuzzerTestSuite.SUB_TESTS:
shell = '%s_fuzzer' % subtest
shell = 'v8_simple_%s_fuzzer' % subtest
for fname in os.listdir(os.path.join(self.root, subtest)):
if not os.path.isfile(os.path.join(self.root, subtest, fname)):
continue
......
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