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

Unified Diff: tools/gn/target_unittest.cc

Issue 1868023002: Add GN output prefix override and allow empty output extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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.cc ('k') | tools/gn/variables.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/target_unittest.cc
diff --git a/tools/gn/target_unittest.cc b/tools/gn/target_unittest.cc
index b3a85b75a0d824d28bff94e24065c006a8bfb911..8629ff21d39db2628ecfb756e7d590d558656472 100644
--- a/tools/gn/target_unittest.cc
+++ b/tools/gn/target_unittest.cc
@@ -270,30 +270,32 @@ TEST(Target, GetComputedOutputName) {
// no prefix) or output name.
TestTarget basic(setup, "//foo:bar", Target::EXECUTABLE);
ASSERT_TRUE(basic.OnResolved(&err));
- EXPECT_EQ("bar", basic.GetComputedOutputName(false));
- EXPECT_EQ("bar", basic.GetComputedOutputName(true));
+ EXPECT_EQ("bar", basic.GetComputedOutputName());
// Target with no prefix but an output name.
TestTarget with_name(setup, "//foo:bar", Target::EXECUTABLE);
with_name.set_output_name("myoutput");
ASSERT_TRUE(with_name.OnResolved(&err));
- EXPECT_EQ("myoutput", with_name.GetComputedOutputName(false));
- EXPECT_EQ("myoutput", with_name.GetComputedOutputName(true));
+ EXPECT_EQ("myoutput", with_name.GetComputedOutputName());
// Target with a "lib" prefix (the static library tool in the TestWithScope
// should specify a "lib" output prefix).
TestTarget with_prefix(setup, "//foo:bar", Target::STATIC_LIBRARY);
ASSERT_TRUE(with_prefix.OnResolved(&err));
- EXPECT_EQ("bar", with_prefix.GetComputedOutputName(false));
- EXPECT_EQ("libbar", with_prefix.GetComputedOutputName(true));
+ EXPECT_EQ("libbar", with_prefix.GetComputedOutputName());
// Target with a "lib" prefix that already has it applied. The prefix should
// not duplicate something already in the target name.
TestTarget dup_prefix(setup, "//foo:bar", Target::STATIC_LIBRARY);
dup_prefix.set_output_name("libbar");
ASSERT_TRUE(dup_prefix.OnResolved(&err));
- EXPECT_EQ("libbar", dup_prefix.GetComputedOutputName(false));
- EXPECT_EQ("libbar", dup_prefix.GetComputedOutputName(true));
+ EXPECT_EQ("libbar", dup_prefix.GetComputedOutputName());
+
+ // Target with an output prefix override should not have a prefix.
+ TestTarget override_prefix(setup, "//foo:bar", Target::SHARED_LIBRARY);
+ override_prefix.set_output_prefix_override(true);
+ ASSERT_TRUE(dup_prefix.OnResolved(&err));
+ EXPECT_EQ("bar", override_prefix.GetComputedOutputName());
}
// Test visibility failure case.
« no previous file with comments | « tools/gn/target.cc ('k') | tools/gn/variables.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698