-1

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
Klaudia4
  • 1
  • 1
  • Welcome to Stack Overflow! Here we expect the **code** and the **error message** to be in the question post itself as **text**, not linked as *image*. Please, read [ask] and edit your question accordingly. Also make sure, that you have **(re)search** the error you got. E.g. response of the google: https://www.google.com/search?q=exited+with+code+0xc0000135+site%3Astackoverflow.com. – Tsyvarev Jul 10 '21 at 14:59
  • I checked before in google, but nothing works. I'm not even sure where is the problem. – Klaudia4 Jul 10 '21 at 15:33
  • The problem is most likely that your Boost libraries (`.dll`) cannot be found by runtime loader. E.g. there is similar question but about QT: https://stackoverflow.com/questions/38031603/setting-up-qt-for-clion. It tells how to setup CLion to find your libraries. – Tsyvarev Jul 10 '21 at 15:40
  • I still don't quite understand to what I should add the path. I have built Boost, but I don't know which directory has the necessary libraries. – Klaudia4 Jul 10 '21 at 18:31
  • So you need to find the directory with your Boost installation and under this directory you need to find the subdirectory with the libraries (`.dll`). E.g. you may check the linker's command line which is executed by CLion: this command line contains required paths. Alternatively, in CLion you could open CMake cache, and among "BOOST" variables you could find the needed information. It is your machine, and you is the only one who is able to find where you have installed Boost. – Tsyvarev Jul 10 '21 at 18:53

1 Answers1

0

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

Klaudia4
  • 1
  • 1