Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

1
deps/v8/testing/OWNERS vendored Normal file
View File

@ -0,0 +1 @@
file:../INFRA_OWNERS

116
deps/v8/testing/gmock-support.h vendored Normal file
View File

@ -0,0 +1,116 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_TESTING_GMOCK_SUPPORT_H_
#define V8_TESTING_GMOCK_SUPPORT_H_
#include <cmath>
#include <cstring>
#include <string>
#include "include/v8-isolate.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace testing {
template <typename T>
class Capture {
public:
Capture() : value_(), has_value_(false) {}
const T& value() const { return value_; }
bool has_value() const { return has_value_; }
void SetValue(const T& value) {
DCHECK(!has_value());
value_ = value;
has_value_ = true;
}
private:
T value_;
bool has_value_;
};
namespace internal {
template <typename T>
class CaptureEqMatcher : public MatcherInterface<T> {
public:
explicit CaptureEqMatcher(Capture<T>* capture) : capture_(capture) {}
virtual void DescribeTo(std::ostream* os) const {
*os << "captured by " << static_cast<const void*>(capture_);
if (capture_->has_value()) *os << " which has value " << capture_->value();
}
virtual bool MatchAndExplain(T value, MatchResultListener* listener) const {
if (!capture_->has_value()) {
capture_->SetValue(value);
return true;
}
if (value != capture_->value()) {
*listener << "which is not equal to " << capture_->value();
return false;
}
return true;
}
private:
Capture<T>* capture_;
};
} // namespace internal
// Creates a polymorphic matcher that matches anything whose bit representation
// is equal to that of {x}.
MATCHER_P(BitEq, x, std::string(negation ? "isn't" : "is") +
" bitwise equal to " + PrintToString(x)) {
static_assert(sizeof(x) == sizeof(arg), "Size mismatch");
return std::memcmp(&arg, &x, sizeof(x)) == 0;
}
// Creates a polymorphic matcher that matches JSValue to Int32.
MATCHER_P(IsInt32, expected,
std::string(negation ? "isn't" : "is") + " Int32 " +
PrintToString(expected)) {
return arg->IsInt32() &&
arg->Int32Value(v8::Isolate::GetCurrent()->GetCurrentContext())
.FromJust() == expected;
}
// Creates a polymorphic matcher that matches JSValue to String.
MATCHER_P(IsString, expected,
std::string(negation ? "isn't" : "is") + " String " +
PrintToString(expected)) {
if (!arg->IsString()) {
return false;
}
v8::String::Utf8Value utf8(v8::Isolate::GetCurrent(), arg);
return strcmp(expected, *utf8) == 0;
}
// Creates a polymorphic matcher that matches JSValue to Undefined.
MATCHER(IsUndefined, std::string(negation ? "isn't" : "is") + " Undefined") {
return arg->IsUndefined();
}
// CaptureEq(capture) captures the value passed in during matching as long as it
// is unset, and once set, compares the value for equality with the argument.
template <typename T>
inline Matcher<T> CaptureEq(Capture<T>* capture) {
return MakeMatcher(new internal::CaptureEqMatcher<T>(capture));
}
// Creates a polymorphic matcher that matches any floating point NaN value.
MATCHER(IsNaN, std::string(negation ? "isn't" : "is") + " not a number") {
return std::isnan(arg);
}
} // namespace testing
#endif // V8_TESTING_GMOCK_SUPPORT_H_

27
deps/v8/testing/gmock/BUILD.gn vendored Normal file
View File

@ -0,0 +1,27 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# The file/directory layout of Google Test is not yet considered stable. Until
# it stabilizes, Chromium code MUST use this target instead of reaching directly
# into //third_party/googletest.
import("//build_overrides/build.gni")
source_set("gmock") {
testonly = true
sources = [
"include/gmock/gmock-actions.h",
"include/gmock/gmock-matchers.h",
"include/gmock/gmock.h",
]
public_deps = [ "//third_party/googletest:gmock" ]
}
# The file/directory layout of Google Test is not yet considered stable. Until
# it stabilizes, Chromium code MUST use this target instead of reaching directly
# into //third_party/googletest.
source_set("gmock_main") {
testonly = true
deps = [ "//third_party/googletest:gmock_main" ]
}

2
deps/v8/testing/gmock/OWNERS vendored Normal file
View File

