Darryl Pierce
12/12/2023, 7:53 PMJeff Lockhart
12/12/2023, 7:59 PMDarryl Pierce
12/13/2023, 12:39 AMJeff Lockhart
12/13/2023, 1:27 AMDario Ahdoot
12/13/2023, 10:55 AMDarryl Pierce
12/14/2023, 2:42 PMDario Ahdoot
12/14/2023, 2:51 PMtestImplementation
, and then each Test class needs to be annotated with:
@RunWith(AndroidJUnit4::class)
@Config(instrumentedPackages = ["androidx.loader.content"])
The second being required as some sort of workaround (I think).
We needed to update some of the tests as well, particularly the ones where we needed to scroll things into view, as I think robolectric has a relatively small and fixed screen sizeDarryl Pierce
12/14/2023, 3:34 PMDarryl Pierce
12/14/2023, 3:36 PM12-14 10:35:23.296 20711 20728 I TestRunner: started: warning(junit.framework.TestSuite$1)
12-14 10:35:23.297 20711 20728 I TestRunner: failed: warning(junit.framework.TestSuite$1)
12-14 10:35:23.297 20711 20728 I TestRunner: ----- begin exception -----
12-14 10:35:23.297 20711 20728 I TestRunner: junit.framework.AssertionFailedError: No tests found in org.comixedproject.variant.ui.server.ServerColorTest
12-14 10:35:23.297 20711 20728 I TestRunner: at junit.framework.Assert.fail(Assert.java:50)
12-14 10:35:23.297 20711 20728 I TestRunner: at junit.framework.TestSuite$1.runTest(TestSuite.java:97)
12-14 10:35:23.297 20711 20728 I TestRunner: at junit.framework.TestCase.runBare(TestCase.java:134)
12-14 10:35:23.297 20711 20728 I TestRunner: at junit.framework.TestResult$1.protect(TestResult.java:115)
12-14 10:35:23.297 20711 20728 I TestRunner: at junit.framework.TestResult.runProtected(TestResult.java:133)
12-14 10:35:23.297 20711 20728 I TestRunner: at junit.framework.TestResult.run(TestResult.java:118)
12-14 10:35:23.297 20711 20728 I TestRunner: at junit.framework.TestCase.run(TestCase.java:124)
12-14 10:35:23.297 20711 20728 I TestRunner: at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:195)
12-14 10:35:23.297 20711 20728 I TestRunner: at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:181)
12-14 10:35:23.297 20711 20728 I TestRunner: at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:563)
12-14 10:35:23.297 20711 20728 I TestRunner: at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2248)
12-14 10:35:23.297 20711 20728 I TestRunner: ----- end exception -----
12-14 10:35:23.298 20711 20728 I TestRunner: finished: warning(junit.framework.TestSuite$1)
My branch is here:
https://github.com/mcpierce/variant/tree/feature/issue-35Darryl Pierce
12/14/2023, 3:36 PMDarryl Pierce
12/14/2023, 9:59 PMJeff Lockhart
12/15/2023, 12:52 AMandroidTarget()
to target Android. android()
is deprecated, eventually to be replaced by the Android Gradle plugin supporting KMP directly.Jeff Lockhart
12/15/2023, 12:54 AMdependsOn
. Since Kotlin 1.9.20, the default hierarchy template is applied automatically and calling dependsOn
prevents it from being applied by default.Jeff Lockhart
12/15/2023, 12:58 AMDarryl Pierce
12/15/2023, 1:01 AMDarryl Pierce
12/15/2023, 1:02 AMDarryl Pierce
12/15/2023, 1:11 AMDarryl Pierce
12/15/2023, 1:11 AM