|
Ninja
|


Go to the source code of this file.
Classes | |
| struct | VirtualFileSystem::Entry |
| An entry for a single in-memory file. More... | |
| struct | ScopedTempDir |
| struct | StateTestWithBuiltinRules |
| A base test fixture that includes a State object with a builtin "cat" rule. More... | |
| class | testing::Test |
| struct | VirtualFileSystem |
| An implementation of DiskInterface that uses an in-memory representation of disk state. More... | |
Namespaces | |
| testing | |
Macros | |
| #define | ASSERT_EQ(a, b) if (!EXPECT_EQ(a, b)) { g_current_test->AddAssertionFailure(); return; } |
| #define | ASSERT_FALSE(a) if (!EXPECT_FALSE(a)) { g_current_test->AddAssertionFailure(); return; } |
| #define | ASSERT_GE(a, b) if (!EXPECT_GE(a, b)) { g_current_test->AddAssertionFailure(); return; } |
| #define | ASSERT_GT(a, b) if (!EXPECT_GT(a, b)) { g_current_test->AddAssertionFailure(); return; } |
| #define | ASSERT_LE(a, b) if (!EXPECT_LE(a, b)) { g_current_test->AddAssertionFailure(); return; } |
| #define | ASSERT_LT(a, b) if (!EXPECT_LT(a, b)) { g_current_test->AddAssertionFailure(); return; } |
| #define | ASSERT_NE(a, b) if (!EXPECT_NE(a, b)) { g_current_test->AddAssertionFailure(); return; } |
| #define | ASSERT_NO_FATAL_FAILURE(a) |
| #define | ASSERT_TRUE(a) if (!EXPECT_TRUE(a)) { g_current_test->AddAssertionFailure(); return; } |
| #define | EXPECT_EQ(a, b) g_current_test->Check(a == b, __FILE__, __LINE__, #a " == " #b) |
| #define | EXPECT_FALSE(a) g_current_test->Check(!static_cast<bool>(a), __FILE__, __LINE__, #a) |
| #define | EXPECT_GE(a, b) g_current_test->Check(a >= b, __FILE__, __LINE__, #a " >= " #b) |
| #define | EXPECT_GT(a, b) g_current_test->Check(a > b, __FILE__, __LINE__, #a " > " #b) |
| #define | EXPECT_LE(a, b) g_current_test->Check(a <= b, __FILE__, __LINE__, #a " <= " #b) |
| #define | EXPECT_LT(a, b) g_current_test->Check(a < b, __FILE__, __LINE__, #a " < " #b) |
| #define | EXPECT_NE(a, b) g_current_test->Check(a != b, __FILE__, __LINE__, #a " != " #b) |
| #define | EXPECT_TRUE(a) g_current_test->Check(static_cast<bool>(a), __FILE__, __LINE__, #a) |
| #define | TEST(x, y) TEST_F_(testing::Test, x##y, #x "." #y) |
| #define | TEST_F(x, y) TEST_F_(x, x##y, #x "." #y) |
| #define | TEST_F_(x, y, name) |
Functions | |
| void | AssertHash (const char *expected, uint64_t actual) |
| void | AssertParse (State *state, const char *input, ManifestParserOptions=ManifestParserOptions()) |
| void | RegisterTest (testing::Test *(*)(), const char *) |
| void | VerifyGraph (const State &state) |
Variables | |
| testing::Test * | g_current_test |
| #define ASSERT_EQ | ( | a, | |
| b | |||
| ) | if (!EXPECT_EQ(a, b)) { g_current_test->AddAssertionFailure(); return; } |
Definition at line 81 of file test.h.
Referenced by AssertHash(), ParserTest::AssertParse(), DyndepParserTest::AssertParse(), AssertParse(), BuildTest::RebuildTarget(), BuildWithQueryDepsLogTest::SetUp(), TEST(), TEST_F(), and PlanTest::TestPoolWithDepthOne().
| #define ASSERT_FALSE | ( | a | ) | if (!EXPECT_FALSE(a)) { g_current_test->AddAssertionFailure(); return; } |
Definition at line 95 of file test.h.
Referenced by PlanTest::FindWorkSorted(), TEST(), TEST_F(), and PlanTest::TestPoolWithDepthOne().
| #define ASSERT_GE | ( | a, | |
| b | |||
| ) | if (!EXPECT_GE(a, b)) { g_current_test->AddAssertionFailure(); return; } |
| #define ASSERT_GT | ( | a, | |
| b | |||
| ) | if (!EXPECT_GT(a, b)) { g_current_test->AddAssertionFailure(); return; } |
| #define ASSERT_LE | ( | a, | |
| b | |||
| ) | if (!EXPECT_LE(a, b)) { g_current_test->AddAssertionFailure(); return; } |
| #define ASSERT_LT | ( | a, | |
| b | |||
| ) | if (!EXPECT_LT(a, b)) { g_current_test->AddAssertionFailure(); return; } |
| #define ASSERT_NE | ( | a, | |
| b | |||
| ) | if (!EXPECT_NE(a, b)) { g_current_test->AddAssertionFailure(); return; } |
| #define ASSERT_NO_FATAL_FAILURE | ( | a | ) |
Definition at line 97 of file test.h.
Referenced by BuildTest::RebuildTarget(), TEST_F(), and PlanTest::TestPoolWithDepthOne().
| #define ASSERT_TRUE | ( | a | ) | if (!EXPECT_TRUE(a)) { g_current_test->AddAssertionFailure(); return; } |
Definition at line 93 of file test.h.
Referenced by PlanTest::FindWorkSorted(), BuildTest::RebuildTarget(), BuildWithQueryDepsLogTest::SetUp(), TEST(), TEST_F(), and PlanTest::TestPoolWithDepthOne().
| #define EXPECT_EQ | ( | a, | |
| b | |||
| ) | g_current_test->Check(a == b, __FILE__, __LINE__, #a " == " #b) |
Definition at line 64 of file test.h.
Referenced by TEST(), TEST_F(), and VerifyGraph().
| #define EXPECT_FALSE | ( | a | ) | g_current_test->Check(!static_cast<bool>(a), __FILE__, __LINE__, #a) |
Definition at line 78 of file test.h.
Referenced by StateTestWithBuiltinRules::GetNode(), TEST(), TEST_F(), and VerifyGraph().
| #define EXPECT_GE | ( | a, | |
| b | |||
| ) | g_current_test->Check(a >= b, __FILE__, __LINE__, #a " >= " #b) |
| #define EXPECT_GT | ( | a, | |
| b | |||
| ) | g_current_test->Check(a > b, __FILE__, __LINE__, #a " > " #b) |
| #define EXPECT_LE | ( | a, | |
| b | |||
| ) | g_current_test->Check(a <= b, __FILE__, __LINE__, #a " <= " #b) |
| #define EXPECT_LT | ( | a, | |
| b | |||
| ) | g_current_test->Check(a < b, __FILE__, __LINE__, #a " < " #b) |
| #define EXPECT_NE | ( | a, | |
| b | |||
| ) | g_current_test->Check(a != b, __FILE__, __LINE__, #a " != " #b) |
Definition at line 66 of file test.h.
Referenced by TEST_F(), and VerifyGraph().
| #define EXPECT_TRUE | ( | a | ) | g_current_test->Check(static_cast<bool>(a), __FILE__, __LINE__, #a) |
Definition at line 76 of file test.h.
Referenced by ParserTest::AssertParse(), DyndepParserTest::AssertParse(), AssertParse(), BuildTest::RebuildTarget(), TEST(), TEST_F(), PlanTest::TestPoolWithDepthOne(), and FakeCommandRunner::WaitForCommand().
| #define TEST | ( | x, | |
| y | |||
| ) | TEST_F_(testing::Test, x##y, #x "." #y) |
| #define TEST_F_ | ( | x, | |
| y, | |||
| name | |||
| ) |
| void AssertHash | ( | const char * | expected, |
| uint64_t | actual | ||
| ) |
Definition at line 109 of file test.cc.
References ASSERT_EQ, and BuildLog::LogEntry::HashCommand().
Referenced by TEST_F().
| void AssertParse | ( | State * | state, |
| const char * | input, | ||
| ManifestParserOptions | = ManifestParserOptions() |
||
| ) |
Definition at line 100 of file test.cc.
References ASSERT_EQ, EXPECT_TRUE, ManifestParser::ParseTest(), and VerifyGraph().
Referenced by StateTestWithBuiltinRules::AddCatRule(), BuildTest::RebuildTarget(), DyndepParserTest::SetUp(), BuildTest::SetUp(), TEST_F(), and PlanTest::TestPoolWithDepthOne().
| void RegisterTest | ( | testing::Test * | *)(, |
| const char * | |||
| ) |
| void VerifyGraph | ( | const State & | state | ) |
Definition at line 113 of file test.cc.
References State::edges_, EXPECT_EQ, EXPECT_FALSE, EXPECT_NE, Node::in_edge(), Node::out_edges(), and State::paths_.
Referenced by ParserTest::AssertParse(), and AssertParse().
| testing::Test* g_current_test |
Definition at line 43 of file ninja_test.cc.
1.8.14