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

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

Issue 51693002: GN: toolchain threading cleanup (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_helper.cc ('k') | tools/gn/ninja_script_target_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 (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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 6
7 #include "tools/gn/build_settings.h" 7 #include "tools/gn/build_settings.h"
8 #include "tools/gn/filesystem_utils.h" 8 #include "tools/gn/filesystem_utils.h"
9 #include "tools/gn/ninja_helper.h" 9 #include "tools/gn/ninja_helper.h"
10 #include "tools/gn/settings.h" 10 #include "tools/gn/settings.h"
11 #include "tools/gn/target.h" 11 #include "tools/gn/target.h"
12 #include "tools/gn/toolchain.h" 12 #include "tools/gn/toolchain.h"
13 13
14 namespace { 14 namespace {
15 15
16 class HelperSetterUpper { 16 class HelperSetterUpper {
17 public: 17 public:
18 HelperSetterUpper() 18 HelperSetterUpper()
19 : build_settings(), 19 : build_settings(),
20 toolchain(Label(SourceDir("//"), "tc")), 20 settings(&build_settings, std::string()),
21 settings(&build_settings, &toolchain, std::string()), 21 toolchain(&settings, Label(SourceDir("//"), "tc")),
22 target(&settings, Label(SourceDir("//tools/gn/"), "name")) { 22 target(&settings, Label(SourceDir("//tools/gn/"), "name")) {
23 settings.set_toolchain_label(toolchain.label());
23 settings.set_target_os(Settings::WIN); 24 settings.set_target_os(Settings::WIN);
24 25
25 // Output going to "out/Debug". 26 // Output going to "out/Debug".
26 build_settings.SetBuildDir(SourceDir("/out/Debug/")); 27 build_settings.SetBuildDir(SourceDir("/out/Debug/"));
27 28
28 // Our source target is in "tools/gn". 29 // Our source target is in "tools/gn".
29 target.set_output_type(Target::EXECUTABLE); 30 target.set_output_type(Target::EXECUTABLE);
30 } 31 }
31 32
32 BuildSettings build_settings; 33 BuildSettings build_settings;
(...skipping 30 matching lines...) Expand all
63 EXPECT_EQ(OutputFile("name.exe"), 64 EXPECT_EQ(OutputFile("name.exe"),
64 helper.GetTargetOutputFile(&setup.target)); 65 helper.GetTargetOutputFile(&setup.target));
65 66
66 // Static library on Windows goes alongside the object files. 67 // Static library on Windows goes alongside the object files.
67 setup.target.set_output_type(Target::STATIC_LIBRARY); 68 setup.target.set_output_type(Target::STATIC_LIBRARY);
68 EXPECT_EQ(OutputFile("obj/tools/gn/name.lib"), 69 EXPECT_EQ(OutputFile("obj/tools/gn/name.lib"),
69 helper.GetTargetOutputFile(&setup.target)); 70 helper.GetTargetOutputFile(&setup.target));
70 71
71 // TODO(brettw) test output to library and other OS types. 72 // TODO(brettw) test output to library and other OS types.
72 } 73 }
OLDNEW
« no previous file with comments | « tools/gn/ninja_helper.cc ('k') | tools/gn/ninja_script_target_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698