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

Unified Diff: tools/gn/target_generator.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/target_generator.h ('k') | tools/gn/target_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/target_generator.cc
diff --git a/tools/gn/target_generator.cc b/tools/gn/target_generator.cc
index 657581ac0166560067eaee51ebae4f3dc68920b2..02c055e336e748a97af486b22ba1697e77eeaeb8 100644
--- a/tools/gn/target_generator.cc
+++ b/tools/gn/target_generator.cc
@@ -48,6 +48,10 @@ void TargetGenerator::Run() {
if (err_->has_error())
return;
+ FillTestonly();
+ if (err_->has_error())
+ return;
+
if (!Visibility::FillItemVisibility(target_, scope_, err_))
return;
@@ -217,6 +221,15 @@ void TargetGenerator::FillDependencies() {
return;
}
+void TargetGenerator::FillTestonly() {
+ const Value* value = scope_->GetValue(variables::kTestonly, true);
+ if (value) {
+ if (!value->VerifyTypeIs(Value::BOOLEAN, err_))
+ return;
+ target_->set_testonly(value->boolean_value());
+ }
+}
+
void TargetGenerator::FillOutputs(bool allow_substitutions) {
const Value* value = scope_->GetValue(variables::kOutputs, true);
if (!value)
« no previous file with comments | « tools/gn/target_generator.h ('k') | tools/gn/target_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698