Home > The Unit Test Framework > User's guide > Usage variants >

The UTF usage variants or the Buridan's donkey parable

The UTF presents you with 4 different variants how it can be used.
UTF 提供 4 種不同的使用方式。

Unlike the Buridan's donkey though, you shouldn't have problems deciding which one to use, since there are clear reasons why would you prefer each one.
不同於 Buridan's donkey,你不會煩惱於選擇哪一個,因為每個都有很清晰明瞭的原因。

In most cases to compile a test module based on the UTF all you need to include is just the single header boost/test/unit_test.hpp. This header includes internally most of the other headers that contains the UTF definitions. Some advanced features, like the floating point comparison or the logged expectations testing, are defined in independent headers and need to be included explicitly.
大多數情況下,要使用 UTF 編譯測試用例,只需要包含單個頭文件 boost/test/unit_test.hpp。 這個頭文件內部包含了含有 UTF 定義的大多數其它文件。 某些高級特性,像浮點數比較或測試預期日誌,定義在獨立的頭文件中,需要顯式地包含。