Ninja
FakeCommandRunner Struct Reference

Fake implementation of CommandRunner, useful for tests. More...

Inheritance diagram for FakeCommandRunner:

Public Member Functions

virtual void Abort ()
 
virtual size_t CanRunMore () const
 
 FakeCommandRunner (VirtualFileSystem *fs)
 
virtual vector< Edge * > GetActiveEdges ()
 
virtual bool StartCommand (Edge *edge)
 
virtual bool WaitForCommand (Result *result)
 Wait for a command to complete, or return false if interrupted.
 

Static Public Member Functions

static CommandRunnerfactory (const BuildConfig &config, Jobserver::Client *jobserver)
 Creates the RealCommandRunner.
 

Public Attributes

vector< Edge * > active_edges_
 
vector< string > commands_ran_
 
VirtualFileSystemfs_
 
size_t max_active_edges_
 

Detailed Description

Fake implementation of CommandRunner, useful for tests.

Definition at line 520 of file build_test.cc.

Constructor & Destructor Documentation

◆ FakeCommandRunner()

FakeCommandRunner::FakeCommandRunner ( VirtualFileSystem * fs)
inlineexplicit

Definition at line 521 of file build_test.cc.

References fs_, and max_active_edges_.

Member Function Documentation

◆ Abort()

void FakeCommandRunner::Abort ( )
virtual

Reimplemented from CommandRunner.

Definition at line 801 of file build_test.cc.

References active_edges_.

◆ CanRunMore()

size_t FakeCommandRunner::CanRunMore ( ) const
virtual

Implements CommandRunner.

Definition at line 626 of file build_test.cc.

References active_edges_, and max_active_edges_.

◆ factory()

CommandRunner * CommandRunner::factory ( const BuildConfig & config,
Jobserver::Client * jobserver )
staticinherited

Creates the RealCommandRunner.

  • jobserver can be nullptr if there is no jobserver pool to use.

Definition at line 117 of file real_command_runner.cc.

Referenced by Builder::Build().

◆ GetActiveEdges()

vector< Edge * > FakeCommandRunner::GetActiveEdges ( )
virtual

Reimplemented from CommandRunner.

Definition at line 797 of file build_test.cc.

References active_edges_.

◆ StartCommand()

◆ WaitForCommand()

bool FakeCommandRunner::WaitForCommand ( Result * result)
virtual

Member Data Documentation

◆ active_edges_

vector<Edge*> FakeCommandRunner::active_edges_

Definition at line 532 of file build_test.cc.

Referenced by Abort(), CanRunMore(), GetActiveEdges(), StartCommand(), and WaitForCommand().

◆ commands_ran_

vector<string> FakeCommandRunner::commands_ran_

Definition at line 531 of file build_test.cc.

Referenced by StartCommand(), and TestPhonyUseCase().

◆ fs_

VirtualFileSystem* FakeCommandRunner::fs_

Definition at line 534 of file build_test.cc.

Referenced by FakeCommandRunner(), StartCommand(), and WaitForCommand().

◆ max_active_edges_

size_t FakeCommandRunner::max_active_edges_

Definition at line 533 of file build_test.cc.

Referenced by CanRunMore(), FakeCommandRunner(), and StartCommand().


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