How it works

In this example, we defined a text fixture and called it my-fixture. We gave the setup test the FIXTURES_SETUP property and the cleanup test the FIXTURES_CLEANUP property, and, using FIXTURES_REQUIRED, we made sure that the tests feature-a and feature-b both required the setup and cleanup steps in order to be run. Binding these together ensures that we always enter and leave steps in a well-defined state.

Get CMake Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.