Guard calls to debug features in fabric test

Summary:
In some setup, buck cxx test for android runs with `NDEBUG` set, hence we can't call debug symbols in the test cases. So guard those callsites with `#ifndef NDEBUG`.

Also, some dependencies for this test target depend on Android specific symbols, so we have to mark it as instrumentation test for now (FB-specific).

Reviewed By: sahrens

Differential Revision: D13337637

fbshipit-source-id: 02ff152df9937f2b0b8596f53789cdee8ee8a539
This commit is contained in:
Kevin Gozali 2018-12-05 15:00:35 -08:00 committed by Facebook Github Bot
parent 4f9a3bc8f6
commit 01d7aad548
2 changed files with 5 additions and 0 deletions

View File

@ -79,6 +79,7 @@ fb_xplat_cxx_test(
"-Wall",
],
contacts = ["oncall+react_native@xmail.facebook.com"],
fbandroid_use_instrumentation_test = True,
platforms = (ANDROID, APPLE),
deps = [
"xplat//folly:molly",

View File

@ -111,7 +111,9 @@ TEST(UITemplateProcessorTest, testSimpleBytecode) {
*componentDescriptorRegistry,
nativeModuleRegistry,
mockReactNativeConfig_);
#ifndef NDEBUG
LOG(INFO) << std::endl << root1->getDebugDescription();
#endif
auto props1 = std::dynamic_pointer_cast<const ViewProps>(root1->getProps());
ASSERT_NEAR(props1->opacity, 0.5, 0.001);
ASSERT_STREQ(props1->testId.c_str(), "root");
@ -147,7 +149,9 @@ TEST(UITemplateProcessorTest, testConditionalBytecode) {
*componentDescriptorRegistry,
nativeModuleRegistry,
mockReactNativeConfig_);
#ifndef NDEBUG
LOG(INFO) << std::endl << root1->getDebugDescription();
#endif
auto props1 = std::dynamic_pointer_cast<const ViewProps>(root1->getProps());
ASSERT_STREQ(props1->testId.c_str(), "root");
auto children1 = root1->getChildren();