MockAppLauncher

The smallest thing a Node will accept as its launcher.

Inherits IAppLauncher

Declared in src/libs/libmocknode/mocknode/MockAppLauncher.hpp.

Detailed description

Why this is not AppLauncher

Node::appConfigure() takes an IAppLauncher, and Node uses exactly two things from it: context(), and the pointer it hands back from launcher(). It never calls run(), never asks for a window, and never names the concrete type. The interface is two methods wide.

AppLauncher<T> is the production implementation and it carries a QCoreApplication pointer, a StyleManager, a window and a main-loop return value — none of which a test wants, and the window least of all. A suite that instantiates it either drags that machinery in or leans on the template never instantiating the members it does not call, which is a property of the compiler rather than a decision anybody made.

This class is the decision: a launcher is a context and an activation acknowledgement, and a test supplies both.

What it records

appActivateDone() is a real signal from the node's side of the lifecycle, so it is counted rather than ignored. A suite that drives appActivate() can assert the acknowledgement arrived, which is otherwise invisible.

See also MockNodeHarness, IAppLauncher, AppLauncher.

In this section