GithubHelp home page GithubHelp logo

mjml / testmatrix Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 48 KB

Testing framework that generates test stubs using directives given in C++ block comments. Written in Perl6.

License: GNU General Public License v3.0

C++ 4.22% Raku 95.78%

testmatrix's Introduction

C++ Test Generator Framework

Description

This script produces a file called Makefile.matrix. You can use this to build and run unit tests from C++ source code.

Each suite of tests is built from a single .cpp file that contains a number of directives. Some of these directives allow you to specify a list of alternates. For each alternate, a different test binary is produced. When you specify a range of alternates in this way, you define a new dimension or axis of the resulting test matrix. When you specify several axes, the script will compose these dimensions into a single dense multidimensional matrix of test executables to build and run, and all of this from a single source file.

As an added feature, the script will generate a short descriptor that identifies a given test executable within the matrix. This descriptor is appended to the filename of the test executable.

Example

Say you have a file named test1.cpp:

/**
 * @cxxparams "-I.. -g"
 * @cxxparams [ -DDEBUG=0, -DDEBUG=1 ]
 **/

#include <stdio.h>
...

The block comment delimited by /** .. **/ is combed out by the script and parsed.

On the second line, some @cxxparams values are in quotes. These parameters are applied to all targets of this module.

On the third line, the script finds that there are two alternatives to the @cxxparams for this test module. So, it will generate Makefile rules to build targets test1-a.obj and test1-b.obj, and also executables named test1-a and test1-b. Each will have an alternate definition of these parameters based on the values in the list.

Other axes can be defined for other stages of the compile/link/run testing process. For example, there is an analogous @ldparams directive and you can also specify a list of input files as well.

Other directives

You can use @include to parse a separate file containing directives. These follow the same grammar as that parsed out of the C++ block comments.

testmatrix's People

Contributors

mjml avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.