Up: MicroBenchmark Concepts   [Contents][Index]


1.2.1 Execution Stages

The execution flow of a test case is composed of three sequential stages:

  1. Preparation Stage

    The Set Up stage receives the execution state object as a parameter and allocates the fixture for the test code and prepares the environment for its execution.

  2. Test Stage
    • Automatic Test

      An automatic test receives the allocated fixture directly and does not have direct access to the execution state. It is invoked repeatedly by the framework and measures are sampled after certain amount of iterations.

    • Directed Test

      A directed test receives the framework execution state object (see State Reference) as its parameter, where the allocated fixture by the previous stage is stored. This is the concept used by Google Benchmark, where code must manually loop on the state.

  3. Finalization Stage

    The Tear Down stage releases the resources allocated for the fixture and performs any other cleanup needed.