diff --git a/example/vendor/cget/pkg/foonathan__debug_assert/install/lib/cmake/debug_assert/debug_assert-targets.cmake b/example/vendor/cget/pkg/foonathan__debug_assert/install/lib/cmake/debug_assert/debug_assert-targets.cmake index a9f3031..3a76fb4 100644 --- a/example/vendor/cget/pkg/foonathan__debug_assert/install/lib/cmake/debug_assert/debug_assert-targets.cmake +++ b/example/vendor/cget/pkg/foonathan__debug_assert/install/lib/cmake/debug_assert/debug_assert-targets.cmake @@ -7,7 +7,7 @@ if(CMAKE_VERSION VERSION_LESS "3.1.0") message(FATAL_ERROR "CMake >= 3.1.0 required") endif() cmake_policy(PUSH) -cmake_policy(VERSION 3.1.0...3.27) +cmake_policy(VERSION 3.1.0...3.28) #---------------------------------------------------------------- # Generated CMake target import file. #---------------------------------------------------------------- diff --git a/tests/vendor/cget/pkg/boost-ext__ut/install/include/boost/ut.hpp b/tests/vendor/cget/pkg/boost-ext__ut/install/include/boost/ut.hpp index 05a1790..4810d9c 100644 --- a/tests/vendor/cget/pkg/boost-ext__ut/install/include/boost/ut.hpp +++ b/tests/vendor/cget/pkg/boost-ext__ut/install/include/boost/ut.hpp @@ -20,10 +20,10 @@ export import std; #include #if defined(_MSC_VER) - #pragma push_macro("min") - #pragma push_macro("max") - #undef min - #undef max +#pragma push_macro("min") +#pragma push_macro("max") +#undef min +#undef max #endif // Before libc++ 17 had experimental support for format and it required a // special build flag. Currently libc++ has not implemented all C++20 chrono @@ -57,7 +57,7 @@ export import std; #elif not defined(__cpp_static_assert) #error "[Boost::ext].UT requires support for static assert"; #else -#define BOOST_UT_VERSION 2'0'1 +#define BOOST_UT_VERSION 2'1'0 #if defined(__has_builtin) and defined(__GNUC__) and (__GNUC__ < 10) and \ not defined(__clang__) @@ -77,6 +77,7 @@ export import std; #include #include #include +#include #include #include #include @@ -89,7 +90,6 @@ export import std; #include #include #include -#include #if __has_include() and __has_include() #include #include @@ -105,11 +105,11 @@ export import std; #include #endif -struct _unique_name_for_auto_detect_prefix_and_suffix_lenght_0123456789_struct { +struct unique_name_for_auto_detect_prefix_and_suffix_lenght_0123456789_struct_ { }; BOOST_UT_EXPORT -namespace boost::inline ext::ut::inline v2_0_1 { +namespace boost::inline ext::ut::inline v2_1_0 { namespace utility { template class function; @@ -183,8 +183,8 @@ class function { } template -[[nodiscard]] constexpr auto match(const TPattern& pattern, const TStr& str) - -> std::vector { +[[nodiscard]] constexpr auto match(const TPattern& pattern, + const TStr& str) -> std::vector { std::vector groups{}; auto pi = 0u; auto si = 0u; @@ -237,22 +237,22 @@ template } return output; } -constexpr auto regex_match(const char *str, const char *pattern) -> bool { +constexpr auto regex_match(const char* str, const char* pattern) -> bool { if (*pattern == '\0' && *str == '\0') return true; if (*pattern == '\0' && *str != '\0') return false; if (*str == '\0' && *pattern != '\0') return false; if (*pattern == '.') { - return regex_match(str+1, pattern+1); + return regex_match(str + 1, pattern + 1); } if (*pattern == *str) { - return regex_match(str+1, pattern+1); + return regex_match(str + 1, pattern + 1); } return false; } } // namespace utility namespace reflection { -#if defined(__cpp_lib_source_location) +#if defined(__cpp_lib_source_location) && !defined(_LIBCPP_APPLE_CLANG_VER) using source_location = std::source_location; #else class source_location { @@ -298,15 +298,15 @@ template inline constexpr const std::string_view raw_type_name = get_template_function_name_use_decay_type< - _unique_name_for_auto_detect_prefix_and_suffix_lenght_0123456789_struct>(); + unique_name_for_auto_detect_prefix_and_suffix_lenght_0123456789_struct_>(); inline constexpr const std::size_t raw_length = raw_type_name.length(); inline constexpr const std::string_view need_name = #if defined(_MSC_VER) and not defined(__clang__) "struct " - "_unique_name_for_auto_detect_prefix_and_suffix_lenght_0123456789_struct"; + "unique_name_for_auto_detect_prefix_and_suffix_lenght_0123456789_struct_"; #else - "_unique_name_for_auto_detect_prefix_and_suffix_lenght_0123456789_struct"; + "unique_name_for_auto_detect_prefix_and_suffix_lenght_0123456789_struct_"; #endif inline constexpr const std::size_t need_length = need_name.length(); static_assert(need_length <= raw_length, @@ -353,8 +353,9 @@ template } template -[[nodiscard]] constexpr auto abs_diff(const T t, const U u) - -> decltype(t < u ? u - t : t - u) { +[[nodiscard]] constexpr auto abs_diff(const T t, + const U u) -> decltype(t < u ? u - t + : t - u) { return t < u ? u - t : t - u; } @@ -463,8 +464,8 @@ struct function_traits { template T&& declval(); template -constexpr auto is_valid(TExpr expr) - -> decltype(expr(declval()), bool()) { +constexpr auto is_valid(TExpr expr) -> decltype(expr(declval()), + bool()) { return true; } template @@ -579,6 +580,10 @@ fixed_string(const CharT (&str)[N]) -> fixed_string; struct none {}; namespace events { +struct run_begin { + int argc{}; + const char** argv{}; +}; struct test_begin { std::string_view type{}; std::string_view name{}; @@ -597,7 +602,7 @@ struct suite_end { template struct test { std::string_view type{}; - std::string_view name{}; + std::string name{}; /// might be dynamic std::vector tag{}; reflection::source_location location{}; TArg arg{}; @@ -610,8 +615,8 @@ struct test { static constexpr auto run_impl(Test test, const none&) { test(); } template - static constexpr auto run_impl(T test, const TArg& arg) - -> decltype(test(arg), void()) { + static constexpr auto run_impl(T test, const TArg& arg) -> decltype(test(arg), + void()) { test(arg); } @@ -802,11 +807,17 @@ struct cfg { std::cout << "version: " << BOOST_UT_VERSION << std::endl; } - static inline void parse(int argc, const char* argv[]) { - const std::size_t n_args = static_cast(argc); - if (n_args > 0 && argv != nullptr) { + static inline void parse_arg_with_fallback(int argc, const char* argv[]) { + if (argc > 0 && argv != nullptr) { cfg::largc = argc; cfg::largv = argv; + } + parse(cfg::largc, cfg::largv); + } + + static inline void parse(int argc, const char* argv[]) { + const std::size_t n_args = argc > 0 ? static_cast(argc) : 0U; + if (n_args > 0 && argv != nullptr) { executable_name = argv[0]; } query_pattern = ""; @@ -816,15 +827,15 @@ struct cfg { auto cmd_option = find_arg(cmd); if (!cmd_option.has_value()) { if (found_first_option) { - std::cerr << "unknown option: '" << argv[i] << "' run:" << std::endl; - std::cerr << "'" << argv[0] << " --help'" << std::endl; + std::cerr << "unknown option: '" << cmd << "' run:" << std::endl; + std::cerr << "'" << executable_name << " --help'" << std::endl; std::cerr << "for additional help" << std::endl; std::exit(-1); } else { if (i > 1U) { query_pattern.append(" "); } - query_pattern.append(argv[i]); + query_pattern.append(cmd); } continue; } @@ -1325,6 +1336,17 @@ struct aborts_ : op { namespace type_traits { template inline constexpr auto is_op_v = __is_base_of(detail::op, T); + +template +struct is_stream_insertable : std::false_type {}; + +template +struct is_stream_insertable< + T, std::void_t() + << detail::get(std::declval()))>> + : std::true_type {}; +template +inline constexpr bool is_stream_insertable_v = is_stream_insertable::value; } // namespace type_traits struct colors { @@ -1478,6 +1500,8 @@ class reporter { printer_ = static_cast(printer); } + auto on(events::run_begin) -> void {} + auto on(events::test_begin test_begin) -> void { printer_ << "Running \"" << test_begin.name << "\"..."; fails_ = asserts_.fail; @@ -1546,9 +1570,8 @@ class reporter { << printer_.colors().fail << tests_.fail << " failed" << printer_.colors().none << '\n' << "asserts: " << (asserts_.pass + asserts_.fail) << " | " - << asserts_.pass << " passed" - << " | " << printer_.colors().fail << asserts_.fail << " failed" - << printer_.colors().none << '\n'; + << asserts_.pass << " passed" << " | " << printer_.colors().fail + << asserts_.fail << " failed" << printer_.colors().none << '\n'; std::cerr << printer_.str() << std::endl; } else { std::cout << printer_.colors().pass << "All tests passed" @@ -1681,8 +1704,11 @@ class reporter_junit { constexpr auto operator=(TPrinter printer) { printer_ = static_cast(printer); } - reporter_junit() : lcout_(std::cout.rdbuf()) { - ::boost::ut::detail::cfg::parse(detail::cfg::largc, detail::cfg::largv); + reporter_junit() : lcout_(std::cout.rdbuf()) {} + ~reporter_junit() { std::cout.rdbuf(cout_save); } + + auto on(events::run_begin run) { + ::boost::ut::detail::cfg::parse_arg_with_fallback(run.argc, run.argv); if (detail::cfg::show_reporters) { std::cout << "available reporter:\n"; @@ -1702,7 +1728,6 @@ class reporter_junit { std::cout.rdbuf(ss_out_.rdbuf()); } } - ~reporter_junit() { std::cout.rdbuf(cout_save); } auto on(events::suite_begin suite) -> void { while (active_test_.size() > 0) { @@ -1848,16 +1873,18 @@ class reporter_junit { std::cout.flush(); std::cout.rdbuf(cout_save); std::ofstream maybe_of; - if (detail::cfg::output_filename != "") { maybe_of = std::ofstream(detail::cfg::output_filename); } + if (detail::cfg::output_filename != "") { + maybe_of = std::ofstream(detail::cfg::output_filename); + } if (report_type_ == JUNIT) { - print_junit_summary(detail::cfg::output_filename != "" ? maybe_of : std::cout); + print_junit_summary(detail::cfg::output_filename != "" ? maybe_of + : std::cout); return; } print_console_summary( - detail::cfg::output_filename != "" ? maybe_of : std::cout, - detail::cfg::output_filename != "" ? maybe_of : std::cerr - ); + detail::cfg::output_filename != "" ? maybe_of : std::cout, + detail::cfg::output_filename != "" ? maybe_of : std::cerr); } protected: @@ -1873,25 +1900,25 @@ class reporter_junit { } } - void print_console_summary(std::ostream &out_stream, std::ostream &err_stream) { + void print_console_summary(std::ostream& out_stream, + std::ostream& err_stream) { for (const auto& [suite_name, suite_result] : results_) { if (suite_result.fails) { err_stream << "\n========================================================" "=======================\n" - << "Suite " << suite_name // + << "Suite " << suite_name << '\n' // << "tests: " << (suite_result.n_tests) << " | " << color_.fail << suite_result.fails << " failed" << color_.none << '\n' << "asserts: " << (suite_result.assertions) << " | " - << suite_result.passed << " passed" - << " | " << color_.fail << suite_result.fails << " failed" - << color_.none << '\n'; + << suite_result.passed << " passed" << " | " << color_.fail + << suite_result.fails << " failed" << color_.none << '\n'; std::cerr << std::endl; } else { out_stream << color_.pass << "Suite '" << suite_name - << "': all tests passed" << color_.none << " (" - << suite_result.assertions << " asserts in " - << suite_result.n_tests << " tests)\n"; + << "': all tests passed" << color_.none << " (" + << suite_result.assertions << " asserts in " + << suite_result.n_tests << " tests)\n"; if (suite_result.skipped) { std::cout << suite_result.skipped << " tests skipped\n"; @@ -1902,9 +1929,9 @@ class reporter_junit { } } - void print_junit_summary(std::ostream &stream) { + void print_junit_summary(std::ostream& stream) { // aggregate results - size_t n_tests=0, n_fails=0; + size_t n_tests = 0, n_fails = 0; double total_time = 0.0; auto suite_time = [](auto const& suite_result) { std::int64_t time_ms = @@ -1922,11 +1949,11 @@ class reporter_junit { // mock junit output: stream << "\n"; stream << "\n"; + stream << " name=\"all\""; + stream << " tests=\"" << n_tests << '\"'; + stream << " failures=\"" << n_fails << '\"'; + stream << " time=\"" << total_time << '\"'; + stream << ">\n"; for (const auto& [suite_name, suite_result] : results_) { stream << ""; } - void print_result(std::ostream &stream, const std::string& suite_name, std::string indent, - const test_result& parent) { + void print_result(std::ostream& stream, const std::string& suite_name, + std::string indent, const test_result& parent) { for (const auto& [name, result] : *parent.nested_tests) { stream << indent; stream << "( result.run_stop - result.run_start) .count(); - stream << " time=\"" << (static_cast(time_ms) / 1000.0) - << "\""; + stream << " time=\"" << (static_cast(time_ms) / 1000.0) << "\""; stream << " status=\"" << result.status << '\"'; if (result.report_string.empty() && result.nested_tests->empty()) { stream << " />\n"; @@ -1987,6 +2013,8 @@ struct options { struct run_cfg { bool report_errors{false}; + int argc{0}; + const char** argv{nullptr}; }; template , auto MaxPathSize = 16> @@ -1999,8 +2027,8 @@ class runner { : path_{utility::split(_filter, delim)} {} template - constexpr auto operator()(const std::size_t level, const TPath& path) const - -> bool { + constexpr auto operator()(const std::size_t level, + const TPath& path) const -> bool { for (auto i = 0u; i < math::min_value(level + 1, std::size(path_)); ++i) { if (not utility::is_match(path[i], path_[i])) { return false; @@ -2129,7 +2157,7 @@ class runner { } #endif - if (not --level_) { + if (not--level_) { reporter_.on(events::test_end{.type = test.type, .name = test.name}); } else { // N.B. prev. only root-level tests were signalled on finish if constexpr (requires { @@ -2190,6 +2218,7 @@ class runner { [[nodiscard]] auto run(run_cfg rc = {}) -> bool { run_ = true; + reporter_.on(events::run_begin{.argc = rc.argc, .argv = rc.argv}); for (const auto& [suite, suite_name] : suites_) { // add reporter in/out if constexpr (requires { reporter_.on(events::suite_begin{}); }) { @@ -2265,7 +2294,7 @@ struct test { template constexpr auto operator=(test_location _test) { on(events::test{.type = type, - .name = name, + .name = std::string{name}, .tag = tag, .location = _test.location, .arg = none{}, @@ -2279,7 +2308,7 @@ struct test { constexpr auto operator=(Test _test) -> typename type_traits::identity::type { on(events::test{.type = type, - .name = name, + .name = std::string{name}, .tag = tag, .location = {}, .arg = none{}, @@ -2714,26 +2743,24 @@ template (events::test{ - .type = "test", - .name = name, - .tag = {}, - .location = {}, - .arg = arg, - .run = f}); + detail::on(events::test{.type = "test", + .name = std::string{name}, + .tag = {}, + .location = {}, + .arg = arg, + .run = f}); } }; } -template < - class F, template class T, class... Ts, - type_traits::requires_t>> = 0> +template class T, class... Ts, + type_traits::requires_t>> = 0> [[nodiscard]] constexpr auto operator|(const F& f, const T& t) { return [f, t](const auto name) { apply( [f, name](const auto&... args) { (detail::on(events::test{.type = "test", - .name = name, + .name = std::string{name}, .tag = {}, .location = {}, .arg = args, @@ -3050,32 +3077,53 @@ struct suite { template [[maybe_unused]] constexpr auto type = detail::type_(); -template +template and + type_traits::is_stream_insertable_v>> [[nodiscard]] constexpr auto eq(const TLhs& lhs, const TRhs& rhs) { return detail::eq_{lhs, rhs}; } -template +template and + type_traits::is_stream_insertable_v>> [[nodiscard]] constexpr auto approx(const TLhs& lhs, const TRhs& rhs, const TEpsilon& epsilon) { return detail::approx_{lhs, rhs, epsilon}; } -template +template and + type_traits::is_stream_insertable_v>> [[nodiscard]] constexpr auto neq(const TLhs& lhs, const TRhs& rhs) { return detail::neq_{lhs, rhs}; } -template +template and + type_traits::is_stream_insertable_v>> [[nodiscard]] constexpr auto gt(const TLhs& lhs, const TRhs& rhs) { return detail::gt_{lhs, rhs}; } -template +template and + type_traits::is_stream_insertable_v>> [[nodiscard]] constexpr auto ge(const TLhs& lhs, const TRhs& rhs) { return detail::ge_{lhs, rhs}; } -template +template and + type_traits::is_stream_insertable_v>> [[nodiscard]] constexpr auto lt(const TLhs& lhs, const TRhs& rhs) { return detail::lt_{lhs, rhs}; } -template +template and + type_traits::is_stream_insertable_v>> [[nodiscard]] constexpr auto le(const TLhs& lhs, const TRhs& rhs) { return detail::le_{lhs, rhs}; } @@ -3276,12 +3324,12 @@ using operators::operator not; using operators::operator|; using operators::operator/; using operators::operator>>; -} // namespace boost::inline ext::ut::inline v2_0_1 +} // namespace boost::inline ext::ut::inline v2_1_0 #if (defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)) && \ !defined(__EMSCRIPTEN__) -__attribute__((constructor)) inline void cmd_line_args(int argc, - const char* argv[]) { +__attribute__((constructor(101))) inline void cmd_line_args( + int argc, const char* argv[]) { ::boost::ut::detail::cfg::largc = argc; ::boost::ut::detail::cfg::largv = argv; } @@ -3290,8 +3338,8 @@ __attribute__((constructor)) inline void cmd_line_args(int argc, #endif #if defined(_MSC_VER) - #pragma pop_macro("min") - #pragma pop_macro("max") +#pragma pop_macro("min") +#pragma pop_macro("max") #endif #endif diff --git a/tests/vendor/cget/pkg/foonathan__debug_assert/install/lib/cmake/debug_assert/debug_assert-targets.cmake b/tests/vendor/cget/pkg/foonathan__debug_assert/install/lib/cmake/debug_assert/debug_assert-targets.cmake index a9f3031..3a76fb4 100644 --- a/tests/vendor/cget/pkg/foonathan__debug_assert/install/lib/cmake/debug_assert/debug_assert-targets.cmake +++ b/tests/vendor/cget/pkg/foonathan__debug_assert/install/lib/cmake/debug_assert/debug_assert-targets.cmake @@ -7,7 +7,7 @@ if(CMAKE_VERSION VERSION_LESS "3.1.0") message(FATAL_ERROR "CMake >= 3.1.0 required") endif() cmake_policy(PUSH) -cmake_policy(VERSION 3.1.0...3.27) +cmake_policy(VERSION 3.1.0...3.28) #---------------------------------------------------------------- # Generated CMake target import file. #----------------------------------------------------------------