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

Unified Diff: tools/gn/variables.cc

Issue 524623005: Add testonly flag to GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/variables.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/variables.cc
diff --git a/tools/gn/variables.cc b/tools/gn/variables.cc
index c6cc06895518d054c54c6417af8d2c391126cd15..8cdb6821e8c503c2b4c1c34a0425049e8da69eea 100644
--- a/tools/gn/variables.cc
+++ b/tools/gn/variables.cc
@@ -738,6 +738,28 @@ const char kSources_Help[] =
"\n"
" A list of files relative to the current buildfile.\n";
+const char kTestonly[] = "testonly";
+const char kTestonly_HelpShort[] =
+ "testonly: [boolean] Declares a target must only be used for testing.";
+const char kTestonly_Help[] =
+ "testonly: Declares a target must only be used for testing.\n"
+ "\n"
+ " Boolean. Defaults to false.\n"
+ "\n"
+ " When a target is marked \"testonly = true\", it must only be depended\n"
+ " on by other test-only targets. Otherwise, GN will issue an error\n"
+ " that the depenedency is not allowed.\n"
+ "\n"
+ " This feature is intended to prevent accidentally shipping test code\n"
+ " in a final product.\n"
+ "\n"
+ "Example\n"
+ "\n"
+ " source_set(\"test_support\") {\n"
+ " testonly = true\n"
+ " ...\n"
+ " }\n";
+
const char kVisibility[] = "visibility";
const char kVisibility_HelpShort[] =
"visibility: [label list] A list of labels that can depend on a target.";
@@ -856,6 +878,7 @@ const VariableInfoMap& GetTargetVariables() {
INSERT_VARIABLE(Public)
INSERT_VARIABLE(Script)
INSERT_VARIABLE(Sources)
+ INSERT_VARIABLE(Testonly)
INSERT_VARIABLE(Visibility)
}
return info_map;
« no previous file with comments | « tools/gn/variables.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698