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