mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
deps: update googletest to 35b75a2
PR-URL: https://github.com/nodejs/node/pull/58710 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This commit is contained in:
parent
db8ca623d4
commit
cdadb20ae1
2 changed files with 45 additions and 0 deletions
29
deps/googletest/include/gtest/gtest-matchers.h
vendored
29
deps/googletest/include/gtest/gtest-matchers.h
vendored
|
@ -773,6 +773,35 @@ class GeMatcher
|
||||||
static const char* NegatedDesc() { return "isn't >="; }
|
static const char* NegatedDesc() { return "isn't >="; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Same as `EqMatcher<Rhs>`, except that the `rhs` is stored as `StoredRhs` and
|
||||||
|
// must be implicitly convertible to `Rhs`.
|
||||||
|
template <typename Rhs, typename StoredRhs>
|
||||||
|
class ImplicitCastEqMatcher {
|
||||||
|
public:
|
||||||
|
explicit ImplicitCastEqMatcher(const StoredRhs& rhs) : stored_rhs_(rhs) {}
|
||||||
|
|
||||||
|
using is_gtest_matcher = void;
|
||||||
|
|
||||||
|
template <typename Lhs>
|
||||||
|
bool MatchAndExplain(const Lhs& lhs, std::ostream*) const {
|
||||||
|
return lhs == rhs();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DescribeTo(std::ostream* os) const {
|
||||||
|
*os << "is equal to ";
|
||||||
|
UniversalPrint(rhs(), os);
|
||||||
|
}
|
||||||
|
void DescribeNegationTo(std::ostream* os) const {
|
||||||
|
*os << "isn't equal to ";
|
||||||
|
UniversalPrint(rhs(), os);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
Rhs rhs() const { return ImplicitCast_<Rhs>(stored_rhs_); }
|
||||||
|
|
||||||
|
StoredRhs stored_rhs_;
|
||||||
|
};
|
||||||
|
|
||||||
template <typename T, typename = typename std::enable_if<
|
template <typename T, typename = typename std::enable_if<
|
||||||
std::is_constructible<std::string, T>::value>::type>
|
std::is_constructible<std::string, T>::value>::type>
|
||||||
using StringLike = T;
|
using StringLike = T;
|
||||||
|
|
16
deps/googletest/src/gtest.cc
vendored
16
deps/googletest/src/gtest.cc
vendored
|
@ -269,6 +269,13 @@ GTEST_DEFINE_bool_(
|
||||||
"True if and only if the test should fail if no test case (including "
|
"True if and only if the test should fail if no test case (including "
|
||||||
"disabled test cases) is linked.");
|
"disabled test cases) is linked.");
|
||||||
|
|
||||||
|
GTEST_DEFINE_bool_(
|
||||||
|
fail_if_no_test_selected,
|
||||||
|
testing::internal::BoolFromGTestEnv("fail_if_no_test_selected", false),
|
||||||
|
"True if and only if the test should fail if no test case is selected to "
|
||||||
|
"run. A test case is selected to run if it is not disabled and is matched "
|
||||||
|
"by the filter flag so that it starts executing.");
|
||||||
|
|
||||||
GTEST_DEFINE_bool_(
|
GTEST_DEFINE_bool_(
|
||||||
also_run_disabled_tests,
|
also_run_disabled_tests,
|
||||||
testing::internal::BoolFromGTestEnv("also_run_disabled_tests", false),
|
testing::internal::BoolFromGTestEnv("also_run_disabled_tests", false),
|
||||||
|
@ -6079,6 +6086,14 @@ bool UnitTestImpl::RunAllTests() {
|
||||||
TearDownEnvironment);
|
TearDownEnvironment);
|
||||||
repeater->OnEnvironmentsTearDownEnd(*parent_);
|
repeater->OnEnvironmentsTearDownEnd(*parent_);
|
||||||
}
|
}
|
||||||
|
} else if (GTEST_FLAG_GET(fail_if_no_test_selected)) {
|
||||||
|
// If there were no tests to run, bail if we were requested to be strict.
|
||||||
|
constexpr char kNoTestsSelectedMessage[] =
|
||||||
|
"No tests were selected to run. Please make sure at least one test "
|
||||||
|
"exists and is not disabled! If the test is sharded, you may have "
|
||||||
|
"defined more shards than test cases, which is wasteful.";
|
||||||
|
ColoredPrintf(GTestColor::kRed, "%s\n", kNoTestsSelectedMessage);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
elapsed_time_ = timer.Elapsed();
|
elapsed_time_ = timer.Elapsed();
|
||||||
|
@ -6763,6 +6778,7 @@ static bool ParseGoogleTestFlag(const char* const arg) {
|
||||||
GTEST_INTERNAL_PARSE_FLAG(death_test_use_fork);
|
GTEST_INTERNAL_PARSE_FLAG(death_test_use_fork);
|
||||||
GTEST_INTERNAL_PARSE_FLAG(fail_fast);
|
GTEST_INTERNAL_PARSE_FLAG(fail_fast);
|
||||||
GTEST_INTERNAL_PARSE_FLAG(fail_if_no_test_linked);
|
GTEST_INTERNAL_PARSE_FLAG(fail_if_no_test_linked);
|
||||||
|
GTEST_INTERNAL_PARSE_FLAG(fail_if_no_test_selected);
|
||||||
GTEST_INTERNAL_PARSE_FLAG(filter);
|
GTEST_INTERNAL_PARSE_FLAG(filter);
|
||||||
GTEST_INTERNAL_PARSE_FLAG(internal_run_death_test);
|
GTEST_INTERNAL_PARSE_FLAG(internal_run_death_test);
|
||||||
GTEST_INTERNAL_PARSE_FLAG(list_tests);
|
GTEST_INTERNAL_PARSE_FLAG(list_tests);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue