check-flagged-apis: simplify unit test dependencies
Replace the current unit test runner DeviceJUnit4ClassRunner with JUnit4 and replace the (larger) dependency tradefed with the (smaller) dependency junit. This has no impact other than minimizing the unit test static_libs. Bug: 334870672 Test: atest --host check-flagged-apis-test Change-Id: I0520ab0feeea5ea2ed15905136ba2647f86162cb
This commit is contained in:
@@ -46,6 +46,6 @@ java_test_host {
|
||||
"src/com/android/checkflaggedapis/CheckFlaggedApisTest.kt",
|
||||
],
|
||||
static_libs: [
|
||||
"tradefed",
|
||||
"junit",
|
||||
],
|
||||
}
|
||||
|
@@ -16,14 +16,13 @@
|
||||
package com.android.checkflaggedapis
|
||||
|
||||
import android.aconfig.Aconfig
|
||||
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner
|
||||
import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.InputStream
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.JUnit4
|
||||
|
||||
private val API_SIGNATURE =
|
||||
"""
|
||||
@@ -64,8 +63,8 @@ private fun generateFlagsProto(fooState: Aconfig.flag_state): InputStream {
|
||||
return ByteArrayInputStream(binaryProto.toByteArray())
|
||||
}
|
||||
|
||||
@RunWith(DeviceJUnit4ClassRunner::class)
|
||||
class CheckFlaggedApisTest : BaseHostJUnit4Test() {
|
||||
@RunWith(JUnit4::class)
|
||||
class CheckFlaggedApisTest {
|
||||
@Test
|
||||
fun testParseApiSignature() {
|
||||
val expected = setOf(Pair(Symbol("android.Clazz.FOO"), Flag("android.flag.foo")))
|
||||
|
Reference in New Issue
Block a user