aboutsummaryrefslogtreecommitdiff
path: root/absl/base/internal/low_level_alloc_test.cc
diff options
context:
space:
mode:
authorBenjamin Barenblat <bbaren@google.com>2021-04-08 10:23:55 -0400
committerBenjamin Barenblat <bbaren@google.com>2021-04-08 10:23:55 -0400
commitfeac56827dd1f0d159ea0bcf2ce37ef1990ac743 (patch)
treebc8ca767be02a5b22118108f9712b72ec64064c3 /absl/base/internal/low_level_alloc_test.cc
parent2b91b17d526b464840a3f45504c594cdb50152c5 (diff)
parent997aaf3a28308eba1b9156aa35ab7bca9688e9f6 (diff)
downloadabseil-feac56827dd1f0d159ea0bcf2ce37ef1990ac743.tar.gz
abseil-feac56827dd1f0d159ea0bcf2ce37ef1990ac743.tar.bz2
abseil-feac56827dd1f0d159ea0bcf2ce37ef1990ac743.zip
Merge new upstream LTS 20210324.0
Diffstat (limited to 'absl/base/internal/low_level_alloc_test.cc')
-rw-r--r--absl/base/internal/low_level_alloc_test.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/absl/base/internal/low_level_alloc_test.cc b/absl/base/internal/low_level_alloc_test.cc
index 2f2eaffa..31abb888 100644
--- a/absl/base/internal/low_level_alloc_test.cc
+++ b/absl/base/internal/low_level_alloc_test.cc
@@ -21,6 +21,10 @@
#include <unordered_map>
#include <utility>
+#ifdef __EMSCRIPTEN__
+#include <emscripten.h>
+#endif
+
#include "absl/container/node_hash_map.h"
namespace absl {
@@ -158,5 +162,20 @@ ABSL_NAMESPACE_END
int main(int argc, char *argv[]) {
// The actual test runs in the global constructor of `before_main`.
printf("PASS\n");
+#ifdef __EMSCRIPTEN__
+ // clang-format off
+// This is JS here. Don't try to format it.
+ MAIN_THREAD_EM_ASM({
+ if (ENVIRONMENT_IS_WEB) {
+ if (typeof TEST_FINISH === 'function') {
+ TEST_FINISH($0);
+ } else {
+ console.error('Attempted to exit with status ' + $0);
+ console.error('But TEST_FINSIHED is not a function.');
+ }
+ }
+ }, 0);
+// clang-format on
+#endif
return 0;
}