Chromium Code Reviews| Index: build/nocompile.gni |
| diff --git a/build/nocompile.gypi b/build/nocompile.gni |
| similarity index 60% |
| copy from build/nocompile.gypi |
| copy to build/nocompile.gni |
| index 8c0f288b5a55f70fcfb38013e509b0b0b4b549c4..f2470a3ce9d2777d9e0f23fd385e99b57673e065 100644 |
| --- a/build/nocompile.gypi |
| +++ b/build/nocompile.gni |
| @@ -10,14 +10,13 @@ |
| # http://dev.chromium.org/developers/testing/no-compile-tests |
| # |
| # To use this, create a gyp target with the following form: |
| -# { |
| -# 'target_name': 'my_module_nc_unittests', |
| -# 'type': 'executable', |
| -# 'sources': [ |
| +# |
| +# import("//build/nocompile.gni") |
| +# nocompile_test("my_module_nc_unittests") { |
| +# sources = [ |
| # 'nc_testset_1.nc', |
| # 'nc_testset_2.nc', |
| -# ], |
| -# 'includes': ['path/to/this/gypi/file'], |
| +# ] |
| # } |
| # |
| # The .nc files are C++ files that contain code we wish to assert will not |
| @@ -56,41 +55,34 @@ |
| # something goes wrong, and know during the unittest run that the test was at |
| # least processed when things go right. |
| -{ |
| - # TODO(awong): Disabled until http://crbug.com/105388 is resolved. |
| - 'sources/': [['exclude', '\\.nc$']], |
| - 'conditions': [ |
| - [ 'OS!="win" and clang==1', { |
| - 'rules': [ |
| - { |
| - 'variables': { |
| - 'nocompile_driver': '<(DEPTH)/tools/nocompile_driver.py', |
| - 'nc_result_path': ('<(INTERMEDIATE_DIR)/<(module_dir)/' |
| - '<(RULE_INPUT_ROOT)_nc.cc'), |
| - }, |
| - 'rule_name': 'run_nocompile', |
| - 'extension': 'nc', |
| - 'inputs': [ |
| - '<(nocompile_driver)', |
| - ], |
| - 'outputs': [ |
| - '<(nc_result_path)' |
| - ], |
| - 'action': [ |
| - 'python', |
| - '<(nocompile_driver)', |
| - '4', # number of compilers to invoke in parallel. |
| - '<(RULE_INPUT_PATH)', |
| - '-Wall -Werror -Wfatal-errors -I<(DEPTH)', |
| - '<(nc_result_path)', |
| - ], |
| - 'message': 'Generating no compile results for <(RULE_INPUT_PATH)', |
| - 'process_outputs_as_sources': 1, |
| - }, |
| - ], |
| - }, { |
| - 'sources/': [['exclude', '\\.nc$']] |
| - }], # 'OS!="win" and clang=="1"' |
| - ], |
| +import("//testing/test.gni") |
| + |
| +declare_args() { |
| + enable_nocompile_tests = false |
| } |
| +if (enable_nocompile_tests) { |
| + template("nocompile_test") { |
| + nocompile_target = target_name + "_run_nocompile" |
| + |
| + action_foreach(nocompile_target) { |
| + script = "//tools/nocompile_driver.py" |
| + sources = invoker.sources |
| + outputs = [ |
| + "$target_gen_dir/{{source_name_part}}_nc.cc", |
| + ] |
| + args = [ |
| + "4", |
|
dcheng
2015/12/15 18:14:47
I'm not very familiar with GN: what does the 4 her
Nico
2015/12/15 19:10:04
See this on the lhs:
'4', # number of compilers t
tzik
2015/12/16 07:45:27
Added the comment too.
Yes, it's from the .gypi.
|
| + "{{source}}", |
| + "-Wall -Werror -Wfatal-errors " + "-I" + |
| + rebase_path("//", root_build_dir), |
| + "{{output}}", |
| + ] |
| + } |
| + |
| + test(target_name) { |
| + deps = invoker.deps + [ ":$nocompile_target" ] |
| + sources = get_target_outputs(":$nocompile_target") |
| + } |
| + } |
| +} |