| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "tools/gn/ninja_binary_target_writer.h" | 5 #include "tools/gn/ninja_binary_target_writer.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 const char expected[] = | 174 const char expected[] = |
| 175 "defines =\n" | 175 "defines =\n" |
| 176 "include_dirs =\n" | 176 "include_dirs =\n" |
| 177 "cflags =\n" | 177 "cflags =\n" |
| 178 "cflags_cc =\n" | 178 "cflags_cc =\n" |
| 179 "root_out_dir = .\n" | 179 "root_out_dir = .\n" |
| 180 "target_out_dir = obj/foo\n" | 180 "target_out_dir = obj/foo\n" |
| 181 "target_output_name = libshlib\n" | 181 "target_output_name = libshlib\n" |
| 182 "\n" | 182 "\n" |
| 183 "build obj/foo/shlib.inputdeps.stamp: stamp obj/foo/action.stamp\n" | |
| 184 "build obj/foo/libshlib.input1.o: cxx ../../foo/input1.cc" | 183 "build obj/foo/libshlib.input1.o: cxx ../../foo/input1.cc" |
| 185 " || obj/foo/shlib.inputdeps.stamp\n" | 184 " || obj/foo/action.stamp\n" |
| 186 "build obj/foo/libshlib.input2.o: cxx ../../foo/input2.cc" | 185 "build obj/foo/libshlib.input2.o: cxx ../../foo/input2.cc" |
| 187 " || obj/foo/shlib.inputdeps.stamp\n" | 186 " || obj/foo/action.stamp\n" |
| 188 "\n" | 187 "\n" |
| 189 "build ./libshlib.so.6: solink obj/foo/libshlib.input1.o " | 188 "build ./libshlib.so.6: solink obj/foo/libshlib.input1.o " |
| 190 // The order-only dependency here is stricly unnecessary since the | 189 // The order-only dependency here is stricly unnecessary since the |
| 191 // sources list this as an order-only dep. See discussion in the code | 190 // sources list this as an order-only dep. See discussion in the code |
| 192 // that writes this. | 191 // that writes this. |
| 193 "obj/foo/libshlib.input2.o || obj/foo/action.stamp\n" | 192 "obj/foo/libshlib.input2.o || obj/foo/action.stamp\n" |
| 194 " ldflags =\n" | 193 " ldflags =\n" |
| 195 " libs =\n" | 194 " libs =\n" |
| 196 " output_extension = .so.6\n"; | 195 " output_extension = .so.6\n"; |
| 197 | 196 |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 | 725 |
| 727 EXPECT_FALSE(scheduler.is_failed()); | 726 EXPECT_FALSE(scheduler.is_failed()); |
| 728 | 727 |
| 729 std::ostringstream out; | 728 std::ostringstream out; |
| 730 NinjaBinaryTargetWriter writer(&target, out); | 729 NinjaBinaryTargetWriter writer(&target, out); |
| 731 writer.Run(); | 730 writer.Run(); |
| 732 | 731 |
| 733 // Should have issued an error. | 732 // Should have issued an error. |
| 734 EXPECT_TRUE(scheduler.is_failed()); | 733 EXPECT_TRUE(scheduler.is_failed()); |
| 735 } | 734 } |
| OLD | NEW |