Skip to content

Commit

Permalink
[adapt tests]
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed Jun 1, 2023
1 parent 82fab67 commit 3015d4b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/build_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1637,6 +1637,8 @@ TEST_F(BuildWithLogTest, ImplicitGeneratedOutOfDate2) {
EXPECT_FALSE(GetNode("out.imp")->dirty());
}

#define SYMMETRY 1

TEST_F(BuildWithLogTest, NotInLogButOnDisk) {
ASSERT_NO_FATAL_FAILURE(AssertParse(&state_,
"rule cc\n"
Expand All @@ -1652,6 +1654,9 @@ TEST_F(BuildWithLogTest, NotInLogButOnDisk) {
// Because it's not in the log, it should not be up-to-date until
// we build again.
EXPECT_TRUE(builder_.AddTarget("out1", &err));
#ifdef SYMMETRY
EXPECT_TRUE(builder_.AlreadyUpToDate());
#else
EXPECT_FALSE(builder_.AlreadyUpToDate());

command_runner_.commands_ran_.clear();
Expand All @@ -1660,6 +1665,7 @@ TEST_F(BuildWithLogTest, NotInLogButOnDisk) {
EXPECT_TRUE(builder_.AddTarget("out1", &err));
EXPECT_TRUE(builder_.Build(&err));
EXPECT_TRUE(builder_.AlreadyUpToDate());
#endif
}

TEST_F(BuildWithLogTest, RebuildAfterFailure) {
Expand Down Expand Up @@ -1701,10 +1707,14 @@ TEST_F(BuildWithLogTest, RebuildAfterFailure) {

// Run again, should rerun even though the output file is up to date on disk
EXPECT_TRUE(builder_.AddTarget("out1", &err));
#ifdef SYMMETRY
EXPECT_TRUE(builder_.AlreadyUpToDate());
#else
EXPECT_FALSE(builder_.AlreadyUpToDate());
EXPECT_TRUE(builder_.Build(&err));
EXPECT_EQ(1u, command_runner_.commands_ran_.size());
EXPECT_EQ("", err);
#endif
}

TEST_F(BuildWithLogTest, RebuildWithNoInputs) {
Expand Down

0 comments on commit 3015d4b

Please sign in to comment.