0

以下のように、非常に単純な Boost 単体テストがあります。

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

BOOST_AUTO_TEST_CASE(universeInOrder)
{
    BOOST_CHECK(true);
}

これは問題なく問題なくコンパイルされます。ただし、アプリケーションを実行すると、コンソール ビューに何も出力されず、コンソール ビューにはアプリケーションが終了したことが示されます。を介してプログラム引数としてログレベルを設定しようとしました--log_level=allが、効果がありませんでした。ただし、コマンド ラインから実行可能ファイルを実行すると、期待どおりの出力が表示されます。また、プログラムをデバッグすることもできません。これは非常に重大な問題です。Eclipse 3.7、MinGW 4.6、および Boost 1.52 を使用しています。何かご意見は?

編集 ここに私のコンパイラ引数があります:

g++ -IC:\Boost\boost_1_52_0 -O0 -g3 -Wall -c -fmessage-length=0 -o src\Test1.o ..\src\Test1.cpp

g++ -LC:\Boost\boost_1_52_0\stage\lib -o MinGWUnitTestProject.exe src\Test1.o -llibboost_unit_test_framework-mgw46-d-1_52

4

1 に答える 1

1

The problem was that when executing the test in Eclipse, the Boost unit test library was not on the execution path. I fixed this by modifying my 'Run Configuration' to add the directory of the Boost unit test library to the 'Path' environment variable. It now runs and gives me output as well as allowing me to debug.

于 2013-03-21T15:06:02.030 に答える