@ -0,0 +1,2 @@
thakis@chromium.org
pwnall@chromium.org

3
deps/v8/testing/gmock/include/DEPS vendored Normal file
View File

@ -0,0 +1,3 @@
include_rules = [
'+third_party/googletest/src/googlemock/include/gmock',
]

View File

@ -0,0 +1,10 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The file/directory layout of Google Test is not yet considered stable. Until
// it stabilizes, Chromium code will use forwarding headers in testing/gtest
// and testing/gmock, instead of directly including files in
// third_party/googletest.
#include "third_party/googletest/src/googlemock/include/gmock/gmock-actions.h"

View File

@ -0,0 +1,10 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The file/directory layout of Google Test is not yet considered stable. Until
// it stabilizes, Chromium code will use forwarding headers in testing/gtest
// and testing/gmock, instead of directly including files in
// third_party/googletest.
#include "third_party/googletest/src/googlemock/include/gmock/gmock-matchers.h"

View File

@ -0,0 +1,10 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The file/directory layout of Google Test is not yet considered stable. Until
// it stabilizes, Chromium code will use forwarding headers in testing/gtest
// and testing/gmock, instead of directly including files in
// third_party/googletest.
#include "third_party/googletest/src/googlemock/include/gmock/gmock.h"

57
deps/v8/testing/gtest-support.h vendored Normal file
View File

