Skip to content

Conversation

@ILer32
Copy link
Contributor

@ILer32 ILer32 commented Jan 13, 2026

Problem:

There are some examples to check the change
Example 1

#include <boost/ut.hpp>

int main(int argc, const char* argv[]) {
    using namespace boost::ut;

    boost::ut::detail::cfg::show_successful_tests = true;
    "test 1"_test = [] {
        expect(1 == 1_i);
        expect(2 != 2_i); //false
        };
    "test 1"_test = [] {
        expect(3 == 3_i);
        };
}

Example 2

#include <boost/ut.hpp>
using namespace boost::ut;
suite<"basic suite1"> tests1 = [] {
    "test 1"_test = [] {
        expect(true);
        expect(false); //false
        };
    "test 2"_test = [] {
        expect(true);
        expect(false); //false
        expect(true);
        skip / "test 2.1"_test = [] {
            expect(42_i == 43) << "should not fire!";
            };
        };
    skip / "test 3"_test = [] {
        expect(42_i == 43) << "should not fire!";
        };
    };
suite<"basic suite2"> tests2 = [] {
    "test a"_test = [] {
        expect(true);
        };
    skip / "test b"_test = [] {
        expect(42_i == 43) << "should not fire!";
        };
    };
suite<"basic suite3"> tests3 = [] {
    "test A"_test = [] {
        expect(true);
        };
    "test B"_test = [] {
        expect(true);
        };
    skip / "test C"_test = [] {
        expect(42_i == 43) << "should not fire!";
        };
    };
int main(int argc, const char* argv[]) {
    boost::ut::detail::cfg::show_successful_tests = true;
    boost::ut::detail::cfg::show_duration = true;
}

Solution:

  • improve struct test_result and the process to get summary

Addtional modifications:

  • remove test_result.passed to improve the efficiency
  • introduce enum class StatusType to reduce string copy
  • remove test_result.class_name and test_result.suite_name
  • add get_duration() and improve the format
  • correct the status judgement
  • mark the color of skipped messages

Issue: #703

Reviewers:
@kris-jusiak

@kris-jusiak kris-jusiak merged commit 20bc09c into boost-ext:master Jan 13, 2026
10 checks passed
@kris-jusiak
Copy link
Contributor

This ia great, thank you @ILer32 !Let me know when you think is a good timing based on changes (done and planned) to make a nee relase with improvements

@ILer32 ILer32 deleted the add-otto branch January 14, 2026 01:41
@ILer32
Copy link
Contributor Author

ILer32 commented Jan 14, 2026

My pleasure.

@kris-jusiak, I think that more efforts should be delivered to achieve a stable version as a new baseline.
For example,

  1. Some data structures can be refactored (e.g. Composite and Visitor patterns can be introduced and tailored)
  2. Many issues need to be addressed (current with 90 open issues)
  3. The documents can be improved (tutorial, contributing)
  4. Test cases and the test flow can be updated
  5. Log messages need to be improved

The timing depends on the milestone in your mind.
As the milestone is achieved, it is the time to make a new release.

I may not be able to engage all the parts. However, I can improve some parts during addressing issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants