Skip to content

Commit

Permalink
Update googletest v1.14.0 And Absl to Aug 2023 Patch 1
Browse files Browse the repository at this point in the history
Also work around some gtest bug where AbslStringify isn't always picked up with test names.

PiperOrigin-RevId: 569501840
  • Loading branch information
allight authored and copybara-github committed Sep 29, 2023
1 parent e668288 commit a280bc1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
15 changes: 8 additions & 7 deletions dependency_support/load_external.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,20 @@ def load_external_repositories():
strip_prefix = "rules_cc-0.0.5",
)

# V 1.14.0 (released 2023-08-02)
http_archive(
name = "com_google_googletest",
urls = ["https://github.com/google/googletest/archive/0e6aac2571eb1753b8855d8d1f592df64d1a4828.zip"], # 2022-11-14
strip_prefix = "googletest-0e6aac2571eb1753b8855d8d1f592df64d1a4828",
sha256 = "77bfecb8d930cbd97e24e7570a3dee9b09bad483aab47c96b7b7efb7d54332ff",
urls = ["https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip"],
strip_prefix = "googletest-1.14.0",
sha256 = "1f357c27ca988c3f7c6b4bf68a9395005ac6761f034046e9dde0896e3aba00e4",
)

# LTS 20230125.3 (released 04 May 2023)
# LTS 20230802.1 (released 2023-09-18)
http_archive(
name = "com_google_absl",
urls = ["https://github.com/abseil/abseil-cpp/archive/refs/tags/20230125.3.zip"],
strip_prefix = "abseil-cpp-20230125.3",
sha256 = "51d676b6846440210da48899e4df618a357e6e44ecde7106f1e44ea16ae8adc7",
urls = ["https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.1.zip"],
strip_prefix = "abseil-cpp-20230802.1",
sha256 = "497ebdc3a4885d9209b9bd416e8c3f71e7a1fb8af249f6c2a80b7cbeefcd7e21",
)

# Protobuf depends on Skylib
Expand Down
1 change: 1 addition & 0 deletions xls/passes/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1964,6 +1964,7 @@ cc_test(
":predicate_state",
":range_query_engine",
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/types:span",
"//xls/common:xls_gunit",
"//xls/common:xls_gunit_main",
Expand Down
21 changes: 18 additions & 3 deletions xls/passes/context_sensitive_range_query_engine_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
#include "xls/passes/context_sensitive_range_query_engine.h"

#include <cstdint>
#include <functional>
#include <memory>
#include <ostream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "absl/algorithm/container.h"
#include "absl/strings/str_format.h"
#include "absl/types/span.h"
#include "xls/common/logging/logging.h"
#include "xls/common/status/matchers.h"
Expand Down Expand Up @@ -73,6 +73,10 @@ void AbslStringify(Sink& sink, const Signedness& src) {
break;
}
}
// Workaround some gtest bug where it won't see AbslStringify
std::ostream& operator<<(std::ostream& os, const Signedness& s) {
return os << absl::StrFormat("%v", s);
}
class BaseSignedContextSensitiveRangeQueryEngineTest {
public:
virtual ~BaseSignedContextSensitiveRangeQueryEngineTest() = default;
Expand Down Expand Up @@ -185,7 +189,18 @@ struct SignedRangeComparison {

template <typename Sink>
void AbslStringify(Sink& sink, const SignedRangeComparison::Tuple& src) {
absl::Format(sink, "%v", SignedRangeComparison(src));
absl::Format(&sink, "%v", SignedRangeComparison(src));
}

// Workaround some gtest bug where it won't see AbslStringify
std::ostream& operator<<(std::ostream& os,
const SignedRangeComparison& s) {
return os << absl::StrFormat("%v", s);
}
// Workaround some gtest bug where it won't see AbslStringify
std::ostream& operator<<(std::ostream& os,
const SignedRangeComparison::Tuple& s) {
return os << absl::StrFormat("%v", s);
}

class SignedRangeComparisonContextSensitiveRangeQueryEngineTest
Expand Down

0 comments on commit a280bc1

Please sign in to comment.