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

Unified Diff: tools/gn/ninja_binary_target_writer_unittest.cc

Issue 2101923006: Fix BundleData::GetBundleRootDirOutput() for non-default toolchain. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@create-bundle-deps
Patch Set: Rebase. Created 4 years, 6 months 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
Index: tools/gn/ninja_binary_target_writer_unittest.cc
diff --git a/tools/gn/ninja_binary_target_writer_unittest.cc b/tools/gn/ninja_binary_target_writer_unittest.cc
index 1cfdb56f2e96b7afa77bdd015356ff7cac2f8258..381eb39c03b9c206726a1de574ca3e796867b2a4 100644
--- a/tools/gn/ninja_binary_target_writer_unittest.cc
+++ b/tools/gn/ninja_binary_target_writer_unittest.cc
@@ -13,10 +13,8 @@
#include "tools/gn/test_with_scope.h"
TEST(NinjaBinaryTargetWriter, SourceSet) {
- TestWithScope setup;
Err err;
-
- setup.build_settings()->SetBuildDir(SourceDir("//out/Debug/"));
+ TestWithScope setup;
Target target(setup.settings(), Label(SourceDir("//foo/"), "bar"));
target.set_output_type(Target::SOURCE_SET);
@@ -257,10 +255,8 @@ TEST(NinjaBinaryTargetWriter, CompleteStaticLibrary) {
// This tests that output extension and output dir overrides apply, and input
// dependencies are applied.
TEST(NinjaBinaryTargetWriter, OutputExtensionAndInputDeps) {
- TestWithScope setup;
Err err;
-
- setup.build_settings()->SetBuildDir(SourceDir("//out/Debug/"));
+ TestWithScope setup;
// An action for our library to depend on.
Target action(setup.settings(), Label(SourceDir("//foo/"), "action"));
@@ -314,10 +310,8 @@ TEST(NinjaBinaryTargetWriter, OutputExtensionAndInputDeps) {
// Tests libs are applied.
TEST(NinjaBinaryTargetWriter, LibsAndLibDirs) {
- TestWithScope setup;
Err err;
-
- setup.build_settings()->SetBuildDir(SourceDir("//out/Debug/"));
+ TestWithScope setup;
// A shared library w/ libs and lib_dirs.
Target target(setup.settings(), Label(SourceDir("//foo/"), "shlib"));
@@ -351,10 +345,8 @@ TEST(NinjaBinaryTargetWriter, LibsAndLibDirs) {
}
TEST(NinjaBinaryTargetWriter, EmptyOutputExtension) {
- TestWithScope setup;
Err err;
-
- setup.build_settings()->SetBuildDir(SourceDir("//out/Debug/"));
+ TestWithScope setup;
// This test is the same as OutputExtensionAndInputDeps, except that we call
// set_output_extension("") and ensure that we get an empty one and override
@@ -397,10 +389,8 @@ TEST(NinjaBinaryTargetWriter, EmptyOutputExtension) {
}
TEST(NinjaBinaryTargetWriter, SourceSetDataDeps) {
- TestWithScope setup;
- setup.build_settings()->SetBuildDir(SourceDir("//out/Debug/"));
-
Err err;
+ TestWithScope setup;
// This target is a data (runtime) dependency of the intermediate target.
Target data(setup.settings(), Label(SourceDir("//foo/"), "data_target"));
@@ -479,16 +469,14 @@ TEST(NinjaBinaryTargetWriter, SourceSetDataDeps) {
}
TEST(NinjaBinaryTargetWriter, SharedLibraryModuleDefinitionFile) {
+ Err err;
TestWithScope setup;
- setup.build_settings()->SetBuildDir(SourceDir("//out/Debug/"));
Target shared_lib(setup.settings(), Label(SourceDir("//foo/"), "bar"));
shared_lib.set_output_type(Target::SHARED_LIBRARY);
shared_lib.SetToolchain(setup.toolchain());
shared_lib.sources().push_back(SourceFile("//foo/sources.cc"));
shared_lib.sources().push_back(SourceFile("//foo/bar.def"));
-
- Err err;
ASSERT_TRUE(shared_lib.OnResolved(&err));
std::ostringstream out;
@@ -515,16 +503,14 @@ TEST(NinjaBinaryTargetWriter, SharedLibraryModuleDefinitionFile) {
}
TEST(NinjaBinaryTargetWriter, LoadableModule) {
+ Err err;
TestWithScope setup;
- setup.build_settings()->SetBuildDir(SourceDir("//out/Debug/"));
Target loadable_module(setup.settings(), Label(SourceDir("//foo/"), "bar"));
loadable_module.set_output_type(Target::LOADABLE_MODULE);
loadable_module.visibility().SetPublic();
loadable_module.SetToolchain(setup.toolchain());
loadable_module.sources().push_back(SourceFile("//foo/sources.cc"));
-
- Err err;
ASSERT_TRUE(loadable_module.OnResolved(&err)) << err.message();
std::ostringstream out;
@@ -858,10 +844,8 @@ TEST(NinjaBinaryTargetWriter, DupeObjFileError) {
// This tests that output extension and output dir overrides apply, and input
// dependencies are applied.
TEST(NinjaBinaryTargetWriter, InputFiles) {
- TestWithScope setup;
Err err;
-
- setup.build_settings()->SetBuildDir(SourceDir("//out/Debug/"));
+ TestWithScope setup;
// This target has one input.
{
« no previous file with comments | « tools/gn/ninja_action_target_writer_unittest.cc ('k') | tools/gn/ninja_bundle_data_target_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698