[email protected] | e3730f81 | 2013-10-16 16:46:14 | [diff] [blame] | 1 | # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
qsr | fb5251d1 | 2015-01-21 15:57:22 | [diff] [blame] | 5 | import("//testing/test.gni") |
| 6 | |
[email protected] | 1539320 | 2014-03-27 21:08:35 | [diff] [blame] | 7 | defines = [ "GN_BUILD" ] |
[email protected] | 9af0b83 | 2013-11-08 20:31:13 | [diff] [blame] | 8 | |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 9 | static_library("gn_lib") { |
brettw | 3dab5fe | 2015-06-29 23:00:15 | [diff] [blame^] | 10 | configs += [ "//build/config:precompiled_headers" ] |
| 11 | |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 12 | sources = [ |
[email protected] | 2fbe101 | 2014-03-20 17:59:15 | [diff] [blame] | 13 | "action_target_generator.cc", |
| 14 | "action_target_generator.h", |
| 15 | "action_values.cc", |
| 16 | "action_values.h", |
[email protected] | 60749e1c | 2013-08-19 21:11:05 | [diff] [blame] | 17 | "args.cc", |
| 18 | "args.h", |
[email protected] | c0822d7f | 2013-08-13 17:10:56 | [diff] [blame] | 19 | "binary_target_generator.cc", |
| 20 | "binary_target_generator.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 21 | "build_settings.cc", |
| 22 | "build_settings.h", |
[email protected] | 26542b0 | 2013-11-08 23:25:04 | [diff] [blame] | 23 | "builder.cc", |
| 24 | "builder.h", |
| 25 | "builder_record.cc", |
| 26 | "builder_record.h", |
[email protected] | 126d8b5 | 2014-04-07 22:17:35 | [diff] [blame] | 27 | "c_include_iterator.cc", |
| 28 | "c_include_iterator.h", |
[email protected] | 60749e1c | 2013-08-19 21:11:05 | [diff] [blame] | 29 | "command_args.cc", |
[email protected] | 126d8b5 | 2014-04-07 22:17:35 | [diff] [blame] | 30 | "command_check.cc", |
tfarina | 7ad2166 | 2015-02-17 22:17:33 | [diff] [blame] | 31 | "command_clean.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 32 | "command_desc.cc", |
scottmg | 2dd93e8b | 2014-09-26 04:07:05 | [diff] [blame] | 33 | "command_format.cc", |
tfarina | 7ad2166 | 2015-02-17 22:17:33 | [diff] [blame] | 34 | "command_gen.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 35 | "command_help.cc", |
brettw | 3741b72 | 2014-08-29 17:07:20 | [diff] [blame] | 36 | "command_ls.cc", |
brettw | 14769fd | 2015-05-19 22:22:28 | [diff] [blame] | 37 | "command_path.cc", |
[email protected] | 60749e1c | 2013-08-19 21:11:05 | [diff] [blame] | 38 | "command_refs.cc", |
[email protected] | 93c19fd2 | 2013-08-06 19:34:44 | [diff] [blame] | 39 | "commands.cc", |
| 40 | "commands.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 41 | "config.cc", |
| 42 | "config.h", |
[email protected] | 93c19fd2 | 2013-08-06 19:34:44 | [diff] [blame] | 43 | "config_values.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 44 | "config_values.h", |
| 45 | "config_values_extractors.cc", |
| 46 | "config_values_extractors.h", |
| 47 | "config_values_generator.cc", |
| 48 | "config_values_generator.h", |
[email protected] | c0822d7f | 2013-08-13 17:10:56 | [diff] [blame] | 49 | "copy_target_generator.cc", |
| 50 | "copy_target_generator.h", |
brettw | c2e821a3 | 2014-09-17 01:07:14 | [diff] [blame] | 51 | "deps_iterator.cc", |
| 52 | "deps_iterator.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 53 | "err.cc", |
| 54 | "err.h", |
| 55 | "escape.cc", |
| 56 | "escape.h", |
cjhopman | 5579301 | 2014-10-16 19:19:40 | [diff] [blame] | 57 | "exec_process.cc", |
| 58 | "exec_process.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 59 | "filesystem_utils.cc", |
| 60 | "filesystem_utils.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 61 | "function_exec_script.cc", |
[email protected] | 92cafe5 | 2014-05-13 19:42:25 | [diff] [blame] | 62 | "function_foreach.cc", |
[email protected] | 7380ca7 | 2014-05-13 16:56:20 | [diff] [blame] | 63 | "function_get_label_info.cc", |
[email protected] | 01bd79b | 2014-06-05 17:36:25 | [diff] [blame] | 64 | "function_get_path_info.cc", |
[email protected] | e1bd79f | 2014-05-05 20:27:53 | [diff] [blame] | 65 | "function_get_target_outputs.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 66 | "function_process_file_template.cc", |
| 67 | "function_read_file.cc", |
[email protected] | ea3690c | 2013-09-23 17:59:22 | [diff] [blame] | 68 | "function_rebase_path.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 69 | "function_set_default_toolchain.cc", |
[email protected] | 6b4ee78 | 2013-08-20 17:13:24 | [diff] [blame] | 70 | "function_set_defaults.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 71 | "function_template.cc", |
| 72 | "function_toolchain.cc", |
| 73 | "function_write_file.cc", |
scottmg | 7c7296f4 | 2015-02-28 02:23:09 | [diff] [blame] | 74 | "functions.cc", |
| 75 | "functions.h", |
| 76 | "functions_target.cc", |
[email protected] | c0822d7f | 2013-08-13 17:10:56 | [diff] [blame] | 77 | "group_target_generator.cc", |
| 78 | "group_target_generator.h", |
[email protected] | 126d8b5 | 2014-04-07 22:17:35 | [diff] [blame] | 79 | "header_checker.cc", |
| 80 | "header_checker.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 81 | "import_manager.cc", |
| 82 | "import_manager.h", |
brettw | 54d76753 | 2015-04-16 17:40:49 | [diff] [blame] | 83 | "inherited_libraries.cc", |
| 84 | "inherited_libraries.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 85 | "input_conversion.cc", |
| 86 | "input_conversion.h", |
| 87 | "input_file.cc", |
| 88 | "input_file.h", |
| 89 | "input_file_manager.cc", |
| 90 | "input_file_manager.h", |
| 91 | "item.cc", |
| 92 | "item.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 93 | "label.cc", |
| 94 | "label.h", |
brettw | 3741b72 | 2014-08-29 17:07:20 | [diff] [blame] | 95 | "label_pattern.cc", |
| 96 | "label_pattern.h", |
[email protected] | 68d1dd3 | 2013-11-01 21:59:51 | [diff] [blame] | 97 | "label_ptr.h", |
[email protected] | 26542b0 | 2013-11-08 23:25:04 | [diff] [blame] | 98 | "loader.cc", |
| 99 | "loader.h", |
[email protected] | b0d3ad5d | 2013-09-16 23:31:36 | [diff] [blame] | 100 | "location.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 101 | "location.h", |
[email protected] | 2fbe101 | 2014-03-20 17:59:15 | [diff] [blame] | 102 | "ninja_action_target_writer.cc", |
| 103 | "ninja_action_target_writer.h", |
[email protected] | c0822d7f | 2013-08-13 17:10:56 | [diff] [blame] | 104 | "ninja_binary_target_writer.cc", |
| 105 | "ninja_binary_target_writer.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 106 | "ninja_build_writer.cc", |
| 107 | "ninja_build_writer.h", |
[email protected] | c0822d7f | 2013-08-13 17:10:56 | [diff] [blame] | 108 | "ninja_copy_target_writer.cc", |
| 109 | "ninja_copy_target_writer.h", |
| 110 | "ninja_group_target_writer.cc", |
| 111 | "ninja_group_target_writer.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 112 | "ninja_target_writer.cc", |
| 113 | "ninja_target_writer.h", |
| 114 | "ninja_toolchain_writer.cc", |
| 115 | "ninja_toolchain_writer.h", |
scottmg | 7c7296f4 | 2015-02-28 02:23:09 | [diff] [blame] | 116 | "ninja_utils.cc", |
| 117 | "ninja_utils.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 118 | "ninja_writer.cc", |
| 119 | "ninja_writer.h", |
| 120 | "operators.cc", |
| 121 | "operators.h", |
[email protected] | 0dfcae7 | 2014-08-19 22:52:16 | [diff] [blame] | 122 | "output_file.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 123 | "output_file.h", |
| 124 | "parse_tree.cc", |
| 125 | "parse_tree.h", |
| 126 | "parser.cc", |
| 127 | "parser.h", |
| 128 | "path_output.cc", |
| 129 | "path_output.h", |
| 130 | "pattern.cc", |
| 131 | "pattern.h", |
brettw | 0db9185 | 2015-05-14 23:40:20 | [diff] [blame] | 132 | "runtime_deps.cc", |
| 133 | "runtime_deps.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 134 | "scheduler.cc", |
| 135 | "scheduler.h", |
| 136 | "scope.cc", |
| 137 | "scope.h", |
| 138 | "scope_per_file_provider.cc", |
| 139 | "scope_per_file_provider.h", |
| 140 | "settings.cc", |
| 141 | "settings.h", |
| 142 | "setup.cc", |
| 143 | "setup.h", |
| 144 | "source_dir.cc", |
| 145 | "source_dir.h", |
| 146 | "source_file.cc", |
| 147 | "source_file.h", |
[email protected] | 0dfcae7 | 2014-08-19 22:52:16 | [diff] [blame] | 148 | "source_file_type.cc", |
| 149 | "source_file_type.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 150 | "standard_out.cc", |
| 151 | "standard_out.h", |
| 152 | "string_utils.cc", |
| 153 | "string_utils.h", |
[email protected] | 012db594 | 2014-08-06 20:38:45 | [diff] [blame] | 154 | "substitution_list.cc", |
| 155 | "substitution_list.h", |
| 156 | "substitution_pattern.cc", |
| 157 | "substitution_pattern.h", |
| 158 | "substitution_type.cc", |
| 159 | "substitution_type.h", |
| 160 | "substitution_writer.cc", |
| 161 | "substitution_writer.h", |
brettw | 86a7f4bd | 2014-11-26 22:07:28 | [diff] [blame] | 162 | "switches.cc", |
| 163 | "switches.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 164 | "target.cc", |
| 165 | "target.h", |
| 166 | "target_generator.cc", |
| 167 | "target_generator.h", |
[email protected] | a4e86292 | 2014-03-27 21:16:22 | [diff] [blame] | 168 | "template.cc", |
| 169 | "template.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 170 | "token.cc", |
| 171 | "token.h", |
| 172 | "tokenizer.cc", |
scottmg | 7c7296f4 | 2015-02-28 02:23:09 | [diff] [blame] | 173 | "tokenizer.h", |
[email protected] | 0dfcae7 | 2014-08-19 22:52:16 | [diff] [blame] | 174 | "tool.cc", |
| 175 | "tool.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 176 | "toolchain.cc", |
| 177 | "toolchain.h", |
[email protected] | 7f8c9fc | 2013-09-23 18:08:28 | [diff] [blame] | 178 | "trace.cc", |
| 179 | "trace.h", |
[email protected] | 8fc5618 | 2014-08-06 21:44:33 | [diff] [blame] | 180 | "unique_vector.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 181 | "value.cc", |
| 182 | "value.h", |
| 183 | "value_extractors.cc", |
| 184 | "value_extractors.h", |
[email protected] | 4441041b | 2013-08-06 21:11:06 | [diff] [blame] | 185 | "variables.cc", |
| 186 | "variables.h", |
[email protected] | 60c9d17 | 2014-04-01 21:45:11 | [diff] [blame] | 187 | "visibility.cc", |
| 188 | "visibility.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 189 | ] |
[email protected] | 9af0b83 | 2013-11-08 20:31:13 | [diff] [blame] | 190 | |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 191 | deps = [ |
| 192 | "//base", |
| 193 | "//base/third_party/dynamic_annotations", |
| 194 | ] |
| 195 | } |
| 196 | |
Brett Wilson | 48c29f2 | 2014-08-25 19:06:58 | [diff] [blame] | 197 | action("last_commit_position") { |
| 198 | script = "last_commit_position.py" |
| 199 | |
| 200 | # This dependency forces a re-run when the code is synced. |
scottmg | 34fb7e5 | 2014-12-03 23:27:24 | [diff] [blame] | 201 | inputs = [ |
| 202 | "//build/util/LASTCHANGE", |
| 203 | ] |
Brett Wilson | 48c29f2 | 2014-08-25 19:06:58 | [diff] [blame] | 204 | |
| 205 | outfile = "$target_gen_dir/last_commit_position.h" |
scottmg | 34fb7e5 | 2014-12-03 23:27:24 | [diff] [blame] | 206 | outputs = [ |
| 207 | outfile, |
| 208 | ] |
Brett Wilson | 48c29f2 | 2014-08-25 19:06:58 | [diff] [blame] | 209 | |
| 210 | args = [ |
| 211 | rebase_path("//", root_build_dir), |
| 212 | rebase_path(outfile, root_build_dir), |
| 213 | "TOOLS_GN_LAST_COMMIT_POSITION_H_", |
| 214 | ] |
| 215 | } |
| 216 | |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 217 | executable("gn") { |
| 218 | sources = [ |
| 219 | "gn_main.cc", |
| 220 | ] |
[email protected] | 9af0b83 | 2013-11-08 20:31:13 | [diff] [blame] | 221 | |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 222 | deps = [ |
| 223 | ":gn_lib", |
Brett Wilson | 48c29f2 | 2014-08-25 19:06:58 | [diff] [blame] | 224 | ":last_commit_position", |
tfarina | b8e602bf | 2014-12-21 03:11:53 | [diff] [blame] | 225 | "//base", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 226 | ] |
| 227 | } |
| 228 | |
| 229 | test("gn_unittests") { |
| 230 | sources = [ |
[email protected] | 012db594 | 2014-08-06 20:38:45 | [diff] [blame] | 231 | "action_target_generator_unittest.cc", |
sky | ca5cccef | 2015-03-16 18:06:00 | [diff] [blame] | 232 | "args_unittest.cc", |
[email protected] | 26542b0 | 2013-11-08 23:25:04 | [diff] [blame] | 233 | "builder_unittest.cc", |
[email protected] | 126d8b5 | 2014-04-07 22:17:35 | [diff] [blame] | 234 | "c_include_iterator_unittest.cc", |
scottmg | 2dd93e8b | 2014-09-26 04:07:05 | [diff] [blame] | 235 | "command_format_unittest.cc", |
[email protected] | 58d2a90 | 2014-04-15 22:15:36 | [diff] [blame] | 236 | "config_values_extractors_unittest.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 237 | "escape_unittest.cc", |
cjhopman | 5579301 | 2014-10-16 19:19:40 | [diff] [blame] | 238 | "exec_process_unittest.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 239 | "filesystem_utils_unittest.cc", |
[email protected] | 92cafe5 | 2014-05-13 19:42:25 | [diff] [blame] | 240 | "function_foreach_unittest.cc", |
[email protected] | 7380ca7 | 2014-05-13 16:56:20 | [diff] [blame] | 241 | "function_get_label_info_unittest.cc", |
[email protected] | 01bd79b | 2014-06-05 17:36:25 | [diff] [blame] | 242 | "function_get_path_info_unittest.cc", |
[email protected] | e1bd79f | 2014-05-05 20:27:53 | [diff] [blame] | 243 | "function_get_target_outputs_unittest.cc", |
[email protected] | 209d521c | 2014-08-12 23:29:06 | [diff] [blame] | 244 | "function_process_file_template_unittest.cc", |
[email protected] | ea3690c | 2013-09-23 17:59:22 | [diff] [blame] | 245 | "function_rebase_path_unittest.cc", |
[email protected] | fd54675 | 2014-05-30 16:24:33 | [diff] [blame] | 246 | "function_write_file_unittest.cc", |
[email protected] | 3ffa36a | 2014-07-24 21:01:50 | [diff] [blame] | 247 | "functions_target_unittest.cc", |
[email protected] | a4e86292 | 2014-03-27 21:16:22 | [diff] [blame] | 248 | "functions_unittest.cc", |
[email protected] | 126d8b5 | 2014-04-07 22:17:35 | [diff] [blame] | 249 | "header_checker_unittest.cc", |
brettw | 54d76753 | 2015-04-16 17:40:49 | [diff] [blame] | 250 | "inherited_libraries_unittest.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 251 | "input_conversion_unittest.cc", |
brettw | 3741b72 | 2014-08-29 17:07:20 | [diff] [blame] | 252 | "label_pattern_unittest.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 253 | "label_unittest.cc", |
[email protected] | 26542b0 | 2013-11-08 23:25:04 | [diff] [blame] | 254 | "loader_unittest.cc", |
[email protected] | 2fbe101 | 2014-03-20 17:59:15 | [diff] [blame] | 255 | "ninja_action_target_writer_unittest.cc", |
[email protected] | 7ff2f5d | 2013-10-08 21:30:34 | [diff] [blame] | 256 | "ninja_binary_target_writer_unittest.cc", |
[email protected] | b90c75a | 2013-09-18 22:02:50 | [diff] [blame] | 257 | "ninja_copy_target_writer_unittest.cc", |
cjhopman | 1b668a2e9 | 2014-09-09 16:30:40 | [diff] [blame] | 258 | "ninja_group_target_writer_unittest.cc", |
[email protected] | ef348fe | 2014-05-01 18:31:31 | [diff] [blame] | 259 | "ninja_target_writer_unittest.cc", |
[email protected] | 0dfcae7 | 2014-08-19 22:52:16 | [diff] [blame] | 260 | "ninja_toolchain_writer_unittest.cc", |
[email protected] | 4419688 | 2013-12-21 05:31:11 | [diff] [blame] | 261 | "operators_unittest.cc", |
[email protected] | 51d0172 | 2014-03-26 16:57:07 | [diff] [blame] | 262 | "parse_tree_unittest.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 263 | "parser_unittest.cc", |
| 264 | "path_output_unittest.cc", |
| 265 | "pattern_unittest.cc", |
brettw | 0db9185 | 2015-05-14 23:40:20 | [diff] [blame] | 266 | "runtime_deps_unittest.cc", |
[email protected] | 17f43bf | 2013-08-23 21:04:46 | [diff] [blame] | 267 | "scope_per_file_provider_unittest.cc", |
[email protected] | a2d0b7a | 2013-12-16 23:59:09 | [diff] [blame] | 268 | "scope_unittest.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 269 | "source_dir_unittest.cc", |
| 270 | "string_utils_unittest.cc", |
[email protected] | 012db594 | 2014-08-06 20:38:45 | [diff] [blame] | 271 | "substitution_pattern_unittest.cc", |
| 272 | "substitution_writer_unittest.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 273 | "target_generator_unittest.cc", |
[email protected] | 3c1274d | 2013-09-10 22:21:21 | [diff] [blame] | 274 | "target_unittest.cc", |
[email protected] | 1e3fbf7b | 2014-04-08 19:15:20 | [diff] [blame] | 275 | "template_unittest.cc", |
[email protected] | 43bf6a5 | 2013-09-17 16:54:24 | [diff] [blame] | 276 | "test_with_scope.cc", |
| 277 | "test_with_scope.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 278 | "tokenizer_unittest.cc", |
[email protected] | 8fc5618 | 2014-08-06 21:44:33 | [diff] [blame] | 279 | "unique_vector_unittest.cc", |
[email protected] | d5645f1 | 2014-05-03 04:32:19 | [diff] [blame] | 280 | "value_unittest.cc", |
[email protected] | 60c9d17 | 2014-04-01 21:45:11 | [diff] [blame] | 281 | "visibility_unittest.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 282 | ] |
| 283 | deps = [ |
| 284 | ":gn_lib", |
tfarina | 55116bef | 2015-03-25 03:40:19 | [diff] [blame] | 285 | "//base/test:run_all_unittests", |
[email protected] | cc7ec69 | 2014-04-08 17:20:38 | [diff] [blame] | 286 | "//base/test:test_support", |
[email protected] | 23e197d | 2013-12-31 12:14:01 | [diff] [blame] | 287 | "//testing/gtest", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 288 | ] |
| 289 | } |
| 290 | |
| 291 | executable("generate_test_gn_data") { |
scottmg | 34fb7e5 | 2014-12-03 23:27:24 | [diff] [blame] | 292 | sources = [ |
| 293 | "generate_test_gn_data.cc", |
| 294 | ] |
| 295 | deps = [ |
| 296 | "//base", |
| 297 | ] |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 298 | } |