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

Unified Diff: tools/gn/test_with_scope.h

Issue 1892393002: 🐜 GN: Make write_runtime_deps take effect only a target is resolved (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 4 years, 8 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.cc ('k') | tools/gn/test_with_scope.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/test_with_scope.h
diff --git a/tools/gn/test_with_scope.h b/tools/gn/test_with_scope.h
index fa6fb4b324b855899194bcbfde677f47d250618b..88532438213999693d5f1875ed2f63b0a3c0b686 100644
--- a/tools/gn/test_with_scope.h
+++ b/tools/gn/test_with_scope.h
@@ -34,6 +34,7 @@ class TestWithScope {
Toolchain* toolchain() { return &toolchain_; }
const Toolchain* toolchain() const { return &toolchain_; }
Scope* scope() { return &scope_; }
+ const Scope::ItemVector& items() { return items_; }
// This buffer accumulates output from any print() commands executed in the
// context of this test. Note that the implementation of this is not
@@ -44,6 +45,11 @@ class TestWithScope {
// assert if the label isn't valid (this is intended for hardcoded labels).
Label ParseLabel(const std::string& str) const;
+ // Parses, evaluates, and resolves targets from the given snippet of code.
+ // All targets must be defined in dependency order (does not use a Builder,
+ // just blindly resolves all targets in order).
+ bool ExecuteSnippet(const std::string& str, Err* err);
+
// Fills in the tools for the given toolchain with reasonable default values.
// The toolchain in this object will be automatically set up with this
// function, it is exposed to allow tests to get the same functionality for
@@ -62,6 +68,7 @@ class TestWithScope {
Settings settings_;
Toolchain toolchain_;
Scope scope_;
+ Scope::ItemVector items_;
// Supplies the scope with built-in variables like root_out_dir.
ScopePerFileProvider scope_progammatic_provider_;
« no previous file with comments | « tools/gn/target_generator.cc ('k') | tools/gn/test_with_scope.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698