class ConsoleTest

Defined at line 42 of file ../../src/developer/debug/zxdb/console/console_test.h

Test harness that sets up a RemoteAPITest (mocked target by replacing IPC) with a MockConsole

(mocked console I/O) and a process/thread.

The thread will be initially running. Often the first thing tests will want to do is call:

std::vector

<std

::unique_ptr

<Frame

>> frames;

frames.push_back(std::make_unique

<MockFrame

>(...));

InjectExceptionWithStack(ConsoleTest::kProcessKoid, ConsoleTest::kThreadKoid,

debug_ipc::ExceptionType::kSingleStep, std::move(frames), true);

Then to inject commands:

console().ProcessInputLine("do something");

And to check output:

auto event = console().GetOutputEvent();

EXPECT_EQ(MockConsole::OutputEvent::Type::kOutput, event.type);

EXPECT_EQ("Some output", event.output.AsString());

Most of the ability to set up the process environment is on the RemoteAPITest base class. To get

a mock module symbols for symbol tests, do:

auto mock_module = InjectMockModule(process(), 0x12345000); // Address is optional.

Public Members

static const uint64_t kProcessKoid
static const uint64_t kThreadKoid

Protected Members

unique_ptr console_

Public Methods

void SetUp ()

testing::Test implementation.

Defined at line 14 of file ../../src/developer/debug/zxdb/console/console_test.cc

void TearDown ()

Defined at line 27 of file ../../src/developer/debug/zxdb/console/console_test.cc

MockConsole & console ()

Defined at line 48 of file ../../src/developer/debug/zxdb/console/console_test.h

Process * process ()

Defined at line 50 of file ../../src/developer/debug/zxdb/console/console_test.h

Thread * thread ()

Defined at line 51 of file ../../src/developer/debug/zxdb/console/console_test.h