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

Side by Side Diff: build/nocompile.gni

Issue 2912193002: Enable no-compile tests on Windows
Patch Set: Revert "work around vs 12.0 bug" Created 3 years, 6 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 | « base/memory/weak_ptr_unittest.nc ('k') | testing/scripts/nacl_integration.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2011 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 # This file is meant to be included into an target to create a unittest that 5 # This file is meant to be included into an target to create a unittest that
6 # invokes a set of no-compile tests. A no-compile test is a test that asserts 6 # invokes a set of no-compile tests. A no-compile test is a test that asserts
7 # a particular construct will not compile. 7 # a particular construct will not compile.
8 # 8 #
9 # Also see: 9 # Also see:
10 # http://dev.chromium.org/developers/testing/no-compile-tests 10 # http://dev.chromium.org/developers/testing/no-compile-tests
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 # series of #error lines on failure, and a set of trivially passing gunit 53 # series of #error lines on failure, and a set of trivially passing gunit
54 # TEST() functions on success. This allows us to fail at the compile step when 54 # TEST() functions on success. This allows us to fail at the compile step when
55 # something goes wrong, and know during the unittest run that the test was at 55 # something goes wrong, and know during the unittest run that the test was at
56 # least processed when things go right. 56 # least processed when things go right.
57 57
58 import("//testing/test.gni") 58 import("//testing/test.gni")
59 59
60 declare_args() { 60 declare_args() {
61 # TODO(crbug.com/105388): make sure no-compile test is not flaky. 61 # TODO(crbug.com/105388): make sure no-compile test is not flaky.
62 enable_nocompile_tests = 62 enable_nocompile_tests =
63 (is_linux || is_mac || is_ios) && is_clang && host_cpu == target_cpu 63 (host_cpu == target_cpu || (host_cpu == "x64" && target_cpu == "x86")) &&
64 (((is_linux || is_mac || is_ios) && is_clang) || is_win)
64 } 65 }
65 66
66 if (enable_nocompile_tests) { 67 if (enable_nocompile_tests) {
67 import("//build/config/sysroot.gni") 68 import("//build/config/sysroot.gni")
68 template("nocompile_test") { 69 template("nocompile_test") {
69 nocompile_target = target_name + "_run_nocompile" 70 nocompile_target = target_name + "_run_nocompile"
70 71
71 action_foreach(nocompile_target) { 72 action_foreach(nocompile_target) {
72 script = "//tools/nocompile_driver.py" 73 script = "//tools/nocompile_driver.py"
73 sources = invoker.sources 74 sources = invoker.sources
74 75
75 result_path = "$target_gen_dir/{{source_name_part}}_nc.cc" 76 result_path = "$target_gen_dir/{{source_name_part}}_nc.cc"
76 depfile = "${result_path}.d" 77 if (!is_win) {
78 depfile = "${result_path}.d"
79 }
77 outputs = [ 80 outputs = [
78 result_path, 81 result_path,
79 ] 82 ]
80 sysroot_args = "" 83 additional_args = ""
81 if (sysroot != "") { 84 if (sysroot != "") {
82 sysroot_args = " --sysroot " + rebase_path(sysroot, root_build_dir) 85 additional_args += " --sysroot " + rebase_path(sysroot, root_build_dir)
86 }
87 if (is_win) {
88 additional_args +=
89 " -DNOMINMAX -Wno-unused-parameter -Wno-invalid-constexpr"
83 } 90 }
84 args = [ 91 args = [
85 "4", # number of compilers to invoke in parallel. 92 "4", # number of compilers to invoke in parallel.
86 "{{source}}", 93 "{{source}}",
87 "-Wall -Werror -Wfatal-errors " + "-I" + 94 "-Wall -Werror -Wfatal-errors " + "-I" +
88 rebase_path("//", root_build_dir) + sysroot_args, 95 rebase_path("//", root_build_dir) + additional_args,
89 rebase_path(result_path, root_build_dir), 96 rebase_path(result_path, root_build_dir),
90 ] 97 ]
91 } 98 }
92 99
93 test(target_name) { 100 test(target_name) {
94 deps = invoker.deps + [ ":$nocompile_target" ] 101 deps = invoker.deps + [ ":$nocompile_target" ]
95 sources = get_target_outputs(":$nocompile_target") 102 sources = get_target_outputs(":$nocompile_target")
96 } 103 }
97 } 104 }
98 } 105 }
OLDNEW
« no previous file with comments | « base/memory/weak_ptr_unittest.nc ('k') | testing/scripts/nacl_integration.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698