當ICC

2014-09-29 67 views
0

編譯任何人都可以解釋爲什麼這使用BOOST_AUTO_TEST_CASE當我ICC/ICPC編譯沒有得到註冊BOOST_AUTO_TEST_CASE不註冊測試用例?當我用g ++編譯時,它會註冊&運行。當ICC

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

BOOST_AUTO_TEST_CASE(helloworld) 
{ 
    BOOST_CHECK(true); 
} 

這裏是我如何與ICC編譯 - 請注意,當我運行的EXE說,「測試樹爲空」:

plxv1142: atevet/BoostTestUnitFailure (master)> icpc --version 
icpc (ICC) 14.0.4 20140805 
Copyright (C) 1985-2014 Intel Corporation. All rights reserved. 
plxv1142: atevet/BoostTestUnitFailure (master)> icpc -std=c++11 -Wall -fPIC -DBOOST_TEST_DYN_LINK -I/usr/pkgs/boost/1.53.0/include -O0 -o boostunittestcasefailure test.cpp -Wl,-rpath=/usr/pkgs/boost/1.53.0/lib64 /usr/pkgs/boost/1.53.0/lib64/libboost_unit_test_framework.so 
plxv1142: atevet/BoostTestUnitFailure (master)> ./boostunittestcasefailure 
Test setup error: test tree is empty 

而這裏的G ++ - 請注意,當使用g ++編譯,測試與框架註冊並運行:

plxv1142: atevet/BoostTestUnitFailure (master)> g++ --version 
g++ (GCC) 4.7.2 
Copyright (C) 2012 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions. There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
plxv1142: atevet/BoostTestUnitFailure (master)> g++ -std=c++11 -Wall -fPIC -DBOOST_TEST_DYN_LINK -I/usr/pkgs/boost/1.53.0/include -O0 -o boostunittestcasefailure test.cpp -Wl,-rpath=/usr/pkgs/boost/1.53.0/lib64 /usr/pkgs/boost/1.53.0/lib64/libboost_unit_test_framework.so 
plxv1142: atevet/BoostTestUnitFailure (master)> ./boostunittestcasefailure                         Running 1 test case... 

*** No errors detected 

回答

1

如果有人好奇,這是因爲我的環境所決定的,其中,G ++使用(企業環境,包裝不同版本的方式發生的工具)。當我刪除了企業環境補充時,問題就消失了。