From ca144fca3fb365571e05263aea4261f916e38c47 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 4 May 2020 21:25:56 -0700 Subject: [PATCH] Fix unit test compilation on Android Summary: Before, compilation fails with P130281113. After fixing BUCK target, fails with P130281201. After all changes, the tests succeed. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21390996 fbshipit-source-id: c85aa43b3ef7fc9642d226ae706c937b2a5a408d --- ReactCommon/fabric/mounting/BUCK | 1 + ReactCommon/fabric/mounting/tests/ShadowTreeLifeCycleTest.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ReactCommon/fabric/mounting/BUCK b/ReactCommon/fabric/mounting/BUCK index 9d6ad218c1d..ba11be7771b 100644 --- a/ReactCommon/fabric/mounting/BUCK +++ b/ReactCommon/fabric/mounting/BUCK @@ -76,6 +76,7 @@ fb_xplat_cxx_test( "-Wall", ], contacts = ["oncall+react_native@xmail.facebook.com"], + fbandroid_use_instrumentation_test = True, platforms = (ANDROID, APPLE, CXX), deps = [ ":mounting", diff --git a/ReactCommon/fabric/mounting/tests/ShadowTreeLifeCycleTest.cpp b/ReactCommon/fabric/mounting/tests/ShadowTreeLifeCycleTest.cpp index 5eb9c6aa0c8..d065a696663 100644 --- a/ReactCommon/fabric/mounting/tests/ShadowTreeLifeCycleTest.cpp +++ b/ReactCommon/fabric/mounting/tests/ShadowTreeLifeCycleTest.cpp @@ -114,6 +114,9 @@ static void testShadowNodeTreeLifeCycle( LOG(ERROR) << "Entropy seed: " << entropy.getSeed() << "\n"; + // There are some issues getting `getDebugDescription` to compile + // under test on Android for now. +#ifndef ANDROID LOG(ERROR) << "Shadow Tree before: \n" << currentRootNode->getDebugDescription(); LOG(ERROR) << "Shadow Tree after: \n" @@ -128,6 +131,7 @@ static void testShadowNodeTreeLifeCycle( LOG(ERROR) << "Mutations:" << "\n" << getDebugDescription(mutations, {}); +#endif FAIL(); }