@ -0,0 +1,57 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_TESTING_GTEST_SUPPORT_H_
#define V8_TESTING_GTEST_SUPPORT_H_
#include "testing/gtest/include/gtest/gtest.h"
namespace testing {
namespace internal {
#define GET_TYPE_NAME(type) \
template <> \
inline std::string GetTypeName<type>() { \
return #type; \
}
GET_TYPE_NAME(bool)
GET_TYPE_NAME(signed char)
GET_TYPE_NAME(unsigned char)
GET_TYPE_NAME(short)
GET_TYPE_NAME(unsigned short)
GET_TYPE_NAME(int)
GET_TYPE_NAME(unsigned int)
GET_TYPE_NAME(long)
GET_TYPE_NAME(unsigned long)
GET_TYPE_NAME(long long)
GET_TYPE_NAME(unsigned long long)
GET_TYPE_NAME(float)
GET_TYPE_NAME(double)
#undef GET_TYPE_NAME
// TRACED_FOREACH(type, var, container) expands to a loop that assigns |var|
// every item in the |container| and adds a SCOPED_TRACE() message for the
// |var| while inside the loop body.
#define TRACED_FOREACH(_type, _var, _container) \
for (_type const _var : _container) \
for (bool _var##_done = false; !_var##_done;) \
for (SCOPED_TRACE(::testing::Message() << #_var << " = " << _var); \
!_var##_done; _var##_done = true)
// TRACED_FORRANGE(type, var, low, high) expands to a loop that assigns |var|
// every value in the range |low| to (including) |high| and adds a
// SCOPED_TRACE() message for the |var| while inside the loop body.
// TODO(bmeurer): Migrate to C++11 once we're ready.
#define TRACED_FORRANGE(_type, _var, _low, _high) \
for (_type _var##_i = _low; _var##_i <= _high; ++_var##_i) \
for (bool _var##_done = false; !_var##_done;) \
for (_type const _var = _var##_i; !_var##_done;) \
for (SCOPED_TRACE(::testing::Message() << #_var << " = " << _var); \
!_var##_done; _var##_done = true)
} // namespace internal
} // namespace testing
#endif // V8_TESTING_GTEST_SUPPORT_H_

90
deps/v8/testing/gtest/BUILD.gn vendored Normal file
View File

@ -0,0 +1,90 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build_overrides/gtest.gni")
if (is_ios) {
import("//build/buildflag_header.gni")
import("//build/config/coverage/coverage.gni")
import("//build/config/ios/ios_sdk.gni")
}
config("gtest_direct_config") {
visibility = [ ":*" ]
defines = [ "UNIT_TEST" ]
}
# The file/directory layout of Google Test is not yet considered stable. Until
# it stabilizes, Chromium code MUST use this target instead of reaching directly
# into //third_party/googletest.
static_library("gtest") {
testonly = true
sources = [
"include/gtest/gtest-death-test.h",
"include/gtest/gtest-message.h",
"include/gtest/gtest-param-test.h",
"include/gtest/gtest-spi.h",
"include/gtest/gtest.h",
"include/gtest/gtest_prod.h",
# This is a workaround for the issues below.
#
# 1) This target needs to be a static_library (not a source set) on Mac to
# avoid the build errors in
# https://codereview.chromium.org/2779193002#msg82.
# 2) A static_library must have at least one source file, to avoid build
# errors on Mac and Windows. https://crbug.com/710334
# 3) A static_library with complete_static_lib = true, which would not
# require adding the empty file, will result in duplicate symbols on
# Android. https://codereview.chromium.org/2852613002/#ps20001
"empty.cc",
]
public_deps = [ "//third_party/googletest:gtest" ]
public_configs = [ ":gtest_direct_config" ]
if (gtest_include_multiprocess) {
sources += [
"../multiprocess_func_list.cc",
"../multiprocess_func_list.h",
]
}
if (gtest_include_platform_test) {
sources += [ "../platform_test.h" ]
}
if ((is_mac || is_ios) && gtest_include_objc_support) {
sources += [
"../gtest_mac.h",
"../gtest_mac.mm",
]
if (gtest_include_platform_test) {
sources += [ "../platform_test_mac.mm" ]
}
}
if (is_ios && gtest_include_ios_coverage) {
sources += [
"../coverage_util_ios.h",
"../coverage_util_ios.mm",
]
deps = [ ":ios_enable_coverage" ]
}
}
# The file/directory layout of Google Test is not yet considered stable. Until
# it stabilizes, Chromium code MUST use this target instead of reaching directly
# into //third_party/googletest.
source_set("gtest_main") {
testonly = true
deps = [ "//third_party/googletest:gtest_main" ]
}
if (is_ios) {
buildflag_header("ios_enable_coverage") {
header = "ios_enable_coverage.h"
flags = [ "IOS_ENABLE_COVERAGE=$use_clang_coverage" ]
}
}

2
deps/v8/testing/gtest/OWNERS vendored Normal file
View File

@ -0,0 +1,2 @@
thakis@chromium.org
pwnall@chromium.org

3
deps/v8/testing/gtest/empty.cc vendored Normal file
View File

@ -0,0 +1,3 @@
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

3
deps/v8/testing/gtest/include/DEPS vendored Normal file
View File

@ -0,0 +1,3 @@
include_rules = [
'+third_party/googletest/src/googletest/include/gtest',
]

View File

@ -0,0 +1,10 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The file/directory layout of Google Test is not yet considered stable. Until
// it stabilizes, Chromium code will use forwarding headers in testing/gtest
// and testing/gmock, instead of directly including files in
// third_party/googletest.
#include "third_party/googletest/src/googletest/include/gtest/gtest-death-test.h"

View File

@ -0,0 +1,10 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The file/directory layout of Google Test is not yet considered stable. Until
// it stabilizes, Chromium code will use forwarding headers in testing/gtest
// and testing/gmock, instead of directly including files in
// third_party/googletest.
#include "third_party/googletest/src/googletest/include/gtest/gtest-message.h"

View File

@ -0,0 +1,10 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The file/directory layout of Google Test is not yet considered stable. Until
// it stabilizes, Chromium code will use forwarding headers in testing/gtest
// and testing/gmock, instead of directly including files in
// third_party/googletest.
#include "third_party/googletest/src/googletest/include/gtest/gtest-param-test.h"

View File

@ -0,0 +1,10 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The file/directory layout of Google Test is not yet considered stable. Until
// it stabilizes, Chromium code will use forwarding headers in testing/gtest
// and testing/gmock, instead of directly including files in
// third_party/googletest.
#include "third_party/googletest/src/googletest/include/gtest/gtest-spi.h"

View File

@ -0,0 +1,10 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The file/directory layout of Google Test is not yet considered stable. Until
// it stabilizes, Chromium code will use forwarding headers in testing/gtest
// and testing/gmock, instead of directly including files in
// third_party/googletest.
#include "third_party/googletest/src/googletest/include/gtest/gtest.h"

View File

@ -0,0 +1,12 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The file/directory layout of Google Test is not yet considered stable. Until
// it stabilizes, Chromium code will use forwarding headers in testing/gtest
// and testing/gmock, instead of directly including files in
// third_party/googletest.
#if !defined(GOOGLE3)
#include "third_party/googletest/src/googletest/include/gtest/gtest_prod.h"
#endif