Skip to content

Commit

Permalink
Guard calls to debug features in fabric test
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fkgozali authored and facebook-github-bot committed Dec 5, 2018
1 parent 4f9a3bc commit 01d7aad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions ReactCommon/fabric/uimanager/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ fb_xplat_cxx_test(
"-Wall",
],
contacts = ["[email protected]"],
fbandroid_use_instrumentation_test = True,
platforms = (ANDROID, APPLE),
deps = [
"xplat//folly:molly",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 01d7aad

Please sign in to comment.