Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7cc21745 authored by Mårten Kongstad's avatar Mårten Kongstad
Browse files

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
parent fde34c3b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -46,6 +46,6 @@ java_test_host {
        "src/com/android/checkflaggedapis/CheckFlaggedApisTest.kt",
    ],
    static_libs: [
        "tradefed",
        "junit",
    ],
}
+3 −4
Original line number Diff line number Diff line
@@ -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")))