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

Unified Diff: trunk/src/tools/gn/scope_per_file_provider_unittest.cc

Issue 46313006: Revert 232657 "GN: toolchain threading cleanup" (Closed) Base URL: svn://svn.chromium.org/chrome/
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/tools/gn/scope_per_file_provider.cc ('k') | trunk/src/tools/gn/settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/tools/gn/scope_per_file_provider_unittest.cc
===================================================================
--- trunk/src/tools/gn/scope_per_file_provider_unittest.cc (revision 232660)
+++ trunk/src/tools/gn/scope_per_file_provider_unittest.cc (working copy)
@@ -6,26 +6,34 @@
#include "tools/gn/build_settings.h"
#include "tools/gn/scope_per_file_provider.h"
#include "tools/gn/settings.h"
-#include "tools/gn/test_with_scope.h"
#include "tools/gn/toolchain.h"
#include "tools/gn/variables.h"
TEST(ScopePerFileProvider, Expected) {
- TestWithScope test;
+ Err err;
+ BuildSettings build_settings;
+ build_settings.toolchain_manager().SetDefaultToolchainUnlocked(
+ Label(SourceDir("//toolchain/"), "default", SourceDir(), ""),
+ LocationRange(), &err);
+ EXPECT_FALSE(err.has_error());
+
+ build_settings.SetBuildDir(SourceDir("//out/Debug/"));
+
// Prevent horrible wrapping of calls below.
#define GPV(val) provider.GetProgrammaticValue(val)->string_value()
// Test the default toolchain.
{
- Scope scope(test.settings());
+ Toolchain toolchain(Label(SourceDir("//toolchain/"), "tc"));
+ Settings settings(&build_settings, &toolchain, std::string());
+
+ Scope scope(&settings);
scope.set_source_dir(SourceDir("//source/"));
ScopePerFileProvider provider(&scope);
- EXPECT_EQ("//toolchain:default", GPV(variables::kCurrentToolchain));
- // TODO(brettw) this test harness does not set up the Toolchain manager
- // which is the source of this value, so we can't test this yet.
- //EXPECT_EQ("//toolchain:default", GPV(variables::kDefaultToolchain));
+ EXPECT_EQ("//toolchain:tc", GPV(variables::kCurrentToolchain));
+ EXPECT_EQ("//toolchain:default", GPV(variables::kDefaultToolchain));
EXPECT_EQ("//out/Debug", GPV(variables::kRootBuildDir));
EXPECT_EQ("//out/Debug/gen", GPV(variables::kRootGenDir));
EXPECT_EQ("//out/Debug", GPV(variables::kRootOutDir));
@@ -35,17 +43,13 @@
// Test some with an alternate toolchain.
{
- Settings settings(test.build_settings(), "tc");
- Toolchain toolchain(&settings, Label(SourceDir("//toolchain/"), "tc"));
- settings.set_toolchain_label(toolchain.label());
+ Toolchain toolchain(Label(SourceDir("//toolchain/"), "tc"));
+ Settings settings(&build_settings, &toolchain, "tc");
Scope scope(&settings);
scope.set_source_dir(SourceDir("//source/"));
ScopePerFileProvider provider(&scope);
- EXPECT_EQ("//toolchain:tc", GPV(variables::kCurrentToolchain));
- // See above.
- //EXPECT_EQ("//toolchain:default", GPV(variables::kDefaultToolchain));
EXPECT_EQ("//out/Debug", GPV(variables::kRootBuildDir));
EXPECT_EQ("//out/Debug/tc/gen", GPV(variables::kRootGenDir));
EXPECT_EQ("//out/Debug/tc", GPV(variables::kRootOutDir));
« no previous file with comments | « trunk/src/tools/gn/scope_per_file_provider.cc ('k') | trunk/src/tools/gn/settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698