Home > Introduction > FAQ >
PrevNext

Frequently Asked Questions

Where the latest version of the Boost Test Library is located?
I found a bug. Where can I report it?
I have a request for a new feature. Where can I ask for it?
How to create test case using the Unit Test Framework?
How to create test suite using the Unit Test Framework?
Why did I get a linker error when compiling my test program?
How can I redirect testing output?
I want different default log trace level
Is there DLL version of Boost.Test components available on Win32 platform?

Where the latest version of the Boost Test Library is located?

The latest version of Boost Test Library is available online at http://www.boost.org/libs/test

I found a bug. Where can I report it?

You can send a bug report to the boost users' mailing list and/or directly to Gennadiy Rozental.

I have a request for a new feature. Where can I ask for it?

You can send a request to the boost developers' mailing list and/or directly to Gennadiy Rozental.

How to create test case using the Unit Test Framework?

To create a test case use the macro BOOST_AUTO_TEST_CASE( test_function ). For more details see the Unit Test Framework documentation.

How to create test suite using the Unit Test Framework?

To create a test suite use the macro BOOST_AUTO_TEST_SUITE( suite_name ). For more details see the Unit Test Framework documentation.

Why did I get a linker error when compiling my test program?

Boost Test Library components provide several usage variants: to create a test program you can link with the one of the precompiled library variants or use single-header variant. For example, to use Unit Test Framework you may either include the <boost/test/unit_test.hpp> and link with libunit_test_framework.lib or you can include <boost/test/included/unit_test.hpp> , in which case you should not need to link with any precompiled component. Note also that you should strictly follow specification on initialization function in other case some compilers may produce linker error like this.
Boost Test 庫的組件提供多種使用方式:要創建測試程序你可以鏈接預編譯的庫或使用單個頭文件。 例如,要使用單元測試框架 (Unit Test Framework),你可以包含 <boost/test/unit_test.hpp> 並鏈接 libunit_test_framework.lib 或包含 <boost/test/included/unit_test.hpp> 而不用鏈接任何預編譯的組件。 同樣要注意的是,你必須嚴格初始化函數的定義,否則某些編譯器會產生如下的鏈接錯誤。

Unresolved external init_unit_test_suite(int, char**).

The reason for this error is that in your implementation you should specify second argument of init_unit_test_suite exactly as in the specification, i.e.: char* [].
錯誤的原因是在實現中你需要將 init_unit_test_suite 的第二個參數嚴格定義,例如:char* []。

How can I redirect testing output?

Use unit_test_log::instance().set_log_output( std::ostream& ). For more details see the Unit Test Framework documentation.

I want different default log trace level

Use environment variable BOOST_TEST_LOG_LEVEL to define desired log trace level. You still will be able to reset this value from the command line. For the list of acceptable values see the Unit Test Framework documentation.

Is there DLL version of Boost.Test components available on Win32 platform?

Yes. Starting with Boost 1.34.0.


PrevUpHomeNext