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

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

Issue 2152413002: GN: don't write separate files for non-binary targets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 4 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
« no previous file with comments | « tools/gn/ninja_toolchain_writer.cc ('k') | tools/gn/ninja_writer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <sstream> 5 #include <sstream>
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "tools/gn/ninja_toolchain_writer.h" 8 #include "tools/gn/ninja_toolchain_writer.h"
9 #include "tools/gn/test_with_scope.h" 9 #include "tools/gn/test_with_scope.h"
10 10
11 TEST(NinjaToolchainWriter, WriteToolRule) { 11 TEST(NinjaToolchainWriter, WriteToolRule) {
12 TestWithScope setup; 12 TestWithScope setup;
13 13
14 //Target target(setup.settings(), Label(SourceDir("//foo/"), "target"));
15 //target.set_output_type(Target::EXECUTABLE);
16 //target.SetToolchain(setup.toolchain());
17
18 std::ostringstream stream; 14 std::ostringstream stream;
19 15 NinjaToolchainWriter writer(setup.settings(), setup.toolchain(), stream);
20 NinjaToolchainWriter writer(setup.settings(), setup.toolchain(),
21 std::vector<const Target*>(), stream);
22 writer.WriteToolRule(Toolchain::TYPE_CC, 16 writer.WriteToolRule(Toolchain::TYPE_CC,
23 setup.toolchain()->GetTool(Toolchain::TYPE_CC), 17 setup.toolchain()->GetTool(Toolchain::TYPE_CC),
24 std::string("prefix_")); 18 std::string("prefix_"));
25 19
26 EXPECT_EQ( 20 EXPECT_EQ(
27 "rule prefix_cc\n" 21 "rule prefix_cc\n"
28 " command = cc ${in} ${cflags} ${cflags_c} ${defines} ${include_dirs} " 22 " command = cc ${in} ${cflags} ${cflags_c} ${defines} ${include_dirs} "
29 "-o ${out}\n", 23 "-o ${out}\n",
30 stream.str()); 24 stream.str());
31 } 25 }
OLDNEW
« no previous file with comments | « tools/gn/ninja_toolchain_writer.cc ('k') | tools/gn/ninja_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698