mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-19 05:10:55 +00:00
Merge branch 'develop' into vault
This commit is contained in:
11
.github/workflows/macos.yml
vendored
11
.github/workflows/macos.yml
vendored
@@ -87,8 +87,9 @@ jobs:
|
||||
generator: ${{ matrix.generator }}
|
||||
configuration: ${{ matrix.configuration }}
|
||||
cmake-args: "-Dassert=TRUE -Dwerr=TRUE ${{ matrix.cmake-args }}"
|
||||
- name: test
|
||||
run: |
|
||||
n=$(nproc)
|
||||
echo "Using $n test jobs"
|
||||
${build_dir}/rippled --unittest --unittest-jobs $n
|
||||
# TODO: Temporary disabled tests
|
||||
# - name: test
|
||||
# run: |
|
||||
# n=$(nproc)
|
||||
# echo "Using $n test jobs"
|
||||
# ${build_dir}/rippled --unittest --unittest-jobs $n
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <test/jtx/AMM.h>
|
||||
#include <test/jtx/AMMTest.h>
|
||||
#include <test/jtx/Env.h>
|
||||
#include <test/jtx/CaptureLogs.h>
|
||||
#include <test/jtx/amount.h>
|
||||
#include <test/jtx/sendmax.h>
|
||||
|
||||
@@ -6092,6 +6093,8 @@ private:
|
||||
testcase("Fix changeSpotPriceQuality");
|
||||
using namespace jtx;
|
||||
|
||||
std::string logs;
|
||||
|
||||
enum class Status {
|
||||
SucceedShouldSucceedResize, // Succeed in pre-fix because
|
||||
// error allowance, succeed post-fix
|
||||
@@ -6174,7 +6177,7 @@ private:
|
||||
boost::smatch match;
|
||||
// tests that succeed should have the same amounts pre-fix and post-fix
|
||||
std::vector<std::pair<STAmount, STAmount>> successAmounts;
|
||||
Env env(*this, features);
|
||||
Env env(*this, features, std::make_unique<CaptureLogs>(&logs));
|
||||
auto rules = env.current()->rules();
|
||||
CurrentTransactionRulesGuard rg(rules);
|
||||
for (auto const& t : tests)
|
||||
@@ -6368,6 +6371,8 @@ private:
|
||||
using namespace std::chrono;
|
||||
FeatureBitset const all{features};
|
||||
|
||||
std::string logs;
|
||||
|
||||
Account const gatehub{"gatehub"};
|
||||
Account const bitstamp{"bitstamp"};
|
||||
Account const trader{"trader"};
|
||||
@@ -6596,7 +6601,7 @@ private:
|
||||
for (auto const& features :
|
||||
{all - fixAMMOverflowOffer, all | fixAMMOverflowOffer})
|
||||
{
|
||||
Env env(*this, features);
|
||||
Env env(*this, features, std::make_unique<CaptureLogs>(&logs));
|
||||
|
||||
env.fund(XRP(5'000), gatehub, bitstamp, trader);
|
||||
env.close();
|
||||
|
||||
@@ -828,7 +828,7 @@ struct DepositPreauth_test : public beast::unit_test::suite
|
||||
Account const john{"john"};
|
||||
|
||||
{
|
||||
testcase("Payment failed with disabled credentials rule.");
|
||||
testcase("Payment failure with disabled credentials rule.");
|
||||
|
||||
Env env(*this, supported_amendments() - featureCredentials);
|
||||
|
||||
@@ -930,7 +930,7 @@ struct DepositPreauth_test : public beast::unit_test::suite
|
||||
}
|
||||
|
||||
{
|
||||
testcase("Payment failed with invalid credentials.");
|
||||
testcase("Payment failure with invalid credentials.");
|
||||
|
||||
Env env(*this);
|
||||
|
||||
@@ -1206,7 +1206,7 @@ struct DepositPreauth_test : public beast::unit_test::suite
|
||||
Account const zelda{"zelda"};
|
||||
|
||||
{
|
||||
testcase("Payment failed with expired credentials.");
|
||||
testcase("Payment failure with expired credentials.");
|
||||
|
||||
Env env(*this);
|
||||
|
||||
@@ -1353,7 +1353,7 @@ struct DepositPreauth_test : public beast::unit_test::suite
|
||||
{
|
||||
using namespace std::chrono;
|
||||
|
||||
testcase("Escrow failed with expired credentials.");
|
||||
testcase("Escrow failure with expired credentials.");
|
||||
|
||||
Env env(*this);
|
||||
|
||||
|
||||
@@ -211,8 +211,10 @@ public:
|
||||
* @param args collection of features
|
||||
*
|
||||
*/
|
||||
Env(beast::unit_test::suite& suite_, FeatureBitset features)
|
||||
: Env(suite_, envconfig(), features)
|
||||
Env(beast::unit_test::suite& suite_,
|
||||
FeatureBitset features,
|
||||
std::unique_ptr<Logs> logs = nullptr)
|
||||
: Env(suite_, envconfig(), features, std::move(logs))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ public:
|
||||
void
|
||||
testValid()
|
||||
{
|
||||
testcase("Valid");
|
||||
using namespace jtx;
|
||||
Account const alice{"alice"};
|
||||
Account const becky{"becky"};
|
||||
@@ -162,6 +163,7 @@ public:
|
||||
void
|
||||
testErrors()
|
||||
{
|
||||
testcase("Errors");
|
||||
using namespace jtx;
|
||||
Account const alice{"alice"};
|
||||
Account const becky{"becky"};
|
||||
@@ -333,6 +335,8 @@ public:
|
||||
void
|
||||
testCredentials()
|
||||
{
|
||||
testcase("Credentials");
|
||||
|
||||
using namespace jtx;
|
||||
|
||||
const char credType[] = "abcde";
|
||||
@@ -363,7 +367,7 @@ public:
|
||||
|
||||
{
|
||||
testcase(
|
||||
"deposit_authorized with credentials failed: empty array.");
|
||||
"deposit_authorized with credentials failure: empty array.");
|
||||
|
||||
auto args = depositAuthArgs(alice, becky, "validated");
|
||||
args[jss::credentials] = Json::arrayValue;
|
||||
@@ -376,7 +380,7 @@ public:
|
||||
|
||||
{
|
||||
testcase(
|
||||
"deposit_authorized with credentials failed: not a string "
|
||||
"deposit_authorized with credentials failure: not a string "
|
||||
"credentials");
|
||||
|
||||
auto args = depositAuthArgs(alice, becky, "validated");
|
||||
@@ -392,7 +396,7 @@ public:
|
||||
|
||||
{
|
||||
testcase(
|
||||
"deposit_authorized with credentials failed: not a hex string "
|
||||
"deposit_authorized with credentials failure: not a hex string "
|
||||
"credentials");
|
||||
|
||||
auto args = depositAuthArgs(alice, becky, "validated");
|
||||
@@ -412,7 +416,7 @@ public:
|
||||
|
||||
{
|
||||
testcase(
|
||||
"deposit_authorized with credentials failed: not a credential "
|
||||
"deposit_authorized with credentials failure: not a credential "
|
||||
"index");
|
||||
|
||||
auto args = depositAuthArgs(
|
||||
|
||||
@@ -577,6 +577,16 @@ multi_runner_child::on_suite_begin(beast::unit_test::suite_info const& info)
|
||||
void
|
||||
multi_runner_child::on_suite_end()
|
||||
{
|
||||
if (print_log_ || suite_results_.failed > 0)
|
||||
{
|
||||
std::stringstream s;
|
||||
if (num_jobs_ > 1)
|
||||
s << job_index_ << "> ";
|
||||
s << (suite_results_.failed > 0 ? "failed: " : "")
|
||||
<< suite_results_.name << " had " << suite_results_.failed
|
||||
<< " failures." << std::endl;
|
||||
message_queue_send(MessageType::log, s.str());
|
||||
}
|
||||
results_.add(suite_results_);
|
||||
message_queue_send(MessageType::test_end, suite_results_.name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user