0

There are a bunch of unit test frameworks for C++; see:

here on the site. However, none of them - to my knowledge - caters to following situation:

  • You have a function f() you wish to test;
  • The test function is "pure" - its output only depends on the input.
  • The inputs are not just scalars, they may be large buffers or data structures in memory. But - they're self-contained and serializable (e.g. no pointers to outside the structure)

the framework must offer a mechanism to specify f(), specify its scalar/small-fixed-size arguments, and indicate where to obtain its arguments from, e.g. paths of files to read into memory for each of the inputs. The result of f() is either just written to an output file or compared against known outputs, also possibly coming from a file. So the unit testing framework takes care of buffer allocation and freeing, I/O, and allowing whoever is running the test to specify argument values and paths on the command-line.

Other requirements:

  • Libre
  • Gratis

Desired features:

  • Actively maintained
  • Multi-platform
  • Actively maintained
  • Uses modern C++ (and not a lot of ugly macros or baroque syntax)
  • Can be compiled using a range of C++ language standard

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.