Skip to content

Commit

Permalink
Fixes OSS tests
Browse files Browse the repository at this point in the history
Summary: Fixes OSS tests

Reviewed By: pentiumao

Differential Revision: D44869855

fbshipit-source-id: 1bf2d553a7d198eacad4232be687ab4f33e4fc55
  • Loading branch information
adityasharat authored and facebook-github-bot committed Apr 11, 2023
1 parent 9b44031 commit 4881284
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import androidx.annotation.Nullable;
import androidx.test.core.app.ApplicationProvider;
import com.facebook.rendercore.Host;
import com.facebook.rendercore.MountItemsPool;
import com.facebook.rendercore.Node;
import com.facebook.rendercore.RenderResult;
import com.facebook.rendercore.RenderState;
Expand Down Expand Up @@ -70,9 +71,9 @@ public void commitToUI(RenderTree tree, Object o) {}
private @Nullable RenderTreeHost renderTreeHost;
private @Nullable RenderState<?, ?> renderState;
private @Nullable Node<?> rootNode;
private @Nullable RenderCoreExtension<?, ?>[] extensions;
private int widthSpec = DEFAULT_WIDTH_SPEC;
private int heightSpec = DEFAULT_HEIGHT_SPEC;
private RenderCoreExtension<?, ?>[] extensions;

@Override
public Statement apply(final Statement base, Description description) {
Expand All @@ -89,6 +90,8 @@ public void evaluate() throws Throwable {
renderTreeHost = null;
rootNode = null;
extensions = null;
renderState = null;
MountItemsPool.clear();
}
}
};
Expand Down
21 changes: 21 additions & 0 deletions litho-rendercore/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ android {

defaultConfig {
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
}

testOptions {
unitTests.includeAndroidResources = true

unitTests.all {
// Because of native libraries loading (Yoga), we can never reuse a class loader and
// need to fork a new process per class.
forkEvery = 1
maxParallelForks = 4
}
}

buildTypes {
Expand Down Expand Up @@ -58,6 +70,15 @@ dependencies {
// Android Support Library
compileOnly deps.supportAnnotations
implementation deps.supportCore

testImplementation deps.assertjCore
testImplementation deps.junit
testImplementation deps.robolectric
testImplementation deps.mockitoCore
testImplementation deps.mockitokotlin
testImplementation deps.supportAppCompat
testImplementation deps.supportTestCore
testImplementation project(":litho-rendercore-testing")
}

apply plugin: "com.vanniktech.maven.publish"
2 changes: 2 additions & 0 deletions litho-rendercore/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.facebook.rendercore">
<uses-sdk
android:targetSdkVersion="33" />
</manifest>

0 comments on commit 4881284

Please sign in to comment.