Don't use Parameterized runner in StringBuilderPerfTest

Using Parameterized runner has a problem in the test report, and
doesn't report the average time of the runs.

Test: atest CorePerfTests:android.libcore.regression.StringBuilderPerfTest
Change-Id: Ic96b87435cc047fd3620851cfb48f6e4655adb36
This commit is contained in:
Victor Chang
2022-10-10 20:11:58 +01:00
parent bababa91d6
commit 05d740b7d6

View File

@@ -20,28 +20,19 @@ import android.perftests.utils.BenchmarkState;
import android.perftests.utils.PerfStatusReporter;
import android.test.suitebuilder.annotation.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import java.util.Arrays;
import java.util.Collection;
/** Tests the performance of various StringBuilder methods. */
@RunWith(Parameterized.class)
@RunWith(AndroidJUnit4.class)
@LargeTest
public class StringBuilderPerfTest {
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
@Parameters(name = "mLength={0}")
public static Collection<Object[]> data() {
return Arrays.asList(new Object[][] {{1}, {10}, {100}});
}
@Parameterized.Parameter(0)
public int mLength;
public int mLength = 100;
@Test
public void timeAppendBoolean() {