iOS: added placeholder test setup for fabric graphics/uimanager/view targets

Reviewed By: shergin

Differential Revision: D7390366

fbshipit-source-id: d49fcc335fc03d52402676341f1da24177c6084b
This commit is contained in:
Kevin Gozali 2018-03-23 22:09:11 -07:00 committed by Facebook Github Bot
parent 408a5f264b
commit 1acef45977
7 changed files with 153 additions and 29 deletions

View File

@ -10,14 +10,12 @@ if not IS_OSS_BUILD:
rn_xplat_cxx_library(
name = "debug",
srcs = glob(
[
"*.cpp",
],
["**/*.cpp"],
excludes = glob(["tests/**/*.cpp"]),
),
headers = glob(
[
"*.h",
],
["**/*.h"],
excludes = glob(["tests/**/*.h"]),
),
header_namespace = "",
exported_headers = subdir_glob(
@ -54,6 +52,7 @@ if not IS_OSS_BUILD:
cxx_test(
name = "tests",
srcs = glob(["tests/**/*.cpp"]),
headers = glob(["tests/**/*.h"]),
contacts = ["oncall+react_native@xmail.facebook.com"],
compiler_flags = [
"-fexceptions",

View File

@ -10,14 +10,12 @@ if not IS_OSS_BUILD:
rn_xplat_cxx_library(
name = "graphics",
srcs = glob(
[
"**/*.cpp",
],
["**/*.cpp"],
excludes = glob(["tests/**/*.cpp"]),
),
headers = glob(
[
"**/*.h",
],
["**/*.h"],
excludes = glob(["tests/**/*.h"]),
),
header_namespace = "",
exported_headers = subdir_glob(
@ -39,6 +37,9 @@ rn_xplat_cxx_library(
"-DLOG_TAG=\"ReactNative\"",
"-DWITH_FBSYSTRACE=1",
],
tests = [
":tests",
],
visibility = ["PUBLIC"],
deps = [
"xplat//fbsystrace:fbsystrace",
@ -48,3 +49,25 @@ rn_xplat_cxx_library(
"xplat//third-party/glog:glog",
],
)
if not IS_OSS_BUILD:
load("@xplat//configurations/buck:default_platform_defs.bzl", "APPLE")
cxx_test(
name = "tests",
srcs = glob(["tests/**/*.cpp"]),
headers = glob(["tests/**/*.h"]),
contacts = ["oncall+react_native@xmail.facebook.com"],
compiler_flags = [
"-fexceptions",
"-frtti",
"-std=c++14",
"-Wall",
],
platforms = APPLE,
deps = [
"xplat//folly:molly",
"xplat//third-party/gmock:gtest",
":graphics",
],
)

View File

@ -0,0 +1,17 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <memory>
#include <fabric/graphics/graphicValuesConversions.h>
#include <gtest/gtest.h>
using namespace facebook::react;
TEST(GraphicsTest, testSomething) {
// TODO
}

View File

@ -10,14 +10,12 @@ if not IS_OSS_BUILD:
rn_xplat_cxx_library(
name = "uimanager",
srcs = glob(
[
"**/*.cpp",
],
["**/*.cpp"],
excludes = glob(["tests/**/*.cpp"]),
),
headers = glob(
[
"**/*.h",
],
["**/*.h"],
excludes = glob(["tests/**/*.h"]),
),
header_namespace = "",
exported_headers = subdir_glob(
@ -39,6 +37,9 @@ rn_xplat_cxx_library(
"-DLOG_TAG=\"ReactNative\"",
"-DWITH_FBSYSTRACE=1",
],
tests = [
":tests",
],
visibility = ["PUBLIC"],
deps = [
"xplat//fbsystrace:fbsystrace",
@ -51,3 +52,25 @@ rn_xplat_cxx_library(
react_native_xplat_target("fabric/view:view"),
],
)
if not IS_OSS_BUILD:
load("@xplat//configurations/buck:default_platform_defs.bzl", "APPLE")
cxx_test(
name = "tests",
srcs = glob(["tests/**/*.cpp"]),
headers = glob(["tests/**/*.h"]),
contacts = ["oncall+react_native@xmail.facebook.com"],
compiler_flags = [
"-fexceptions",
"-frtti",
"-std=c++14",
"-Wall",
],
platforms = APPLE,
deps = [
"xplat//folly:molly",
"xplat//third-party/gmock:gtest",
":uimanager",
],
)

View File

@ -0,0 +1,17 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <memory>
#include <fabric/uimanager/FabricUIManager.h>
#include <gtest/gtest.h>
using namespace facebook::react;
TEST(FabricUIManagerTest, testSomething) {
// TODO
}

View File

@ -2,22 +2,21 @@ load("//configurations/buck/apple:flag_defs.bzl", "get_application_ios_flags", "
load("//ReactNative:DEFS.bzl", "IS_OSS_BUILD", "rn_xplat_cxx_library", "APPLE_INSPECTOR_FLAGS")
load("//ReactNative:DEFS.bzl", "react_native_xplat_target")
CXX_LIBRARY_COMPILER_FLAGS = [
"-std=c++14",
"-Wall",
]
APPLE_COMPILER_FLAGS = []
if not IS_OSS_BUILD:
load("@xplat//configurations/buck/apple:flag_defs.bzl", "get_static_library_ios_flags", "flags")
APPLE_COMPILER_FLAGS = flags.get_flag_value(get_static_library_ios_flags(), 'compiler_flags')
rn_xplat_cxx_library(
name = "view",
srcs = glob(
[
"**/*.cpp",
],
["**/*.cpp"],
excludes = glob(["tests/**/*.cpp"]),
),
headers = glob(
[
"**/*.h",
],
["**/*.h"],
excludes = glob(["tests/**/*.h"]),
),
header_namespace = "",
exported_headers = subdir_glob(
@ -28,15 +27,22 @@ rn_xplat_cxx_library(
],
prefix = "fabric/view",
),
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
compiler_flags = [
"-fexceptions",
"-frtti",
"-std=c++14",
"-Wall",
],
fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
fbobjc_preprocessor_flags = get_debug_preprocessor_flags() + APPLE_INSPECTOR_FLAGS,
force_static = True,
preprocessor_flags = [
"-DLOG_TAG=\"ReactNative\"",
"-DWITH_FBSYSTRACE=1",
],
tests = [
":tests",
],
visibility = ["PUBLIC"],
deps = [
"xplat//fbsystrace:fbsystrace",
@ -50,3 +56,25 @@ rn_xplat_cxx_library(
react_native_xplat_target("fabric/graphics:graphics"),
],
)
if not IS_OSS_BUILD:
load("@xplat//configurations/buck:default_platform_defs.bzl", "APPLE")
cxx_test(
name = "tests",
srcs = glob(["tests/**/*.cpp"]),
headers = glob(["tests/**/*.h"]),
contacts = ["oncall+react_native@xmail.facebook.com"],
compiler_flags = [
"-fexceptions",
"-frtti",
"-std=c++14",
"-Wall",
],
platforms = APPLE,
deps = [
"xplat//folly:molly",
"xplat//third-party/gmock:gtest",
":view",
],
)

View File

@ -0,0 +1,17 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <memory>
#include <fabric/view/ViewComponentDescriptor.h>
#include <gtest/gtest.h>
using namespace facebook::react;
TEST(ViewTest, testSomething) {
// TODO
}