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

Unified Diff: tools/gn/ninja_target_writer_unittest.cc

Issue 524623005: Add testonly flag to GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « tools/gn/ninja_copy_target_writer_unittest.cc ('k') | tools/gn/substitution_writer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/ninja_target_writer_unittest.cc
diff --git a/tools/gn/ninja_target_writer_unittest.cc b/tools/gn/ninja_target_writer_unittest.cc
index 67b55e185649d0e88cef86c082fae0f73c205642..08cde8fccdffbb7230aab30efc37f7d88838bbfe 100644
--- a/tools/gn/ninja_target_writer_unittest.cc
+++ b/tools/gn/ninja_target_writer_unittest.cc
@@ -32,6 +32,7 @@ class TestingNinjaTargetWriter : public NinjaTargetWriter {
TEST(NinjaTargetWriter, WriteInputDepsStampAndGetDep) {
TestWithScope setup;
+ Err err;
// Make a base target that's a hard dep (action).
Target base_target(setup.settings(), Label(SourceDir("//foo/"), "base"));
@@ -57,9 +58,9 @@ TEST(NinjaTargetWriter, WriteInputDepsStampAndGetDep) {
action.sources().push_back(SourceFile("//foo/action_source.txt"));
action.deps().push_back(LabelTargetPair(&target));
- base_target.OnResolved();
- target.OnResolved();
- action.OnResolved();
+ ASSERT_TRUE(base_target.OnResolved(&err));
+ ASSERT_TRUE(target.OnResolved(&err));
+ ASSERT_TRUE(action.OnResolved(&err));
// Input deps for the base (should be only the script itself).
{
@@ -105,6 +106,7 @@ TEST(NinjaTargetWriter, WriteInputDepsStampAndGetDep) {
// Tests WriteInputDepsStampAndGetDep when toolchain deps are present.
TEST(NinjaTargetWriter, WriteInputDepsStampAndGetDepWithToolchainDeps) {
TestWithScope setup;
+ Err err;
// Toolchain dependency. Here we make a target in the same toolchain for
// simplicity, but in real life (using the Builder) this would be rejected
@@ -114,14 +116,14 @@ TEST(NinjaTargetWriter, WriteInputDepsStampAndGetDepWithToolchainDeps) {
Label(SourceDir("//foo/"), "setup"));
toolchain_dep_target.set_output_type(Target::ACTION);
toolchain_dep_target.SetToolchain(setup.toolchain());
- toolchain_dep_target.OnResolved();
+ ASSERT_TRUE(toolchain_dep_target.OnResolved(&err));
setup.toolchain()->deps().push_back(LabelTargetPair(&toolchain_dep_target));
// Make a binary target
Target target(setup.settings(), Label(SourceDir("//foo/"), "target"));
target.set_output_type(Target::EXECUTABLE);
target.SetToolchain(setup.toolchain());
- target.OnResolved();
+ ASSERT_TRUE(target.OnResolved(&err));
std::ostringstream stream;
TestingNinjaTargetWriter writer(&target, setup.toolchain(), stream);
« no previous file with comments | « tools/gn/ninja_copy_target_writer_unittest.cc ('k') | tools/gn/substitution_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698