[Session restore] Rename group name Enabled to Restore.
[chromium-blink-merge.git] / tools / gn / ninja_toolchain_writer_unittest.cc
blobfc52f7da7be7df56513bc6f13b0e3a7991ca42d3
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.
5 #include <sstream>
7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "tools/gn/ninja_toolchain_writer.h"
9 #include "tools/gn/test_with_scope.h"
11 TEST(NinjaToolchainWriter, WriteToolRule) {
12 TestWithScope setup;
14 //Target target(setup.settings(), Label(SourceDir("//foo/"), "target"));
15 //target.set_output_type(Target::EXECUTABLE);
16 //target.SetToolchain(setup.toolchain());
18 std::ostringstream stream;
20 NinjaToolchainWriter writer(setup.settings(), setup.toolchain(),
21 std::vector<const Target*>(), stream);
22 writer.WriteToolRule(Toolchain::TYPE_CC,
23 setup.toolchain()->GetTool(Toolchain::TYPE_CC),
24 std::string("prefix_"));
26 EXPECT_EQ(
27 "rule prefix_cc\n"
28 " command = cc ${in} ${cflags} ${cflags_c} ${defines} ${include_dirs} "
29 "-o ${out}\n",
30 stream.str());