Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: chrome/test/base/js2gtest.gni

Issue 1953233002: Use the v8 shell instead of d8 to compile jstests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename to v8_shell Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/js_unittest_rules.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build_overrides/v8.gni") 5 import("//build_overrides/v8.gni")
6 import("//v8/snapshot_toolchain.gni") 6 import("//v8/snapshot_toolchain.gni")
7 7
8 # Variables: 8 # Variables:
9 # test_type: One of 'webui', 'unit' or 'extension' indicating what 9 # test_type: One of 'webui', 'unit' or 'extension' indicating what
10 # environment the test runs under. 10 # environment the test runs under.
(...skipping 19 matching lines...) Expand all
30 30
31 gen_source_pattern = "{{source_gen_dir}}/{{source_name_part}}-gen.cc" 31 gen_source_pattern = "{{source_gen_dir}}/{{source_name_part}}-gen.cc"
32 32
33 action_foreach(action_name) { 33 action_foreach(action_name) {
34 testonly = true 34 testonly = true
35 visibility = [ ":$source_set_name" ] 35 visibility = [ ":$source_set_name" ]
36 script = "//tools/gypv8sh.py" 36 script = "//tools/gypv8sh.py"
37 37
38 sources = invoker.sources 38 sources = invoker.sources
39 39
40 d8_path = 40 v8_shell_path = get_label_info("//v8:v8_shell($snapshot_toolchain)",
41 get_label_info("//v8:d8($snapshot_toolchain)", "root_out_dir") + "/d8" 41 "root_out_dir") + "/v8_shell"
42 if (is_win) { 42 if (is_win) {
43 d8_path += ".exe" 43 v8_shell_path += ".exe"
44 } 44 }
45 45
46 input_js = [ 46 input_js = [
47 "//chrome/third_party/mock4js/mock4js.js", 47 "//chrome/third_party/mock4js/mock4js.js",
48 "//chrome/test/data/webui/test_api.js", 48 "//chrome/test/data/webui/test_api.js",
49 "//chrome/test/base/js2gtest.js", 49 "//chrome/test/base/js2gtest.js",
50 ] 50 ]
51 inputs = [ d8_path ] + input_js 51 inputs = [ v8_shell_path ] + input_js
52 if (defined(invoker.deps_js)) { 52 if (defined(invoker.deps_js)) {
53 inputs += [ invoker.deps_js ] 53 inputs += [ invoker.deps_js ]
54 } 54 }
55 if (defined(invoker.gen_include_files)) { 55 if (defined(invoker.gen_include_files)) {
56 inputs += invoker.gen_include_files 56 inputs += invoker.gen_include_files
57 } 57 }
58 58
59 # Outputs. The script will copy the source files to the output directory, 59 # Outputs. The script will copy the source files to the output directory,
60 # which then must be treated as runtime data. The generated .cc file isn't 60 # which then must be treated as runtime data. The generated .cc file isn't
61 # data, it will be compiled in a step below. 61 # data, it will be compiled in a step below.
62 outputs = [ 62 outputs = [
63 copied_source_pattern, 63 copied_source_pattern,
64 gen_source_pattern, 64 gen_source_pattern,
65 ] 65 ]
66 data = process_file_template(sources, [ copied_source_pattern ]) 66 data = process_file_template(sources, [ copied_source_pattern ])
67 67
68 args = [] 68 args = []
69 if (defined(invoker.deps_js)) { 69 if (defined(invoker.deps_js)) {
70 args += [ 70 args += [
71 "--deps_js", 71 "--deps_js",
72 rebase_path(invoker.deps_js, root_build_dir), 72 rebase_path(invoker.deps_js, root_build_dir),
73 ] 73 ]
74 } 74 }
75 args += [ 75 args += [
76 # Need "./" for script to find binary (cur dir is not on path). 76 # Need "./" for script to find binary (cur dir is not on path).
77 "./" + rebase_path(d8_path, root_build_dir), 77 "./" + rebase_path(v8_shell_path, root_build_dir),
78 ] 78 ]
79 args += rebase_path(input_js, root_build_dir) + [ invoker.test_type ] 79 args += rebase_path(input_js, root_build_dir) + [ invoker.test_type ]
80 if (v8_use_external_startup_data) { 80 if (v8_use_external_startup_data) {
81 args += [ "--external=y" ] 81 args += [ "--external=y" ]
82 } else { 82 } else {
83 args += [ "--external=n" ] 83 args += [ "--external=n" ]
84 } 84 }
85 args += [ 85 args += [
86 "{{source}}", 86 "{{source}}",
87 "{{source_root_relative_dir}}/{{source_file_part}}", 87 "{{source_root_relative_dir}}/{{source_file_part}}",
88 gen_source_pattern, 88 gen_source_pattern,
89 rebase_path(copied_source_pattern, root_build_dir), 89 rebase_path(copied_source_pattern, root_build_dir),
90 ] 90 ]
91 91
92 deps = [ 92 deps = [
93 "//v8:d8($snapshot_toolchain)", 93 "//v8:v8_shell($snapshot_toolchain)",
94 ] 94 ]
95 if (defined(invoker.deps)) { 95 if (defined(invoker.deps)) {
96 deps += invoker.deps 96 deps += invoker.deps
97 } 97 }
98 } 98 }
99 99
100 if (defined(invoker.extra_js_files)) { 100 if (defined(invoker.extra_js_files)) {
101 copy_target_name = target_name + "_copy" 101 copy_target_name = target_name + "_copy"
102 copy(copy_target_name) { 102 copy(copy_target_name) {
103 visibility = [ ":$source_set_name" ] 103 visibility = [ ":$source_set_name" ]
(...skipping 24 matching lines...) Expand all
128 if (defined(invoker.deps)) { 128 if (defined(invoker.deps)) {
129 deps += invoker.deps 129 deps += invoker.deps
130 } 130 }
131 if (defined(invoker.extra_js_files)) { 131 if (defined(invoker.extra_js_files)) {
132 data_deps = [ 132 data_deps = [
133 ":$copy_target_name", 133 ":$copy_target_name",
134 ] 134 ]
135 } 135 }
136 } 136 }
137 } 137 }
OLDNEW
« no previous file with comments | « chrome/js_unittest_rules.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698