Ninja
Public Member Functions | Public Attributes | List of all members
BuildWithDepsLogTest Struct Referenceabstract

Tests of builds involving deps logs necessarily must span multiple builds. More...

Inheritance diagram for BuildWithDepsLogTest:
Inheritance graph
[legend]

Public Member Functions

void AddAssertionFailure ()
 
void AddCatRule (State *state)
 Add a "cat" rule to state. More...
 
int AssertionFailures () const
 
 BuildWithDepsLogTest ()
 
bool Check (bool condition, const char *file, int line, const char *error)
 
void Dirty (const string &path)
 
bool Failed () const
 
NodeGetNode (const std::string &path)
 Short way to get a Node by its path from state_. More...
 
virtual bool IsPathDead (StringPiece s) const
 Return if a given output is no longer part of the build manifest. More...
 
BuildConfig MakeConfig ()
 
void RebuildTarget (const string &target, const char *manifest, const char *log_path=NULL, const char *deps_path=NULL, State *state=NULL)
 Rebuild target in the 'working tree' (fs_). More...
 
virtual void Run ()=0
 
virtual void SetUp ()
 
virtual void TearDown ()
 

Public Attributes

void * builder_
 Shadow parent class builder_ so we don't accidentally use it. More...
 
FakeCommandRunner command_runner_
 
BuildConfig config_
 
VirtualFileSystem fs_
 
State state_
 
BuildStatus status_
 
ScopedTempDir temp_dir_
 

Detailed Description

Tests of builds involving deps logs necessarily must span multiple builds.

We reuse methods on BuildTest but not the builder_ it sets up, because we want pristine objects for each build.

Definition at line 2087 of file build_test.cc.

Constructor & Destructor Documentation

◆ BuildWithDepsLogTest()

BuildWithDepsLogTest::BuildWithDepsLogTest ( )
inline

Definition at line 2088 of file build_test.cc.

Member Function Documentation

◆ AddAssertionFailure()

void testing::Test::AddAssertionFailure ( )
inlineinherited

Definition at line 42 of file test.h.

References testing::Test::assertion_failures_.

◆ AddCatRule()

void StateTestWithBuiltinRules::AddCatRule ( State state)
inherited

Add a "cat" rule to state.

Used by some tests; it's otherwise done by the ctor to state_.

Definition at line 89 of file test.cc.

References AssertParse().

◆ AssertionFailures()

int testing::Test::AssertionFailures ( ) const
inlineinherited

Definition at line 41 of file test.h.

References testing::Test::assertion_failures_.

◆ Check()

bool testing::Test::Check ( bool  condition,
const char *  file,
int  line,
const char *  error 
)
inherited

Definition at line 121 of file ninja_test.cc.

References printer, and LinePrinter::PrintOnNewLine().

◆ Dirty()

void BuildTest::Dirty ( const string &  path)
inherited

Definition at line 697 of file build_test.cc.

References Node::in_edge(), Node::MarkDirty(), and Node::MarkMissing().

◆ Failed()

bool testing::Test::Failed ( ) const
inlineinherited

Definition at line 40 of file test.h.

References testing::Test::failed_.

Referenced by main().

◆ GetNode()

Node * StateTestWithBuiltinRules::GetNode ( const std::string &  path)
inherited

Short way to get a Node by its path from state_.

Definition at line 95 of file test.cc.

References EXPECT_FALSE.

◆ IsPathDead()

virtual bool BuildTest::IsPathDead ( StringPiece  s) const
inlinevirtualinherited

Return if a given output is no longer part of the build manifest.

This is only called during recompaction and doesn't have to be fast.

Implements BuildLogUser.

Definition at line 515 of file build_test.cc.

◆ MakeConfig()

BuildConfig BuildTest::MakeConfig ( )
inlineinherited

Definition at line 527 of file build_test.cc.

References BuildConfig::QUIET, and BuildConfig::verbosity.

◆ RebuildTarget()

void BuildTest::RebuildTarget ( const string &  target,
const char *  manifest,
const char *  log_path = NULL,
const char *  deps_path = NULL,
State state = NULL 
)
inherited

Rebuild target in the 'working tree' (fs_).

State of command_runner_ and logs contents (if specified) ARE MODIFIED. Handy to check for NOOP builds, and higher-level rebuild tests.

Definition at line 541 of file build_test.cc.

References Builder::AddTarget(), Builder::AlreadyUpToDate(), ASSERT_EQ, ASSERT_NO_FATAL_FAILURE, ASSERT_TRUE, AssertParse(), Builder::Build(), Builder::command_runner_, EXPECT_TRUE, BuildLog::Load(), DepsLog::Load(), BuildLog::OpenForWrite(), and DepsLog::OpenForWrite().

◆ Run()

virtual void testing::Test::Run ( )
pure virtualinherited

Referenced by main().

◆ SetUp()

virtual void BuildWithDepsLogTest::SetUp ( )
inlinevirtual

Reimplemented from BuildTest.

Definition at line 2090 of file build_test.cc.

References BuildTest::SetUp().

◆ TearDown()

virtual void BuildWithDepsLogTest::TearDown ( )
inlinevirtual

Reimplemented from testing::Test.

Definition at line 2096 of file build_test.cc.

Member Data Documentation

◆ builder_

void* BuildWithDepsLogTest::builder_

Shadow parent class builder_ so we don't accidentally use it.

Definition at line 2103 of file build_test.cc.

◆ command_runner_

FakeCommandRunner BuildTest::command_runner_
inherited

Definition at line 534 of file build_test.cc.

◆ config_

BuildConfig BuildTest::config_
inherited

Definition at line 533 of file build_test.cc.

◆ fs_

VirtualFileSystem BuildTest::fs_
inherited

Definition at line 535 of file build_test.cc.

◆ state_

State StateTestWithBuiltinRules::state_
inherited

Definition at line 123 of file test.h.

◆ status_

BuildStatus BuildTest::status_
inherited

Definition at line 538 of file build_test.cc.

◆ temp_dir_

ScopedTempDir BuildWithDepsLogTest::temp_dir_

Definition at line 2100 of file build_test.cc.


The documentation for this struct was generated from the following file: