Commit 6643d002 authored by Brett Wilson's avatar Brett Wilson

Add the "testonly" flag to the GN test target.

Now that the new GN has landed with support for this, we can start using this flag.

R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/532423003

Cr-Commit-Position: refs/heads/master@{#293579}
parent 3287d9a9
...@@ -570,8 +570,8 @@ template("component") { ...@@ -570,8 +570,8 @@ template("component") {
# TEST SETUP # TEST SETUP
# ============================================================================== # ==============================================================================
# Define a test as an executable. In the future, we'll set "test only" flags # Define a test as an executable with the "testonly" flag set. In the future,
# on this (when such flags exist) and do something different for Android. # this will need to be enhanced for Android.
template("test") { template("test") {
executable(target_name) { executable(target_name) {
# Configs will always be defined since we set_defaults for a component # Configs will always be defined since we set_defaults for a component
...@@ -580,6 +580,8 @@ template("test") { ...@@ -580,6 +580,8 @@ template("test") {
configs = [] # Prevent list overwriting warning. configs = [] # Prevent list overwriting warning.
configs = invoker.configs configs = invoker.configs
testonly = true
# See above call. # See above call.
set_sources_assignment_filter([]) set_sources_assignment_filter([])
......
...@@ -79,6 +79,9 @@ template("write_build_config") { ...@@ -79,6 +79,9 @@ template("write_build_config") {
if (defined(invoker.deps)) { if (defined(invoker.deps)) {
deps += invoker.deps deps += invoker.deps
} }
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
outputs = [ outputs = [
depfile, depfile,
......
...@@ -575,6 +575,7 @@ template("android_java_prebuilt") { ...@@ -575,6 +575,7 @@ template("android_java_prebuilt") {
# native_libs: List paths of native libraries to include in this apk. If these # native_libs: List paths of native libraries to include in this apk. If these
# libraries depend on other shared_library targets, those dependencies will # libraries depend on other shared_library targets, those dependencies will
# also be included in the apk. # also be included in the apk.
# testonly: Marks this target as "test-only".
# #
# DEPRECATED_java_in_dir: Directory containing java files. All .java files in # DEPRECATED_java_in_dir: Directory containing java files. All .java files in
# this directory will be included in the library. This is only supported to # this directory will be included in the library. This is only supported to
...@@ -647,6 +648,9 @@ template("android_apk") { ...@@ -647,6 +648,9 @@ template("android_apk") {
if (defined(invoker.deps)) { if (defined(invoker.deps)) {
deps = invoker.deps deps = invoker.deps
} }
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
native_libs = _native_libs native_libs = _native_libs
} }
...@@ -801,6 +805,7 @@ template("unittest_apk") { ...@@ -801,6 +805,7 @@ template("unittest_apk") {
if (defined(invoker.deps)) { if (defined(invoker.deps)) {
deps = invoker.deps deps = invoker.deps
} }
testonly = true
} }
} }
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
import("//build/config/ui.gni") import("//build/config/ui.gni")
group("mojo") { group("mojo") {
# Meta-target, don't link into production code.
testonly = true
deps = [ deps = [
":tests", ":tests",
"//mojo/common", "//mojo/common",
...@@ -22,6 +24,7 @@ group("mojo") { ...@@ -22,6 +24,7 @@ group("mojo") {
} }
group("tests") { group("tests") {
testonly = true
deps = [ deps = [
"//mojo/application_manager:mojo_application_manager_unittests", "//mojo/application_manager:mojo_application_manager_unittests",
"//mojo/apps/js/test:mojo_apps_js_unittests", "//mojo/apps/js/test:mojo_apps_js_unittests",
......
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