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

Unified Diff: tools/gn/substitution_writer_unittest.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/ninja_target_writer_unittest.cc ('k') | tools/gn/target.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/substitution_writer_unittest.cc
diff --git a/tools/gn/substitution_writer_unittest.cc b/tools/gn/substitution_writer_unittest.cc
index fc6cc74f9a9fc4974d5eac702cff9be458fb4abe..6542f77e0bc3bd7c733a9b40e5ce40cb43d4e4db 100644
--- a/tools/gn/substitution_writer_unittest.cc
+++ b/tools/gn/substitution_writer_unittest.cc
@@ -173,11 +173,12 @@ TEST(SubstutitionWriter, SourceSubstitutions) {
TEST(SubstitutionWriter, TargetSubstitutions) {
TestWithScope setup;
+ Err err;
Target target(setup.settings(), Label(SourceDir("//foo/bar/"), "baz"));
target.set_output_type(Target::STATIC_LIBRARY);
target.SetToolchain(setup.toolchain());
- target.OnResolved();
+ ASSERT_TRUE(target.OnResolved(&err));
std::string result;
EXPECT_TRUE(SubstitutionWriter::GetTargetSubstitution(
@@ -207,11 +208,12 @@ TEST(SubstitutionWriter, TargetSubstitutions) {
TEST(SubstitutionWriter, CompilerSubstitutions) {
TestWithScope setup;
+ Err err;
Target target(setup.settings(), Label(SourceDir("//foo/bar/"), "baz"));
target.set_output_type(Target::STATIC_LIBRARY);
target.SetToolchain(setup.toolchain());
- target.OnResolved();
+ ASSERT_TRUE(target.OnResolved(&err));
// The compiler substitution is just source + target combined. So test one
// of each of those classes of things to make sure this is hooked up.
@@ -227,11 +229,12 @@ TEST(SubstitutionWriter, CompilerSubstitutions) {
TEST(SubstitutionWriter, LinkerSubstitutions) {
TestWithScope setup;
+ Err err;
Target target(setup.settings(), Label(SourceDir("//foo/bar/"), "baz"));
target.set_output_type(Target::SHARED_LIBRARY);
target.SetToolchain(setup.toolchain());
- target.OnResolved();
+ ASSERT_TRUE(target.OnResolved(&err));
const Tool* tool = setup.toolchain()->GetToolForTargetFinalOutput(&target);
@@ -246,7 +249,6 @@ TEST(SubstitutionWriter, LinkerSubstitutions) {
// Test that we handle paths that end up in the root build dir properly
// (no leading "./" or "/").
- Err err;
SubstitutionPattern pattern;
ASSERT_TRUE(
pattern.Parse("{{root_out_dir}}/{{target_output_name}}.so", NULL, &err));
« no previous file with comments | « tools/gn/ninja_target_writer_unittest.cc ('k') | tools/gn/target.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698