Ninja
Public Member Functions | Public Attributes | List of all members
BuildTest Struct Reference
Inheritance diagram for BuildTest:
Inheritance graph
[legend]

Public Member Functions

void AddCatRule (State *state)
 Add a "cat" rule to state. More...
 
 BuildTest ()
 
 BuildTest (DepsLog *log)
 
void Dirty (const string &path)
 
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 SetUp ()
 
 ~BuildTest ()
 

Public Attributes

Builder builder_
 
FakeCommandRunner command_runner_
 
BuildConfig config_
 
VirtualFileSystem fs_
 
State state_
 
StatusPrinter status_
 

Detailed Description

Definition at line 537 of file build_test.cc.

Constructor & Destructor Documentation

◆ BuildTest() [1/2]

BuildTest::BuildTest ( )
inline

Definition at line 538 of file build_test.cc.

◆ BuildTest() [2/2]

BuildTest::BuildTest ( DepsLog log)
inlineexplicit

Definition at line 542 of file build_test.cc.

◆ ~BuildTest()

BuildTest::~BuildTest ( )
inline

Definition at line 559 of file build_test.cc.

Member Function Documentation

◆ 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().

◆ Dirty()

void BuildTest::Dirty ( const string &  path)

Definition at line 805 of file build_test.cc.

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

◆ 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.

Referenced by TestPhonyUseCase().

◆ IsPathDead()

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

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 563 of file build_test.cc.

◆ MakeConfig()

BuildConfig BuildTest::MakeConfig ( )
inline

Definition at line 575 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 
)

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 588 of file build_test.cc.

References Builder::AddTarget(), Builder::AlreadyUpToDate(), AssertParse(), Builder::Build(), Builder::command_runner_, ExitSuccess, DepsLog::Load(), BuildLog::Load(), BuildLog::OpenForWrite(), and DepsLog::OpenForWrite().

◆ SetUp()

virtual void BuildTest::SetUp ( )
inlinevirtual

Member Data Documentation

◆ builder_

Builder BuildTest::builder_

Definition at line 585 of file build_test.cc.

Referenced by TestPhonyUseCase().

◆ command_runner_

FakeCommandRunner BuildTest::command_runner_

Definition at line 582 of file build_test.cc.

Referenced by TestPhonyUseCase().

◆ config_

BuildConfig BuildTest::config_

Definition at line 581 of file build_test.cc.

◆ fs_

VirtualFileSystem BuildTest::fs_

Definition at line 583 of file build_test.cc.

Referenced by TestPhonyUseCase().

◆ state_

State StateTestWithBuiltinRules::state_
inherited

Definition at line 40 of file test.h.

Referenced by TestPhonyUseCase().

◆ status_

StatusPrinter BuildTest::status_

Definition at line 584 of file build_test.cc.


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