Home > The Unit Test Framework > User's guide > Usage variants > External test runner
PrevNext

The external test runner variant of the UTF

All other usage variants employ the build-in test runners. If you plan to use an external test runner with your test module you need to build it as a dynamic library. This usage of the UTF is called the external test runner variant of the UTF. The variant requires you to define the flag BOOST_TEST_DYN_LINK either in a makefile or before the header boost/test/unit_test.hpp inclusion. An external test runner utility is required to link with dynamic library.
所有其它的用法都需要內建的測試運行器。如果想要在測試模塊中使用外部測試運行器,你需要將其生成為動態庫。 UTF 的這種用法被稱為外部測試運行器用法。 這種用法需要在 makefile 或包含頭文件 boost/test/unit_test.hpp 之前定義標籤 BOOST_TEST_DYN_LINK。 外部測試運行器工具需要鏈接到動態庫。

If an external test runner is based on the test runner built in to the dynamic library (like the standalone boost_test_runner utility supplied by the UTF), it requires you to implement the test module initialization function that matches the alternative initialization function signature. The UTF provides an ability to automatically generate an empty test module initialization function with correct signature if no custom initialization is required by a test module.
如果外部測試運行器是基於動態庫中內建的測試運行器 (例如 UTF 中提供的獨立的 boost_test_runner 工具), 需要自己實現符合備選初始化函數簽名的測試模塊的初始化函數。 如果測試模塊不需要自定義的初始化,UTF 提供自動生成符合正確簽名的空測試模塊初始化函數的功能。

[Note] Note

An advanced test runner doesn't have to be based on the build-in one and may require a different test module initialization function signature and/or name.
高級的測試運行器並不需要基於內建的,並且可能需要不同的測試模塊初始化函數簽名和 / 或名稱。


PrevUpHomeNext