Boost logo

Boost :

From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2019-11-25 19:13:00

(FYI, says: Don't
Overquote, Don't Top-Post,...)

On Mon, 25 Nov 2019 at 19:10, Krzysztof Jusiak via Boost-users
<boost-users_at_[hidden]> wrote:
> I also updated benchmarks with Boost.Test-1.71.0 (static library).
> I didn't add Boost.LightweightTest though as it's just assertions (no tests/suites/etc...) so it makes it difficult to compare due to missing features.
> *

Boost.LT does not offer formal vocabulary for cases and suites,
but saying it's "just assertions" is not quite accurate, I think.

According to some of TDD advocates, there shall be single assertion
per unit test [1]
(test case is an individual unit of testing, a unit test):

int sqr(int x) { return x * x; }
int main()
    BOOST_TEST( sqr(2) == 4 ); // test case 1
    BOOST_TEST_EQ( sqr(-3), 9 ); // test case 2
    return boost::report_errors();

For those who multiple assertions:

void test_sqr(int input, int expect)
    BOOST_TEST( sqr(input) == expect);
    BOOST_TEST( sqr(-input) == expect);
int main()
    test_sqrt(2, 4); // test case 1
    test_sqrt(-3, 9); // test case 1
    return boost::report_errors();

Finally, the single runnable test program is a test suite.

So, I will argue that Boost.LT does support test cases and test suites.


Best regards,

Mateusz Loskot,

Boost list run by bdawes at, gregod at, cpdaniel at, john at