Skip to content

Strange output #662

@robert-andrzejuk

Description

@robert-andrzejuk

The below code generates strange output.
Multiple times the Failed tests are listed in an incremental manner.
I would expect each check to be listed once.

Code:

#define BOOST_UT_DISABLE_MODULE
#include "ut.hpp"

#define EXPECT_THAT(expr) expect(that % expr) << "\"" #expr "\"\n"

int main() {
    using namespace boost::ut;
    using namespace boost::ut::literals;

    "basic"_test = [] {
        int a1 = 1, a2 = 1, a3 = 1, a4 = 1, a5 = 1, a6 = 1;
        int b1 = 0, b2 = 0, b3 = 0, b4 = 0, b5 = 0, b6 = 0;

        EXPECT_THAT(a1 == b1);
        EXPECT_THAT(a2 == b2);
        EXPECT_THAT(a3 == b3);
        EXPECT_THAT(a4 == b4) << fatal;
        EXPECT_THAT(a5 == b5);
        EXPECT_THAT(a6 == b6);
    };
}

Output:

Running test "basic"... FAILED
in: C:\Github\beman\scope\tests\beman\scope\scope.test.cpp:17 - test condition:  [1 == 0]

 "a1 == b1"

Running test "basic"... FAILED
in: C:\Github\beman\scope\tests\beman\scope\scope.test.cpp:17 - test condition:  [1 == 0] "a1 == b1"
FAILED
in: C:\Github\beman\scope\tests\beman\scope\scope.test.cpp:18 - test condition:  [1 == 0]

 "a2 == b2"

Running test "basic"... FAILED
in: C:\Github\beman\scope\tests\beman\scope\scope.test.cpp:17 - test condition:  [1 == 0] "a1 == b1"
FAILED
in: C:\Github\beman\scope\tests\beman\scope\scope.test.cpp:18 - test condition:  [1 == 0] "a2 == b2"
FAILED
in: C:\Github\beman\scope\tests\beman\scope\scope.test.cpp:19 - test condition:  [1 == 0]

 "a3 == b3"

Running test "basic"... FAILED
in: C:\Github\beman\scope\tests\beman\scope\scope.test.cpp:17 - test condition:  [1 == 0] "a1 == b1"
FAILED
in: C:\Github\beman\scope\tests\beman\scope\scope.test.cpp:18 - test condition:  [1 == 0] "a2 == b2"
FAILED
in: C:\Github\beman\scope\tests\beman\scope\scope.test.cpp:19 - test condition:  [1 == 0] "a3 == b3"
FAILED
in: C:\Github\beman\scope\tests\beman\scope\scope.test.cpp:20 - test condition:  [1 == 0]

 "a4 == b4"

===============================================================================
Suite global
tests:   1 | 5 failed
asserts: 5 | 0 passed | 5 failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions