Skip to content

Commit 33b42e1

Browse files
Mike KleinSkia Commit-Bot
authored andcommitted
retry retry absl
Identical to https://skia-review.googlesource.com/c/skia/+/286070. Bug: skia:10165 Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-arm-Debug-Chromebook_GLES;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-CPU-AVX2-x86_64-Release-All-TSAN,Build-Debian10-Clang-arm64-Debug-Android_ASAN Change-Id: I0ec9d5f6875768e665f444e1ada211d3da537678 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322976 Commit-Queue: Mike Klein <[email protected]> Reviewed-by: John Stiles <[email protected]>
1 parent 72c7b98 commit 33b42e1

File tree

5 files changed

+75
-0
lines changed

5 files changed

+75
-0
lines changed

BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,6 +1881,7 @@ if (skia_enable_tools) {
18811881
"modules/skparagraph:tests",
18821882
"modules/sksg:tests",
18831883
"modules/skshaper",
1884+
"//third_party/absl",
18841885
"//third_party/libpng",
18851886
"//third_party/libwebp",
18861887
"//third_party/zlib",

DEPS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ vars = {
77
deps = {
88
"buildtools" : "https://chromium.googlesource.com/chromium/buildtools.git@505de88083136eefd056e5ee4ca0f01fe9b33de8",
99
"common" : "https://skia.googlesource.com/common.git@9737551d7a52c3db3262db5856e6bcd62c462b92",
10+
"third_party/externals/abseil-cpp" : "https://chromium.googlesource.com/external/github.com/abseil/abseil-cpp.git@1a02b7a2054c24f900dab796edb812f9260b51a6",
1011
"third_party/externals/angle2" : "https://chromium.googlesource.com/angle/angle.git@77e3d0ae97b620d8980049f0c8572a981bd2963d",
1112
"third_party/externals/d3d12allocator" : "https://skia.googlesource.com/external/github.com/GPUOpen-LibrariesAndSDKs/D3D12MemoryAllocator.git@169895d529dfce00390a20e69c2f516066fe7a3b",
1213
# Dawn requires jinja2 and markupsafe for the code generator, and glslang and shaderc for SPIRV compilation.

gn/tests.gni

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _tests = get_path_info("../tests", "abspath")
88

99
tests_sources = [
1010
"$_tests/AAClipTest.cpp",
11+
"$_tests/AbseilTest.cpp",
1112
"$_tests/AdvancedBlendTest.cpp",
1213
"$_tests/AndroidCodecTest.cpp",
1314
"$_tests/AnimatedImageTest.cpp",

tests/AbseilTest.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2020 Google Inc.
3+
*
4+
* Use of this source code is governed by a BSD-style license that can be
5+
* found in the LICENSE file.
6+
*/
7+
8+
#include "tests/Test.h"
9+
#ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK
10+
11+
#include <absl/container/btree_map.h>
12+
#include <absl/hash/hash.h>
13+
#include <absl/strings/substitute.h>
14+
15+
DEF_TEST(AbseilTest, reporter) {
16+
// Tests that Abseil can be compiled, linked and run. Can be removed once Abseil is in use
17+
// elsewhere.
18+
const void* nullVoid = nullptr;
19+
const std::string kStringToHash = absl::Substitute("$0 $1 $2 $3", "absl", 0, false, nullVoid);
20+
REPORTER_ASSERT(reporter, kStringToHash == "absl 0 false NULL");
21+
22+
const size_t hashValue = absl::Hash<std::string>{}(kStringToHash);
23+
REPORTER_ASSERT(reporter, hashValue != 0);
24+
25+
absl::btree_map<int, int> m;
26+
m[42] = 47;
27+
m[41] = 46;
28+
29+
int expected_key = 41,
30+
expected_val = 46;
31+
for (auto [k,v] : m) {
32+
REPORTER_ASSERT(reporter, k == expected_key++);
33+
REPORTER_ASSERT(reporter, v == expected_val++);
34+
}
35+
}
36+
37+
#endif // SK_BUILD_FOR_ANDROID_FRAMEWORK

third_party/absl/BUILD.gn

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright 2020 Google Inc.
2+
#
3+
# Use of this source code is governed by a BSD-style license that can be
4+
# found in the LICENSE file.
5+
6+
import("../third_party.gni")
7+
8+
third_party("absl") {
9+
public_include_dirs = [ "../externals/abseil-cpp" ]
10+
11+
# We have been bitten by blindly adding parts of Abseil in the past,
12+
# so please vet each new source file you add here carefully. If you're
13+
# not sure what you're looking for, please R += [email protected].
14+
#
15+
# In particular, please do not add absl::Mutex or dynamic_annotations.cc.
16+
sources = [
17+
"../externals/abseil-cpp/absl/base/internal/raw_logging.cc",
18+
"../externals/abseil-cpp/absl/base/internal/throw_delegate.cc",
19+
"../externals/abseil-cpp/absl/hash/internal/city.cc",
20+
"../externals/abseil-cpp/absl/hash/internal/hash.cc",
21+
"../externals/abseil-cpp/absl/numeric/int128.cc",
22+
"../externals/abseil-cpp/absl/strings/ascii.cc",
23+
"../externals/abseil-cpp/absl/strings/charconv.cc",
24+
"../externals/abseil-cpp/absl/strings/escaping.cc",
25+
"../externals/abseil-cpp/absl/strings/internal/charconv_bigint.cc",
26+
"../externals/abseil-cpp/absl/strings/internal/charconv_parse.cc",
27+
"../externals/abseil-cpp/absl/strings/internal/escaping.cc",
28+
"../externals/abseil-cpp/absl/strings/internal/memutil.cc",
29+
"../externals/abseil-cpp/absl/strings/internal/utf8.cc",
30+
"../externals/abseil-cpp/absl/strings/match.cc",
31+
"../externals/abseil-cpp/absl/strings/numbers.cc",
32+
"../externals/abseil-cpp/absl/strings/str_cat.cc",
33+
"../externals/abseil-cpp/absl/strings/substitute.cc",
34+
]
35+
}

0 commit comments

Comments
 (0)