Files
react-native/ReactCommon/react/test_utils/BUCK
T
Phillip Pan ec92c85a15 introduce MockSurfaceHandler
Summary:
Changelog:
[ios][added] - introduce MockSurfaceHandler

following the recommendation in https://fb.workplace.com/groups/474291069286180/posts/6540719469309946

in order to unit test classes that use SurfaceHandler, we need to be able to mock it somehow - since the class is final we aren't able to do that. in this diff, we add the mock class.

Reviewed By: sammy-SC

Differential Revision: D30578927

fbshipit-source-id: 9b39b03ad0b55cecd9b482f9cce9630d7e7d5bda
2021-08-26 22:40:43 -07:00

58 lines
1.4 KiB
Python

load(
"//tools/build_defs/oss:rn_defs.bzl",
"ANDROID",
"APPLE",
"CXX",
"get_apple_compiler_flags",
"get_apple_inspector_flags",
"get_preprocessor_flags_for_build_mode",
"react_native_xplat_target",
"rn_xplat_cxx_library",
"subdir_glob",
)
APPLE_COMPILER_FLAGS = get_apple_compiler_flags()
rn_xplat_cxx_library(
name = "test_utils",
srcs = [],
headers = glob(
["**/*.h"],
exclude = glob(["tests/**/*.h"]),
),
header_namespace = "",
exported_headers = subdir_glob(
[
("", "*.h"),
],
prefix = "react/test_utils",
),
compiler_flags = [
"-fexceptions",
"-frtti",
"-std=c++17",
"-Wall",
],
fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
fbobjc_frameworks = ["Foundation"],
fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
force_static = True,
labels = ["supermodule:xplat/default/public.react_native.infra"],
macosx_tests_override = [],
platforms = (ANDROID, APPLE, CXX),
preprocessor_flags = [
"-DLOG_TAG=\"ReactNative\"",
"-DWITH_FBSYSTRACE=1",
],
tests = [],
visibility = ["PUBLIC"],
deps = [
"//xplat/jsi:jsi",
react_native_xplat_target("better:better"),
react_native_xplat_target("react/debug:debug"),
],
exported_deps = [
"//xplat/third-party/gmock:gmock",
],
)