Commit b8229434 authored by yangguo's avatar yangguo Committed by Commit bot

Reland [inspector] add inspector protocol parser test build target.

BUG=chromium:580337

Review-Url: https://codereview.chromium.org/2190833004
Cr-Commit-Position: refs/heads/master@{#38135}
parent 6e01fe20
......@@ -48,7 +48,6 @@ shell_g
/obj
/out
/out.gn
/platform/inspector_protocol
/perf.data
/perf.data.old
/test/benchmarks/data
......@@ -63,9 +62,15 @@ shell_g
/testing/gmock
/testing/gtest
/third_party
/third_party/android_tools
/third_party/cygwin
/third_party/icu
/third_party/inspector_protocol
/third_party/jinga2
/third_party/llvm
/third_party/llvm-build
/third_party/markupsafe
/third_party/WebKit
/tools/clang
/tools/gcmole/gcmole-tools
/tools/gcmole/gcmole-tools.tar.gz
......
......@@ -17,8 +17,12 @@ deps = {
Var("git_url") + "/chromium/buildtools.git" + "@" + "67bf0653b2eb9eabd4fc17c4bf2df828e904a558",
"v8/base/trace_event/common":
Var("git_url") + "/chromium/src/base/trace_event/common.git" + "@" + "315bf1e2d45be7d53346c31cfcc37424a32c30c8",
"v8/platform/inspector_protocol":
Var("git_url") + "/chromium/src/third_party/WebKit/Source/platform/inspector_protocol.git" + "@" + "f49542089820a34a9a6e33264e09b73779407512",
"v8/third_party/WebKit/Source/platform/inspector_protocol":
Var("git_url") + "/chromium/src/third_party/WebKit/Source/platform/inspector_protocol.git" + "@" + "35e3f59ad05d994f163e82f9e644f18f9e708fec",
"v8/third_party/jinja2":
Var("git_url") + "/chromium/src/third_party/jinja2.git" + "@" + "2222b31554f03e62600cd7e383376a7c187967a1",
"v8/third_party/markupsafe":
Var("git_url") + "/chromium/src/third_party/markupsafe.git" + "@" + "484a5661041cac13bfc688a26ec5434b05d18961",
"v8/tools/mb":
Var('git_url') + '/chromium/src/tools/mb.git' + '@' + "1d3f4544cadd78d89c8c71c37ef5474ac2b1e297",
"v8/tools/swarming_client":
......
......@@ -22,8 +22,9 @@
'../samples/samples.gyp:*',
'../test/cctest/cctest.gyp:*',
'../test/fuzzer/fuzzer.gyp:*',
'../test/inspector_protocol_parser_test/inspector_protocol_parser_test.gyp:*',
'../test/unittests/unittests.gyp:*',
],
],
}],
['test_isolation_mode != "noop"', {
'dependencies': [
......
......@@ -233,6 +233,9 @@
# Relative path to icu.gyp from this file.
'icu_gyp_path': '../third_party/icu/icu.gyp',
# Relative path to inspector.gyp from this file.
'inspector_gyp_path': '../src/v8-inspector/inspector.gyp',
'conditions': [
['(v8_target_arch=="arm" and host_arch!="arm") or \
(v8_target_arch=="arm64" and host_arch!="arm64") or \
......
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
protocol_path = "//third_party/WebKit/Source/platform/inspector_protocol"
protocol_sources = [
"$target_gen_dir/Console.cpp",
"$target_gen_dir/Console.h",
"$target_gen_dir/Debugger.cpp",
"$target_gen_dir/Debugger.h",
"$target_gen_dir/HeapProfiler.cpp",
"$target_gen_dir/HeapProfiler.h",
"$target_gen_dir/Profiler.cpp",
"$target_gen_dir/Profiler.h",
"$target_gen_dir/Runtime.cpp",
"$target_gen_dir/Runtime.h",
]
action("inspector_protocol_sources") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
script = "$protocol_path/CodeGenerator.py"
sources = [
"$protocol_path/CodeGenerator.py",
"$protocol_path/Exported_h.template",
"$protocol_path/Imported_h.template",
"$protocol_path/TypeBuilder_cpp.template",
"$protocol_path/TypeBuilder_h.template",
]
inputs = [
"js_protocol.json",
]
outputs = protocol_sources
args = [
"--protocol",
rebase_path("js_protocol.json", root_build_dir),
"--string_type",
"String",
"--export_macro",
"PLATFORM_EXPORT",
"--output_dir",
rebase_path(target_gen_dir, root_build_dir),
"--output_package",
"inspector",
]
}
config("inspector_protocol_config") {
include_dirs = [
"$protocol_path/../..",
]
defines = [
"V8_INSPECTOR_USE_STL"
]
cflags = []
if (is_win) {
cflags += [
"/wd4305", # Truncation from 'type1' to 'type2'.
"/wd4324", # Struct padded due to declspec(align).
"/wd4714", # Function marked forceinline not inlined.
"/wd4800", # Value forced to bool.
"/wd4996", # Deprecated function call.
]
}
}
source_set("inspector_protocol") {
deps = [
":inspector_protocol_sources",
]
configs += [
":inspector_protocol_config"
]
include_dirs = [
"$target_gen_dir/..",
]
sources = protocol_sources + [
"$protocol_path/Allocator.h",
"$protocol_path/Array.h",
"$protocol_path/BackendCallback.h",
"$protocol_path/CodeGenerator.py",
"$protocol_path/Collections.h",
"$protocol_path/DispatcherBase.cpp",
"$protocol_path/DispatcherBase.h",
"$protocol_path/ErrorSupport.cpp",
"$protocol_path/ErrorSupport.h",
"$protocol_path/FrontendChannel.h",
"$protocol_path/Maybe.h",
"$protocol_path/Object.cpp",
"$protocol_path/Object.h",
"$protocol_path/Parser.cpp",
"$protocol_path/Parser.h",
"$protocol_path/Platform.h",
"$protocol_path/PlatformSTL.h",
"$protocol_path/String16.h",
"$protocol_path/String16STL.cpp",
"$protocol_path/String16STL.h",
"$protocol_path/ValueConversions.h",
"$protocol_path/Values.cpp",
"$protocol_path/Values.h",
]
}
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{ 'variables': {
'protocol_path': '../../third_party/WebKit/Source/platform/inspector_protocol',
'protocol_sources': [
'<(SHARED_INTERMEDIATE_DIR)/inspector/Console.cpp',
'<(SHARED_INTERMEDIATE_DIR)/inspector/Console.h',
'<(SHARED_INTERMEDIATE_DIR)/inspector/Debugger.cpp',
'<(SHARED_INTERMEDIATE_DIR)/inspector/Debugger.h',
'<(SHARED_INTERMEDIATE_DIR)/inspector/HeapProfiler.cpp',
'<(SHARED_INTERMEDIATE_DIR)/inspector/HeapProfiler.h',
'<(SHARED_INTERMEDIATE_DIR)/inspector/Profiler.cpp',
'<(SHARED_INTERMEDIATE_DIR)/inspector/Profiler.h',
'<(SHARED_INTERMEDIATE_DIR)/inspector/Runtime.cpp',
'<(SHARED_INTERMEDIATE_DIR)/inspector/Runtime.h',
]
},
'targets': [
{ 'target_name': 'inspector_protocol_sources',
'type': 'none',
'variables': {
'jinja_module_files': [
# jinja2/__init__.py contains version string, so sufficient for package
'../third_party/jinja2/__init__.py',
'../third_party/markupsafe/__init__.py', # jinja2 dep
]
},
'actions': [
{
'action_name': 'generate_inspector_protocol_sources',
'inputs': [
# Source generator script.
'<(protocol_path)/CodeGenerator.py',
# Source code templates.
'<(protocol_path)/Exported_h.template',
'<(protocol_path)/Imported_h.template',
'<(protocol_path)/TypeBuilder_h.template',
'<(protocol_path)/TypeBuilder_cpp.template',
# Protocol definition.
'js_protocol.json',
],
'outputs': [
'<@(protocol_sources)',
],
'action': [
'python',
'<(protocol_path)/CodeGenerator.py',
'--protocol', 'js_protocol.json',
'--string_type', 'String',
'--export_macro', 'PLATFORM_EXPORT',
'--output_dir', '<(SHARED_INTERMEDIATE_DIR)/inspector',
'--output_package', 'inspector',
],
'message': 'Generating Inspector protocol backend sources from json definitions',
},
]
},
{ 'target_name': 'inspector_protocol',
'type': 'static_library',
'dependencies': [
'inspector_protocol_sources',
],
'include_dirs+': [
'<(protocol_path)/../..',
'<(SHARED_INTERMEDIATE_DIR)',
],
'defines': [
'V8_INSPECTOR_USE_STL',
],
'sources': [
'<@(protocol_sources)',
'<(protocol_path)/Allocator.h',
'<(protocol_path)/Array.h',
'<(protocol_path)/BackendCallback.h',
'<(protocol_path)/CodeGenerator.py',
'<(protocol_path)/Collections.h',
'<(protocol_path)/DispatcherBase.cpp',
'<(protocol_path)/DispatcherBase.h',
'<(protocol_path)/ErrorSupport.cpp',
'<(protocol_path)/ErrorSupport.h',
'<(protocol_path)/FrontendChannel.h',
'<(protocol_path)/Maybe.h',
'<(protocol_path)/Object.cpp',
'<(protocol_path)/Object.h',
'<(protocol_path)/Parser.cpp',
'<(protocol_path)/Parser.h',
'<(protocol_path)/Platform.h',
'<(protocol_path)/PlatformSTL.h',
'<(protocol_path)/String16.h',
'<(protocol_path)/String16STL.cpp',
'<(protocol_path)/String16STL.h',
'<(protocol_path)/ValueConversions.h',
'<(protocol_path)/Values.cpp',
'<(protocol_path)/Values.h',
]
},
],
}
This diff is collapsed.
......@@ -17,6 +17,7 @@ group("gn_all") {
"cctest:cctest",
"cctest:generate-bytecode-expectations",
"unittests:unittests",
"inspector_protocol_parser_test:inspector_protocol_parser_test",
]
}
......
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("../../gni/v8.gni")
v8_executable("inspector_protocol_parser_test") {
testonly = true
deps = [
"../../src/inspector:inspector_protocol",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
"//testing/gmock",
"//testing/gtest",
]
configs = [
"../../src/inspector:inspector_protocol_config"
]
sources = [
"//third_party/WebKit/Source/platform/inspector_protocol/ParserTest.cpp",
"RunTests.cpp",
]
}
include_rules = [
"+testing"
]
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "testing/gmock/include/gmock/gmock.h"
namespace {
class InspectorProtocolTestEnvironment final : public ::testing::Environment {};
} // namespace
int main(int argc, char** argv) {
testing::InitGoogleMock(&argc, argv);
testing::AddGlobalTestEnvironment(new InspectorProtocolTestEnvironment);
return RUN_ALL_TESTS();
}
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{ 'variables': {
'protocol_path': '../../third_party/WebKit/Source/platform/inspector_protocol',
},
'targets': [
{ 'target_name': 'inspector_protocol_parser_test',
'type': 'executable',
'dependencies': [
'../../src/inspector/inspector.gyp:inspector_protocol',
'../../testing/gmock.gyp:gmock',
'../../testing/gtest.gyp:gtest',
],
'include_dirs+': [
'../..',
'<(protocol_path)/../..',
],
'defines': [
'V8_INSPECTOR_USE_STL',
],
'sources': [
'<(protocol_path)/ParserTest.cpp',
'RunTests.cpp',
]
},
],
}
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