]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/beast/subtree/unit_test/include/boost/beast/unit_test/main.cpp
2 // Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // Official repository: https://github.com/boostorg/beast
10 #include <boost/beast/unit_test/amount.hpp>
11 #include <boost/beast/unit_test/dstream.hpp>
12 #include <boost/beast/unit_test/global_suites.hpp>
13 #include <boost/beast/unit_test/match.hpp>
14 #include <boost/beast/unit_test/reporter.hpp>
15 #include <boost/beast/unit_test/suite.hpp>
16 #include <boost/config.hpp>
22 # ifndef WIN32_LEAN_AND_MEAN // VC_EXTRALEAN
23 # define WIN32_LEAN_AND_MEAN
25 # undef WIN32_LEAN_AND_MEAN
31 // Simple main used to produce stand
32 // alone executables that run unit tests.
33 int main(int ac
, char const* av
[])
36 using namespace boost::beast::unit_test
;
38 dstream
log(std::cerr
);
43 int flags
= _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG
);
44 flags
|= _CRTDBG_LEAK_CHECK_DF
;
45 _CrtSetDbgFlag(flags
);
51 std::string
const s
{av
[1]};
52 if(s
== "-h" || s
== "--help")
56 " " << av
[0] << ": { <suite-name>... }" <<
66 std::vector
<selector
> v
;
68 for(int i
= 1; i
< ac
; ++i
)
69 v
.emplace_back(selector::automatch
, av
[i
]);
71 [&v
](suite_info
const& si
) mutable
78 failed
= r
.run_each_if(global_suites(), pred
);
82 failed
= r
.run_each(global_suites());