vendredi 2 octobre 2015

Unit testing as part of the build

I have a CMake project separated in three parts:

  1. Compilation of my libraries
  2. Compilation of many unit tests programs testing each precise subpart of those libraries
  3. Compilation of program samples using those libraries

My question is about the 2nd part. My unit tests executables are short binary programs with a main returning 0 on success, 1 on fail. I would like to integrate their running as part of the build.

Is it possible to use CMake to do one of those two solutions:

  • Run every unit test program and check return values and generate an error if any fail.
  • Generate a test script that would run and check every unit test program and check return values to yield an error if any fail.

I'm not looking for a complete CMake script code, a simple indication on what is possible with a link to corresponding documentation would be enough.

Aucun commentaire:

Enregistrer un commentaire