I am new to the C++ language and I am trying to understand the Catch2 unit test framework. I followed the example given on the github page.
I use visual studio code with the compiler g++ 12.2.0. I made a simple project with two files;
catch.hpp
test.cpp
the catch.hpp file contains the source downloaded from the github repo.
/*
* Catch v2.13.9
* Generated: 2022-04-12 22:37:23.260201
* ----------------------------------------------------------
* This file has been merged from multiple headers. Please don't edit it directly
* Copyright (c) 2022 Two Blue Cubes Ltd. All rights reserved.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
On the other hand, I made a simple test file, test.cpp, which contains;
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include "catch.hpp"
TEST_CASE("some test", "[simple_test_case]"){
REQUIRE(1 == 1);
}
When I run the compile task from visual studio code to compile the test.cpp file, the build is finished correctly. If I then try to run the build executable, nothing happens. If I try to debug the test.cpp file, also nothing happens and no breakpoint is hit. Furthermore, an error message is given,
ERROR: Unable to start debugging. Unexpected GDB output from command "-exec- run". During startup program exited with code 0xc0000139.
Does anyone know what I am doing wrong? I think I missed something, but I cannot grasp what it is.