| 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 <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_binary_target_writer.h" | 8 #include "tools/gn/ninja_binary_target_writer.h" |
| 9 #include "tools/gn/test_with_scope.h" | 9 #include "tools/gn/test_with_scope.h" |
| 10 | 10 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 "cflags_objcc =\n" | 170 "cflags_objcc =\n" |
| 171 "target_name = shlib\n" | 171 "target_name = shlib\n" |
| 172 "target_out_dir = obj/foo\n" | 172 "target_out_dir = obj/foo\n" |
| 173 "root_out_dir = \n" | 173 "root_out_dir = \n" |
| 174 "\n" | 174 "\n" |
| 175 "build obj/foo/shlib.input1.o: cxx ../../foo/input1.cc\n" | 175 "build obj/foo/shlib.input1.o: cxx ../../foo/input1.cc\n" |
| 176 "build obj/foo/shlib.input2.o: cxx ../../foo/input2.cc\n" | 176 "build obj/foo/shlib.input2.o: cxx ../../foo/input2.cc\n" |
| 177 "\n" | 177 "\n" |
| 178 "ldflags =\n" | 178 "ldflags =\n" |
| 179 "libs =\n" | 179 "libs =\n" |
| 180 "build lib/libshlib.so.6: solink obj/foo/shlib.input1.o " | 180 "build libshlib.so.6: solink obj/foo/shlib.input1.o " |
| 181 "obj/foo/shlib.input2.o\n" | 181 "obj/foo/shlib.input2.o\n" |
| 182 " soname = libshlib.so.6\n" | 182 " soname = libshlib.so.6\n" |
| 183 " lib = lib/libshlib.so.6\n" | 183 " lib = libshlib.so.6\n" |
| 184 "\n"; | 184 "\n"; |
| 185 | 185 |
| 186 std::string out_str = out.str(); | 186 std::string out_str = out.str(); |
| 187 #if defined(OS_WIN) | 187 #if defined(OS_WIN) |
| 188 std::replace(out_str.begin(), out_str.end(), '\\', '/'); | 188 std::replace(out_str.begin(), out_str.end(), '\\', '/'); |
| 189 #endif | 189 #endif |
| 190 EXPECT_EQ(expected, out_str); | 190 EXPECT_EQ(expected, out_str); |
| 191 } | 191 } |
| 192 | 192 |
| 193 TEST(NinjaBinaryTargetWriter, EmptyProductExtension) { | 193 TEST(NinjaBinaryTargetWriter, EmptyProductExtension) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 219 "cflags_objcc =\n" | 219 "cflags_objcc =\n" |
| 220 "target_name = shlib\n" | 220 "target_name = shlib\n" |
| 221 "target_out_dir = obj/foo\n" | 221 "target_out_dir = obj/foo\n" |
| 222 "root_out_dir = \n" | 222 "root_out_dir = \n" |
| 223 "\n" | 223 "\n" |
| 224 "build obj/foo/shlib.input1.o: cxx ../../foo/input1.cc\n" | 224 "build obj/foo/shlib.input1.o: cxx ../../foo/input1.cc\n" |
| 225 "build obj/foo/shlib.input2.o: cxx ../../foo/input2.cc\n" | 225 "build obj/foo/shlib.input2.o: cxx ../../foo/input2.cc\n" |
| 226 "\n" | 226 "\n" |
| 227 "ldflags =\n" | 227 "ldflags =\n" |
| 228 "libs =\n" | 228 "libs =\n" |
| 229 "build lib/libshlib.so: solink obj/foo/shlib.input1.o " | 229 "build libshlib.so: solink obj/foo/shlib.input1.o " |
| 230 "obj/foo/shlib.input2.o\n" | 230 "obj/foo/shlib.input2.o\n" |
| 231 " soname = libshlib.so\n" | 231 " soname = libshlib.so\n" |
| 232 " lib = lib/libshlib.so\n" | 232 " lib = libshlib.so\n" |
| 233 "\n"; | 233 "\n"; |
| 234 | 234 |
| 235 std::string out_str = out.str(); | 235 std::string out_str = out.str(); |
| 236 #if defined(OS_WIN) | 236 #if defined(OS_WIN) |
| 237 std::replace(out_str.begin(), out_str.end(), '\\', '/'); | 237 std::replace(out_str.begin(), out_str.end(), '\\', '/'); |
| 238 #endif | 238 #endif |
| 239 EXPECT_EQ(expected, out_str); | 239 EXPECT_EQ(expected, out_str); |
| 240 } | 240 } |
| OLD | NEW |