How to run/execute a unit testing framework like "catch2" in Unix Bash?

825 Views Asked by At

I am trying to learn testing with makefiles . I searched online for a framework. Many people talked about "catch2" so I downloaded it. I read the tutorial in git and I've searched about it in many other webpages. I wrote this : mytests (without any suffix in the name) to check myprogram.cpp.

#define CATCH_CONFIG_RUNNER
#define CATCH_CONFIG_MAIN 
#include "catch.hpp"

TEST_CASE("maximum space is","[myprogram]"){
    REQUIRE( myprogram(test.in1)==50)
    REQUIRE( myprogram(test.in2)==20)
    REQUIRE( myprogram(test.in3) ==1100)
    REQUIRE( myprogram(test.in4)==23)
    REQUIRE( myprogram(test.in5)==10);
}

The are many articles about how to write this and how to add features and specialisations or how to run it while choosing which tests to run and other stuff...
But I could not find somewhere explicitly explaining how to run this . I am a beginner . I know that I can run a single test in my program which takes as input a file, like that : ./myprogram test.in1 . So, what I need to type to use this testing framework??

0

There are 0 best solutions below