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

Side by Side Diff: tools/gn/action_target_generator_unittest.cc

Issue 429423002: Refactor GN source expansions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/gn/action_target_generator.cc ('k') | tools/gn/action_values.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "tools/gn/scheduler.h"
7 #include "tools/gn/test_with_scope.h"
8
9 // Tests that actions can't have output substitutions.
10 TEST(ActionTargetGenerator, ActionOutputSubstitutions) {
11 Scheduler scheduler;
12 TestWithScope setup;
13 Scope::ItemVector items_;
14 setup.scope()->set_item_collector(&items_);
15
16 // First test one with no substitutions, this should be valid.
17 TestParseInput input_good(
18 "action(\"foo\") {\n"
19 " script = \"//foo.py\"\n"
20 " sources = [ \"//bar.txt\" ]\n"
21 " outputs = [ \"//out/Debug/one.txt\" ]\n"
22 "}");
23 ASSERT_FALSE(input_good.has_error());
24
25 // This should run fine.
26 Err err;
27 input_good.parsed()->Execute(setup.scope(), &err);
28 ASSERT_FALSE(err.has_error()) << err.message();
29
30 // Same thing with a pattern in the output should fail.
31 TestParseInput input_bad(
32 "action(\"foo\") {\n"
33 " script = \"//foo.py\"\n"
34 " sources = [ \"//bar.txt\" ]\n"
35 " outputs = [ \"//out/Debug/{{source_name_part}}.txt\" ]\n"
36 "}");
37 ASSERT_FALSE(input_bad.has_error());
38
39 // This should run fine.
40 input_bad.parsed()->Execute(setup.scope(), &err);
41 ASSERT_TRUE(err.has_error());
42 }
OLDNEW
« no previous file with comments | « tools/gn/action_target_generator.cc ('k') | tools/gn/action_values.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698