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

Unified Diff: tools/gn/function_get_target_outputs_unittest.cc

Issue 387663003: Improve GN handling of directory templates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/function_get_target_outputs.cc ('k') | tools/gn/function_process_file_template.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_get_target_outputs_unittest.cc
diff --git a/tools/gn/function_get_target_outputs_unittest.cc b/tools/gn/function_get_target_outputs_unittest.cc
index 2833fdde8af3abd4ea9003b0dcab368f8fbd50f5..7c1b80c2e11b537a7af9a93d5e3fe683ade338c3 100644
--- a/tools/gn/function_get_target_outputs_unittest.cc
+++ b/tools/gn/function_get_target_outputs_unittest.cc
@@ -82,11 +82,26 @@ TEST_F(GetTargetOutputsTest, SourceSet) {
AssertSingleStringEquals(result, "//out/Debug/obj/foo/bar.stamp");
}
+TEST_F(GetTargetOutputsTest, Copy) {
+ Target* action = new Target(setup_.settings(), GetLabel("//foo/", "bar"));
+ action->set_output_type(Target::COPY_FILES);
+ action->sources().push_back(SourceFile("//file.txt"));
+ action->action_values().outputs().push_back(
+ "//out/Debug/{{source_file_part}}.one");
+
+ items_.push_back(new scoped_ptr<Item>(action));
+
+ Err err;
+ Value result = GetTargetOutputs("//foo:bar", &err);
+ ASSERT_FALSE(err.has_error());
+ AssertSingleStringEquals(result, "//out/Debug/file.txt.one");
+}
+
TEST_F(GetTargetOutputsTest, Action) {
Target* action = new Target(setup_.settings(), GetLabel("//foo/", "bar"));
action->set_output_type(Target::ACTION);
- action->action_values().outputs().push_back(SourceFile("//output1.txt"));
- action->action_values().outputs().push_back(SourceFile("//output2.txt"));
+ action->action_values().outputs().push_back("//output1.txt");
+ action->action_values().outputs().push_back("//output2.txt");
items_.push_back(new scoped_ptr<Item>(action));
@@ -101,9 +116,9 @@ TEST_F(GetTargetOutputsTest, ActionForeach) {
action->set_output_type(Target::ACTION_FOREACH);
action->sources().push_back(SourceFile("//file.txt"));
action->action_values().outputs().push_back(
- SourceFile("//out/Debug/{{source_file_part}}.one"));
+ "//out/Debug/{{source_file_part}}.one");
action->action_values().outputs().push_back(
- SourceFile("//out/Debug/{{source_file_part}}.two"));
+ "//out/Debug/{{source_file_part}}.two");
items_.push_back(new scoped_ptr<Item>(action));
« no previous file with comments | « tools/gn/function_get_target_outputs.cc ('k') | tools/gn/function_process_file_template.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698