mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Enable manual tests in CI:
Fixes: RIPD-1575. Fix argument passing to runner. Allow multiple unit test selectors to be passed via --unittest argument. Add optional integer priority value to test suite list. Fix several failing manual tests. Update CLI usage message to make it clearer.
This commit is contained in:
@@ -28,10 +28,10 @@ template<class Suite>
|
||||
struct insert_suite
|
||||
{
|
||||
insert_suite(char const* name, char const* module,
|
||||
char const* library, bool manual)
|
||||
char const* library, bool manual, int priority)
|
||||
{
|
||||
global_suites().insert<Suite>(
|
||||
name, module, library, manual);
|
||||
name, module, library, manual, priority);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -627,10 +627,10 @@ run(runner& r)
|
||||
|
||||
// detail:
|
||||
// This inserts the suite with the given manual flag
|
||||
#define BEAST_DEFINE_TESTSUITE_INSERT(Class,Module,Library,manual) \
|
||||
#define BEAST_DEFINE_TESTSUITE_INSERT(Class,Module,Library,manual,priority) \
|
||||
static beast::unit_test::detail::insert_suite <Class##_test> \
|
||||
Library ## Module ## Class ## _test_instance( \
|
||||
#Class, #Module, #Library, manual)
|
||||
#Class, #Module, #Library, manual, priority)
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -675,14 +675,19 @@ run(runner& r)
|
||||
#if BEAST_NO_UNIT_TEST_INLINE
|
||||
#define BEAST_DEFINE_TESTSUITE(Class,Module,Library)
|
||||
#define BEAST_DEFINE_TESTSUITE_MANUAL(Class,Module,Library)
|
||||
#define BEAST_DEFINE_TESTSUITE_PRIO(Class,Module,Library,Priority)
|
||||
#define BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(Class,Module,Library,Priority)
|
||||
|
||||
#else
|
||||
#include <beast/unit_test/global_suites.hpp>
|
||||
#define BEAST_DEFINE_TESTSUITE(Class,Module,Library) \
|
||||
BEAST_DEFINE_TESTSUITE_INSERT(Class,Module,Library,false)
|
||||
BEAST_DEFINE_TESTSUITE_INSERT(Class,Module,Library,false,0)
|
||||
#define BEAST_DEFINE_TESTSUITE_MANUAL(Class,Module,Library) \
|
||||
BEAST_DEFINE_TESTSUITE_INSERT(Class,Module,Library,true)
|
||||
|
||||
BEAST_DEFINE_TESTSUITE_INSERT(Class,Module,Library,true,0)
|
||||
#define BEAST_DEFINE_TESTSUITE_PRIO(Class,Module,Library,Priority) \
|
||||
BEAST_DEFINE_TESTSUITE_INSERT(Class,Module,Library,false,Priority)
|
||||
#define BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(Class,Module,Library,Priority) \
|
||||
BEAST_DEFINE_TESTSUITE_INSERT(Class,Module,Library,true,Priority)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -27,6 +27,7 @@ class suite_info
|
||||
std::string module_;
|
||||
std::string library_;
|
||||
bool manual_;
|
||||
int priority_;
|
||||
run_type run_;
|
||||
|
||||
public:
|
||||
@@ -35,11 +36,13 @@ public:
|
||||
std::string module,
|
||||
std::string library,
|
||||
bool manual,
|
||||
int priority,
|
||||
run_type run)
|
||||
: name_(std::move(name))
|
||||
, module_(std::move(module))
|
||||
, library_(std::move(library))
|
||||
, manual_(manual)
|
||||
, priority_(priority)
|
||||
, run_(std::move(run))
|
||||
{
|
||||
}
|
||||
@@ -87,9 +90,10 @@ public:
|
||||
bool
|
||||
operator<(suite_info const& lhs, suite_info const& rhs)
|
||||
{
|
||||
return
|
||||
std::tie(lhs.library_, lhs.module_, lhs.name_) <
|
||||
std::tie(rhs.library_, rhs.module_, rhs.name_);
|
||||
// we want higher priority suites sorted first, thus the negation
|
||||
// of priority value here
|
||||
return std::forward_as_tuple(-lhs.priority_, lhs.library_, lhs.module_, lhs.name_) <
|
||||
std::forward_as_tuple(-rhs.priority_, rhs.library_, rhs.module_, rhs.name_);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -102,13 +106,15 @@ make_suite_info(
|
||||
std::string name,
|
||||
std::string module,
|
||||
std::string library,
|
||||
bool manual)
|
||||
bool manual,
|
||||
int priority)
|
||||
{
|
||||
return suite_info(
|
||||
std::move(name),
|
||||
std::move(module),
|
||||
std::move(library),
|
||||
manual,
|
||||
priority,
|
||||
[](runner& r)
|
||||
{
|
||||
Suite{}(r);
|
||||
|
||||
@@ -39,7 +39,8 @@ public:
|
||||
char const* name,
|
||||
char const* module,
|
||||
char const* library,
|
||||
bool manual);
|
||||
bool manual,
|
||||
int priority);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -50,7 +51,8 @@ suite_list::insert(
|
||||
char const* name,
|
||||
char const* module,
|
||||
char const* library,
|
||||
bool manual)
|
||||
bool manual,
|
||||
int priority)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
{
|
||||
@@ -67,7 +69,7 @@ suite_list::insert(
|
||||
}
|
||||
#endif
|
||||
cont().emplace(make_suite_info<Suite>(
|
||||
name, module, library, manual));
|
||||
name, module, library, manual, priority));
|
||||
}
|
||||
|
||||
} // unit_test
|
||||
|
||||
Reference in New Issue
Block a user