summaryrefslogtreecommitdiffstats
path: root/src/graph_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/graph_test.cc')
-rw-r--r--src/graph_test.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/graph_test.cc b/src/graph_test.cc
index 4b41f8a..2bc0c17 100644
--- a/src/graph_test.cc
+++ b/src/graph_test.cc
@@ -17,7 +17,10 @@
#include "test.h"
struct GraphTest : public StateTestWithBuiltinRules {
+ GraphTest() : scan_(&state_, &fs_) {}
+
VirtualFileSystem fs_;
+ DependencyScan scan_;
};
TEST_F(GraphTest, MissingImplicit) {
@@ -28,7 +31,7 @@ TEST_F(GraphTest, MissingImplicit) {
Edge* edge = GetNode("out")->in_edge();
string err;
- EXPECT_TRUE(edge->RecomputeDirty(&state_, &fs_, &err));
+ EXPECT_TRUE(scan_.RecomputeDirty(edge, &err));
ASSERT_EQ("", err);
// A missing implicit dep *should* make the output dirty.
@@ -46,7 +49,7 @@ TEST_F(GraphTest, ModifiedImplicit) {
Edge* edge = GetNode("out")->in_edge();
string err;
- EXPECT_TRUE(edge->RecomputeDirty(&state_, &fs_, &err));
+ EXPECT_TRUE(scan_.RecomputeDirty(edge, &err));
ASSERT_EQ("", err);
// A modified implicit dep should make the output dirty.
@@ -66,7 +69,7 @@ TEST_F(GraphTest, FunkyMakefilePath) {
Edge* edge = GetNode("out.o")->in_edge();
string err;
- EXPECT_TRUE(edge->RecomputeDirty(&state_, &fs_, &err));
+ EXPECT_TRUE(scan_.RecomputeDirty(edge, &err));
ASSERT_EQ("", err);
// implicit.h has changed, though our depfile refers to it with a
@@ -89,7 +92,7 @@ TEST_F(GraphTest, ExplicitImplicit) {
Edge* edge = GetNode("out.o")->in_edge();
string err;
- EXPECT_TRUE(edge->RecomputeDirty(&state_, &fs_, &err));
+ EXPECT_TRUE(scan_.RecomputeDirty(edge, &err));
ASSERT_EQ("", err);
// We have both an implicit and an explicit dep on implicit.h.
@@ -110,7 +113,7 @@ TEST_F(GraphTest, PathWithCurrentDirectory) {
Edge* edge = GetNode("out.o")->in_edge();
string err;
- EXPECT_TRUE(edge->RecomputeDirty(&state_, &fs_, &err));
+ EXPECT_TRUE(scan_.RecomputeDirty(edge, &err));
ASSERT_EQ("", err);
EXPECT_FALSE(GetNode("out.o")->dirty());
@@ -154,7 +157,7 @@ TEST_F(GraphTest, DepfileWithCanonicalizablePath) {
Edge* edge = GetNode("out.o")->in_edge();
string err;
- EXPECT_TRUE(edge->RecomputeDirty(&state_, &fs_, &err));
+ EXPECT_TRUE(scan_.RecomputeDirty(edge, &err));
ASSERT_EQ("", err);
EXPECT_FALSE(GetNode("out.o")->dirty());
@@ -174,13 +177,13 @@ TEST_F(GraphTest, DepfileRemoved) {
Edge* edge = GetNode("out.o")->in_edge();
string err;
- EXPECT_TRUE(edge->RecomputeDirty(&state_, &fs_, &err));
+ EXPECT_TRUE(scan_.RecomputeDirty(edge, &err));
ASSERT_EQ("", err);
EXPECT_FALSE(GetNode("out.o")->dirty());
state_.Reset();
fs_.RemoveFile("out.o.d");
- EXPECT_TRUE(edge->RecomputeDirty(&state_, &fs_, &err));
+ EXPECT_TRUE(scan_.RecomputeDirty(edge, &err));
ASSERT_EQ("", err);
EXPECT_TRUE(GetNode("out.o")->dirty());
}