2014-04-01 13 views
0

부스트 유닛 테스트 스위트를 사용하려고합니다.부스트 테스트 프로젝트를 실행하는 중 오류가 발생했습니다. testcaseName : 해당 파일이나 디렉토리가 없습니다.

#define BOOST_TEST_DYN_LINK 
#define BOOST_TEST_MODULE main_test_module 

#include <boost/test/unit_test.hpp> 
#include <boost/test/unit_test_suite.hpp> 

.... // introducing some functions and variables here 

BOOST_AUTO_TEST_CASE(fileComparatorTestCase) 
{ 
Logger() << "Testing file comparator"; 

bool res; 
res = compare(file1Path, file1Path); 
BOOST_REQUIRE_EQUAL(res, true); 
res = compare(file2Path, file2Path); 
BOOST_REQUIRE_EQUAL(res, true); 
res = compare(file1Path, file3Path); 
BOOST_REQUIRE_EQUAL(res, false); 
res = compare(file1Path, file2Path); 
BOOST_REQUIRE_EQUAL(res, false); 

Logger() << "Ended testing file comparator"; 
} 

나는 또한 boost_unit_test_framework 라이브러리를 연결하고 있습니다. 이 코드는 잘 컴파일,하지만 난의 TestRunner를 실행하려고하고있을 때, 그것은 다음과 같은 오류와 함께 실패를 해결하는 방법에

Running 1 test case... 
unknown location(0): fatal error in "fileComparatorTestCase": std::exception: No such file or directory 

어떤 아이디어?

답변

1
명백하게

어느

  • Logger() 기입하기위한 출력 위치를 열 수 없다; 또는
  • 테스트중인 기능 compare은 전달한 파일/경로가 있는지 확인합니다.

범인을 찾을 때까지 댓글을 달아보십시오. Boost에서 예외가 발생하면 대개보다 광범위한 예외 정보를 사용할 수 있습니다. 그렇지 않으면 소스 코드 또는 strace과 같은 트릭을 통해 어떤 일이 일어나는지 알 수 있습니다.

+0

예, 저는 제 자신의 예외 시스템에 속았습니다. – Roman