Why "Test framework quit unexpectedly" in CLion with boost.test?

479 views Asked by At

I'm doing a small project. And I tried adding some unit tests using Boost.Test. This is a simple testing test:

#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MAIN 
#include <boost/test/unit_test.hpp>

    BOOST_AUTO_TEST_SUITE(TestSuitetest)

        BOOST_AUTO_TEST_CASE(testConstructorTests)
        {
            BOOST_TEST(true);
            BOOST_TEST(!false);

        }
    BOOST_AUTO_TEST_SUITE_END()

This is CMake:

set (Boost_USE_STATIC_LIBS OFF)
find_package (Boost REQUIRED COMPONENTS unit_test_framework)
include_directories (${Boost_INCLUDE_DIRS})

add_executable (Boost_Tests_run testtest.cpp)
target_link_libraries (Boost_Tests_run ${Boost_LIBRARIES})

Everything is compiling, but I have this error when I'm running the tests. I don't have any idea where I made a mistake.

"Test framework quit unexpectedly"
C:\Projekty\D4\build\test\Boost_Tests_run.exe --color_output=false --report_format=HRF --show_progress=no --log_format=HRF --log_level=all
Testing started at 15:35 ...
Process finished with exit code -1073741515 (0xC0000135)

I'm using:

  • CLion
  • boost 1.76
  • mingw 8.1
1

There are 1 answers

0
Klaudia4 On

Okay, so it works now. In CMakeCache I changed Boost Paths because there were old Paths from before.