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

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

Issue 48523006: GN: Separately track labels and origins for lists of stuff (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/ninja_binary_target_writer.cc ('k') | tools/gn/ninja_group_target_writer.cc » ('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 (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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 std::string out_str = out.str(); 43 std::string out_str = out.str();
44 #if defined(OS_WIN) 44 #if defined(OS_WIN)
45 std::replace(out_str.begin(), out_str.end(), '\\', '/'); 45 std::replace(out_str.begin(), out_str.end(), '\\', '/');
46 #endif 46 #endif
47 EXPECT_EQ(expected_win, out_str); 47 EXPECT_EQ(expected_win, out_str);
48 } 48 }
49 49
50 // A shared library that depends on the source set. 50 // A shared library that depends on the source set.
51 Target shlib_target(setup.settings(), Label(SourceDir("//foo/"), "shlib")); 51 Target shlib_target(setup.settings(), Label(SourceDir("//foo/"), "shlib"));
52 shlib_target.set_output_type(Target::SHARED_LIBRARY); 52 shlib_target.set_output_type(Target::SHARED_LIBRARY);
53 shlib_target.deps().push_back(&target); 53 shlib_target.deps().push_back(LabelTargetPair(&target));
54 shlib_target.OnResolved(); 54 shlib_target.OnResolved();
55 55
56 { 56 {
57 std::ostringstream out; 57 std::ostringstream out;
58 NinjaBinaryTargetWriter writer(&shlib_target, out); 58 NinjaBinaryTargetWriter writer(&shlib_target, out);
59 writer.Run(); 59 writer.Run();
60 60
61 // TODO(brettw) I think we'll need to worry about backslashes here 61 // TODO(brettw) I think we'll need to worry about backslashes here
62 // depending if we're on actual Windows or Linux pretending to be Windows. 62 // depending if we're on actual Windows or Linux pretending to be Windows.
63 const char expected_win[] = 63 const char expected_win[] =
(...skipping 14 matching lines...) Expand all
78 " lib = shlib.dll\n" 78 " lib = shlib.dll\n"
79 " dll = shlib.dll\n" 79 " dll = shlib.dll\n"
80 " implibflag = /IMPLIB:shlib.dll.lib\n\n"; 80 " implibflag = /IMPLIB:shlib.dll.lib\n\n";
81 std::string out_str = out.str(); 81 std::string out_str = out.str();
82 #if defined(OS_WIN) 82 #if defined(OS_WIN)
83 std::replace(out_str.begin(), out_str.end(), '\\', '/'); 83 std::replace(out_str.begin(), out_str.end(), '\\', '/');
84 #endif 84 #endif
85 EXPECT_EQ(expected_win, out_str); 85 EXPECT_EQ(expected_win, out_str);
86 } 86 }
87 } 87 }
OLDNEW
« no previous file with comments | « tools/gn/ninja_binary_target_writer.cc ('k') | tools/gn/ninja_group_target_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698