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

Unified Diff: tools/gn/ninja_binary_target_writer_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/ninja_binary_target_writer.cc ('k') | tools/gn/substitution_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/ninja_binary_target_writer_unittest.cc
diff --git a/tools/gn/ninja_binary_target_writer_unittest.cc b/tools/gn/ninja_binary_target_writer_unittest.cc
index c9b3ebef9da56d6f8c16a2148d302601f8fbe252..0b878830474db1f706d098246ebdaa93b80d963f 100644
--- a/tools/gn/ninja_binary_target_writer_unittest.cc
+++ b/tools/gn/ninja_binary_target_writer_unittest.cc
@@ -241,10 +241,12 @@ TEST(NinjaBinaryTargetWriter, EmptyProductExtension) {
setup.build_settings()->SetBuildDir(SourceDir("//out/Debug/"));
- // This test is the same as ProductExtension, except that
- // we call set_output_extension("") and ensure that we still get the default.
+ // This test is the same as ProductExtension, except that we call
+ // set_output_extension("") and ensure that we get an empty one and override
+ // the output prefix so that the name matches the target exactly.
Target target(setup.settings(), Label(SourceDir("//foo/"), "shlib"));
target.set_output_type(Target::SHARED_LIBRARY);
+ target.set_output_prefix_override(true);
target.set_output_extension(std::string());
target.sources().push_back(SourceFile("//foo/input1.cc"));
target.sources().push_back(SourceFile("//foo/input2.cc"));
@@ -263,16 +265,16 @@ TEST(NinjaBinaryTargetWriter, EmptyProductExtension) {
"cflags_cc =\n"
"root_out_dir = .\n"
"target_out_dir = obj/foo\n"
- "target_output_name = libshlib\n"
+ "target_output_name = shlib\n"
"\n"
- "build obj/foo/libshlib.input1.o: cxx ../../foo/input1.cc\n"
- "build obj/foo/libshlib.input2.o: cxx ../../foo/input2.cc\n"
+ "build obj/foo/shlib.input1.o: cxx ../../foo/input1.cc\n"
+ "build obj/foo/shlib.input2.o: cxx ../../foo/input2.cc\n"
"\n"
- "build ./libshlib.so: solink obj/foo/libshlib.input1.o "
- "obj/foo/libshlib.input2.o\n"
+ "build ./shlib: solink obj/foo/shlib.input1.o "
+ "obj/foo/shlib.input2.o\n"
" ldflags =\n"
" libs =\n"
- " output_extension = .so\n";
+ " output_extension = \n";
std::string out_str = out.str();
EXPECT_EQ(expected, out_str);
« no previous file with comments | « tools/gn/ninja_binary_target_writer.cc ('k') | tools/gn/substitution_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698