summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apct-tests/perftests/core/Android.bp2
-rw-r--r--apct-tests/perftests/core/src/android/libcore/AdditionPerfTest.java22
-rw-r--r--apct-tests/perftests/core/src/android/libcore/ArrayCopyPerfTest.java14
-rw-r--r--apct-tests/perftests/core/src/android/libcore/ArrayIterationPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/ArrayListIterationPerfTest.java10
-rw-r--r--apct-tests/perftests/core/src/android/libcore/BigIntegerPerfTest.java19
-rw-r--r--apct-tests/perftests/core/src/android/libcore/BufferedZipFilePerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/ClassLoaderResourcePerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/ClonePerfTest.java19
-rw-r--r--apct-tests/perftests/core/src/android/libcore/DeepArrayOpsPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/FieldAccessPerfTest.java25
-rw-r--r--apct-tests/perftests/core/src/android/libcore/HashedCollectionsPerfTest.java17
-rw-r--r--apct-tests/perftests/core/src/android/libcore/ImtConflictPerfTest.java47
-rw-r--r--apct-tests/perftests/core/src/android/libcore/MethodInvocationPerfTest.java29
-rw-r--r--apct-tests/perftests/core/src/android/libcore/MultiplicationPerfTest.java15
-rw-r--r--apct-tests/perftests/core/src/android/libcore/ReferenceGetPerfTest.java13
-rw-r--r--apct-tests/perftests/core/src/android/libcore/ReferencePerfTest.java17
-rw-r--r--apct-tests/perftests/core/src/android/libcore/SmallBigIntegerPerfTest.java10
-rw-r--r--apct-tests/perftests/core/src/android/libcore/StringDexCachePerfTest.java9
-rw-r--r--apct-tests/perftests/core/src/android/libcore/StringIterationPerfTest.java15
-rw-r--r--apct-tests/perftests/core/src/android/libcore/VirtualVersusInterfacePerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/XmlSerializePerfTest.java9
-rw-r--r--apct-tests/perftests/core/src/android/libcore/XmlSerializerPerfTest.java14
-rw-r--r--apct-tests/perftests/core/src/android/libcore/ZipFilePerfTest.java9
-rw-r--r--apct-tests/perftests/core/src/android/libcore/ZipFileReadPerfTest.java9
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/AnnotatedElementPerfTest.java59
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/BidiPerfTest.java20
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/BigIntegerPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/BitSetPerfTest.java20
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/BreakIteratorPerfTest.java10
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/BulkPerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/ByteBufferPerfTest.java70
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/ByteBufferScalarVersusVectorPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/CharacterPerfTest.java36
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/CharsetForNamePerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/CharsetPerfTest.java14
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/CharsetUtf8PerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/ChecksumPerfTest.java14
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/CipherInputStreamPerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/CipherPerfTest.java10
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/CollatorPerfTest.java14
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/CollectionsPerfTest.java14
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/DateFormatPerfTest.java10
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatPerfTest.java20
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatSymbolsPerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/DefaultCharsetPerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/DnsPerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/DoPrivilegedPerfTest.java14
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/DoublePerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/EqualsHashCodePerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java38
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/FilePerfTest.java10
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/FloatPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/FormatterPerfTest.java32
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/IdnPerfTest.java10
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/IntConstantDivisionPerfTest.java22
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/IntConstantMultiplicationPerfTest.java28
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/IntConstantRemainderPerfTest.java20
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/IntegerPerfTest.java22
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/IntegralToStringPerfTest.java54
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/KeyPairGeneratorPerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/LoopingBackwardsPerfTest.java10
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/MathPerfTest.java118
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/MessageDigestPerfTest.java24
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/MutableIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/NumberFormatPerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/NumberFormatTrivialFormatLongPerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/PriorityQueuePerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/PropertyAccessPerfTest.java24
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/ProviderPerfTest.java10
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/RandomPerfTest.java14
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/RealToStringPerfTest.java40
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/ReflectionPerfTest.java52
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/SSLLoopbackPerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/SSLSocketFactoryPerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/SchemePrefixPerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/SerializationPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/SignaturePerfTest.java10
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/SimpleDateFormatPerfTest.java22
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/StrictMathPerfTest.java114
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/StringBuilderPerfTest.java28
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/StringEqualsPerfTest.java22
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/StringIsEmptyPerfTest.java14
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/StringLengthPerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/StringPerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/StringReplaceAllPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/StringReplacePerfTest.java18
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/StringSplitPerfTest.java18
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/StringToBytesPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/StringToRealPerfTest.java10
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/ThreadLocalPerfTest.java8
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/TimeZonePerfTest.java18
-rw-r--r--apct-tests/perftests/core/src/android/libcore/regression/XMLEntitiesPerfTest.java10
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianIntPerfTest.java15
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianStringPerfTest.java15
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianIntPerfTest.java15
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianStringPerfTest.java15
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianIntPerfTest.java15
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianStringPerfTest.java15
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianIntPerfTest.java15
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianStringPerfTest.java15
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianStringPerfTest.java15
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianStringPerfTest.java15
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianIntPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianStringPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianIntPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianStringPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianIntPerfTest.java13
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianStringPerfTest.java13
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewBigEndianIntPerfTest.java21
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewLittleEndianIntPerfTest.java21
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianIntPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianStringPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianIntPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianStringPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianIntPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianStringPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianIntPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianStringPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianIntPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianStringPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianIntPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianStringPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianFloatPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianFloatPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianFloatPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianFloatPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianFloatPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianFloatPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianIntPerfTest.java13
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianStringPerfTest.java13
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewBigEndianIntPerfTest.java33
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewLittleEndianIntPerfTest.java33
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianIntPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianStringPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianIntPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianStringPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianIntPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianStringPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianIntPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianStringPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianIntPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianStringPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianIntPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianStringPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianIntPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianStringPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianIntPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianStringPerfTest.java11
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianStringPerfTest.java15
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianStringPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianStringPerfTest.java15
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianIntPerfTest.java12
-rw-r--r--apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianStringPerfTest.java12
-rwxr-xr-xapct-tests/perftests/core/src/android/libcore/varhandles/generate_java.py18
-rw-r--r--apct-tests/perftests/healthconnect/Android.bp2
-rw-r--r--apct-tests/perftests/packagemanager/Android.bp2
-rw-r--r--apct-tests/perftests/permission/Android.bp2
-rw-r--r--apct-tests/perftests/settingsprovider/Android.bp2
-rw-r--r--cmds/uiautomator/library/Android.bp6
-rw-r--r--core/tests/BroadcastRadioTests/Android.bp2
-rw-r--r--core/tests/ConnectivityManagerTest/Android.bp4
-rw-r--r--core/tests/GameManagerTests/Android.bp2
-rw-r--r--core/tests/InputMethodCoreTests/Android.bp6
-rw-r--r--core/tests/PackageInstallerSessions/Android.bp4
-rw-r--r--core/tests/PlatformCompatFramework/Android.bp4
-rw-r--r--core/tests/bandwidthtests/Android.bp6
-rw-r--r--core/tests/batterystatstests/BatteryStatsLoadTests/Android.bp2
-rw-r--r--core/tests/batterystatstests/BatteryUsageStatsProtoTests/Android.bp2
-rw-r--r--core/tests/bugreports/Android.bp4
-rw-r--r--core/tests/companiontests/Android.bp4
-rw-r--r--core/tests/coretests/Android.bp22
-rw-r--r--core/tests/devicestatetests/Android.bp2
-rw-r--r--core/tests/featureflagtests/Android.bp4
-rw-r--r--core/tests/hdmitests/Android.bp2
-rw-r--r--core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.bp4
-rw-r--r--core/tests/mockingcoretests/Android.bp6
-rw-r--r--core/tests/packagemanagertests/Android.bp2
-rw-r--r--core/tests/packagemonitortests/Android.bp4
-rw-r--r--core/tests/privacytests/Android.bp2
-rw-r--r--core/tests/screenshothelpertests/Android.bp6
-rw-r--r--core/tests/systemproperties/Android.bp8
-rw-r--r--core/tests/timetests/Android.bp2
-rw-r--r--core/tests/utillib/Android.bp2
-rw-r--r--core/tests/utiltests/Android.bp8
-rw-r--r--core/tests/vibrator/Android.bp6
-rw-r--r--keystore/tests/Android.bp2
-rw-r--r--libs/WindowManager/Jetpack/tests/unittest/Android.bp6
-rw-r--r--libs/WindowManager/Shell/multivalentTests/Android.bp4
-rw-r--r--libs/WindowManager/Shell/tests/flicker/Android.bp2
-rw-r--r--libs/WindowManager/Shell/tests/unittest/Android.bp6
-rw-r--r--libs/dream/lowlight/tests/Android.bp6
-rw-r--r--libs/securebox/tests/Android.bp6
-rw-r--r--media/lib/tvremote/tests/Android.bp6
-rw-r--r--media/mca/tests/Android.bp4
-rw-r--r--media/packages/BluetoothMidiService/tests/unit/Android.bp6
-rw-r--r--media/tests/MediaFrameworkTest/Android.bp6
-rw-r--r--media/tests/MediaRouter/Android.bp4
-rw-r--r--media/tests/TunerTest/Android.bp6
-rw-r--r--media/tests/projection/Android.bp6
-rw-r--r--nfc/Android.bp4
-rw-r--r--nfc/tests/Android.bp2
-rw-r--r--packages/CarrierDefaultApp/tests/unit/Android.bp4
-rw-r--r--packages/CredentialManager/tests/robotests/Android.bp6
-rw-r--r--packages/ExternalStorageProvider/tests/Android.bp6
-rw-r--r--packages/FusedLocation/Android.bp8
-rw-r--r--packages/SettingsLib/Spa/screenshot/robotests/Android.bp6
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/media/OWNERS1
-rw-r--r--packages/SettingsLib/tests/integ/Android.bp6
-rw-r--r--packages/SettingsProvider/Android.bp4
-rw-r--r--packages/Shell/tests/Android.bp6
-rw-r--r--packages/SystemUI/Android.bp18
-rw-r--r--packages/SystemUI/accessibility/accessibilitymenu/tests/Android.bp4
-rw-r--r--packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MultiPointerDraggableTest.kt3
-rw-r--r--packages/SystemUI/res-keyguard/values-as/strings.xml2
-rw-r--r--packages/SystemUI/res-keyguard/values-ja/strings.xml2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java37
-rw-r--r--packages/SystemUI/tests/Android.bp4
-rw-r--r--packages/VpnDialogs/tests/Android.bp4
-rw-r--r--packages/WAPPushManager/tests/Android.bp4
-rw-r--r--packages/WallpaperBackup/Android.bp4
-rw-r--r--packages/overlays/tests/Android.bp4
-rw-r--r--ravenwood/Android.bp3
-rw-r--r--ravenwood/mockito/Android.bp12
-rw-r--r--sax/tests/saxtests/Android.bp4
-rw-r--r--services/foldables/devicestateprovider/tests/Android.bp6
-rw-r--r--services/tests/InputMethodSystemServerTests/Android.bp16
-rw-r--r--services/tests/PackageManagerServiceTests/host/test-apps/DeviceSide/Android.bp2
-rw-r--r--services/tests/PackageManagerServiceTests/server/Android.bp6
-rw-r--r--services/tests/VpnTests/Android.bp6
-rw-r--r--services/tests/displayservicetests/Android.bp2
-rw-r--r--services/tests/mockingservicestests/Android.bp10
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/rollback/Android.bp6
-rw-r--r--services/tests/powerservicetests/Android.bp2
-rw-r--r--services/tests/powerstatstests/Android.bp2
-rw-r--r--services/tests/servicestests/Android.bp16
-rw-r--r--services/tests/timetests/Android.bp2
-rw-r--r--services/tests/uiservicestests/Android.bp6
-rw-r--r--services/tests/vibrator/Android.bp6
-rw-r--r--services/tests/voiceinteractiontests/Android.bp6
-rw-r--r--services/tests/wmtests/Android.bp6
-rw-r--r--test-runner/Android.bp30
-rw-r--r--test-runner/tests/Android.bp4
-rw-r--r--tests/AppLaunch/Android.bp7
-rw-r--r--tests/AttestationVerificationTest/Android.bp4
-rw-r--r--tests/BrowserPowerTest/Android.bp4
-rw-r--r--tests/Camera2Tests/SmartCamera/SimpleCamera/tests/Android.bp2
-rw-r--r--tests/ChoreographerTests/Android.bp4
-rw-r--r--tests/CompanionDeviceMultiDeviceTests/client/Android.bp4
-rw-r--r--tests/CoreTests/android/Android.bp2
-rw-r--r--tests/CtsSurfaceControlTestsStaging/Android.bp4
-rw-r--r--tests/DataIdleTest/Android.bp4
-rw-r--r--tests/EnforcePermission/perf-app/Android.bp4
-rw-r--r--tests/EnforcePermission/test-app/Android.bp4
-rw-r--r--tests/FlickerTests/Android.bp2
-rw-r--r--tests/FrameworkPerf/Android.bp4
-rw-r--r--tests/GamePerformance/Android.bp4
-rw-r--r--tests/Input/Android.bp4
-rw-r--r--tests/InputMethodStressTest/Android.bp2
-rw-r--r--tests/InputScreenshotTest/Android.bp4
-rw-r--r--tests/InputScreenshotTest/robotests/Android.bp6
-rw-r--r--tests/Internal/Android.bp2
-rw-r--r--tests/LocalizationTest/Android.bp6
-rw-r--r--tests/MemoryUsage/Android.bp4
-rw-r--r--tests/MultiUser/Android.bp6
-rw-r--r--tests/NetworkSecurityConfigTest/Android.bp4
-rw-r--r--tests/OneMedia/Android.bp2
-rw-r--r--tests/PackageWatchdog/Android.bp2
-rw-r--r--tests/ProtoInputStreamTests/Android.bp2
-rw-r--r--tests/RemoteDisplayProvider/Android.bp2
-rw-r--r--tests/ServiceCrashTest/Android.bp2
-rw-r--r--tests/SharedLibraryLoadingTest/test-apps/SharedLibraryClientTests/Android.bp2
-rw-r--r--tests/TelephonyCommonTests/Android.bp6
-rw-r--r--tests/TrustTests/Android.bp4
-rw-r--r--tests/TtsTests/Android.bp4
-rw-r--r--tests/UpdatableSystemFontTest/Android.bp2
-rw-r--r--tests/UsbManagerTests/lib/Android.bp2
-rw-r--r--tests/inputmethod/ConcurrentMultiSessionImeTest/Android.bp2
-rw-r--r--tests/permission/Android.bp4
-rw-r--r--tests/testables/Android.bp4
-rw-r--r--tests/testables/tests/Android.bp6
-rw-r--r--tests/utils/testutils/Android.bp6
-rw-r--r--tests/utils/testutils/tests/Android.bp6
-rw-r--r--tests/vcn/Android.bp6
-rw-r--r--wifi/tests/Android.bp4
346 files changed, 2109 insertions, 1858 deletions
diff --git a/apct-tests/perftests/core/Android.bp b/apct-tests/perftests/core/Android.bp
index 65bc8ccd12f8..1e299cdf8002 100644
--- a/apct-tests/perftests/core/Android.bp
+++ b/apct-tests/perftests/core/Android.bp
@@ -52,7 +52,7 @@ android_test {
"guava",
],
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs.system"],
java_resources: [":GoogleFontDancingScript"],
diff --git a/apct-tests/perftests/core/src/android/libcore/AdditionPerfTest.java b/apct-tests/perftests/core/src/android/libcore/AdditionPerfTest.java
index 80cd86cf9a5b..237c747e3a6f 100644
--- a/apct-tests/perftests/core/src/android/libcore/AdditionPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/AdditionPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -34,11 +34,11 @@ import org.junit.runner.RunWith;
public class AdditionPerfTest {
@Rule
- public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeAddConstantToLocalInt() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
int result = 0;
while (state.keepRunning()) {
result += 123;
@@ -46,7 +46,7 @@ public class AdditionPerfTest {
}
@Test
public void timeAddTwoLocalInts() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
int result = 0;
int constant = 123;
while (state.keepRunning()) {
@@ -55,7 +55,7 @@ public class AdditionPerfTest {
}
@Test
public void timeAddConstantToLocalLong() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
long result = 0;
while (state.keepRunning()) {
result += 123L;
@@ -63,7 +63,7 @@ public class AdditionPerfTest {
}
@Test
public void timeAddTwoLocalLongs() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
long result = 0;
long constant = 123L;
while (state.keepRunning()) {
@@ -72,7 +72,7 @@ public class AdditionPerfTest {
}
@Test
public void timeAddConstantToLocalFloat() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
float result = 0.0f;
while (state.keepRunning()) {
result += 123.0f;
@@ -80,7 +80,7 @@ public class AdditionPerfTest {
}
@Test
public void timeAddTwoLocalFloats() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
float result = 0.0f;
float constant = 123.0f;
while (state.keepRunning()) {
@@ -89,7 +89,7 @@ public class AdditionPerfTest {
}
@Test
public void timeAddConstantToLocalDouble() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
double result = 0.0;
while (state.keepRunning()) {
result += 123.0;
@@ -97,7 +97,7 @@ public class AdditionPerfTest {
}
@Test
public void timeAddTwoLocalDoubles() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
double result = 0.0;
double constant = 123.0;
while (state.keepRunning()) {
diff --git a/apct-tests/perftests/core/src/android/libcore/ArrayCopyPerfTest.java b/apct-tests/perftests/core/src/android/libcore/ArrayCopyPerfTest.java
index 2f6c37832d04..1222bc242564 100644
--- a/apct-tests/perftests/core/src/android/libcore/ArrayCopyPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/ArrayCopyPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -33,11 +33,11 @@ import java.util.Arrays;
public class ArrayCopyPerfTest {
@Rule
- public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeManualArrayCopy() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
char[] src = new char[8192];
while (state.keepRunning()) {
char[] dst = new char[8192];
@@ -49,7 +49,7 @@ public class ArrayCopyPerfTest {
@Test
public void time_System_arrayCopy() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
char[] src = new char[8192];
while (state.keepRunning()) {
char[] dst = new char[8192];
@@ -59,7 +59,7 @@ public class ArrayCopyPerfTest {
@Test
public void time_Arrays_copyOf() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
char[] src = new char[8192];
while (state.keepRunning()) {
char[] dst = Arrays.copyOf(src, 8192);
@@ -68,7 +68,7 @@ public class ArrayCopyPerfTest {
@Test
public void time_Arrays_copyOfRange() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
char[] src = new char[8192];
while (state.keepRunning()) {
char[] dst = Arrays.copyOfRange(src, 0, 8192);
diff --git a/apct-tests/perftests/core/src/android/libcore/ArrayIterationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/ArrayIterationPerfTest.java
index d17add767257..3f95e3e44f84 100644
--- a/apct-tests/perftests/core/src/android/libcore/ArrayIterationPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/ArrayIterationPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -38,7 +38,7 @@ public class ArrayIterationPerfTest {
}
@Rule
- public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
Foo[] mArray = new Foo[27];
{
@@ -46,7 +46,7 @@ public class ArrayIterationPerfTest {
}
@Test
public void timeArrayIteration() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
int sum = 0;
for (int i = 0; i < mArray.length; i++) {
@@ -56,7 +56,7 @@ public class ArrayIterationPerfTest {
}
@Test
public void timeArrayIterationCached() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
int sum = 0;
Foo[] localArray = mArray;
@@ -69,7 +69,7 @@ public class ArrayIterationPerfTest {
}
@Test
public void timeArrayIterationForEach() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
int sum = 0;
for (Foo a: mArray) {
diff --git a/apct-tests/perftests/core/src/android/libcore/ArrayListIterationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/ArrayListIterationPerfTest.java
index 3a57db8f323f..1423a13b43dc 100644
--- a/apct-tests/perftests/core/src/android/libcore/ArrayListIterationPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/ArrayListIterationPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -39,7 +39,7 @@ public class ArrayListIterationPerfTest {
int mSplat;
}
@Rule
- public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
ArrayList<Foo> mList = new ArrayList<Foo>();
{
@@ -47,7 +47,7 @@ public class ArrayListIterationPerfTest {
}
@Test
public void timeArrayListIterationIndexed() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
int sum = 0;
ArrayList<Foo> list = mList;
@@ -59,7 +59,7 @@ public class ArrayListIterationPerfTest {
}
@Test
public void timeArrayListIterationForEach() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
int sum = 0;
for (Foo a : mList) {
diff --git a/apct-tests/perftests/core/src/android/libcore/BigIntegerPerfTest.java b/apct-tests/perftests/core/src/android/libcore/BigIntegerPerfTest.java
index 3fb3bc8c0ff2..02831055ff56 100644
--- a/apct-tests/perftests/core/src/android/libcore/BigIntegerPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/BigIntegerPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -38,7 +38,8 @@ import java.math.BigInteger;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class BigIntegerPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
// A simple sum of products computation, mostly so we can check timing in the
// absence of any division. Computes the sum from 1 to n of ((10^prec) << 30) + 1)^2,
@@ -61,7 +62,7 @@ public class BigIntegerPerfTest {
// Execute the above rep times, optionally timing it.
@Test
public void repeatInner() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 10; i <= 10_000; i *= 10) {
inner(100, i);
@@ -85,7 +86,7 @@ public class BigIntegerPerfTest {
// Check results for equality, and print one, to compaare against reference.
@Test
public void repeatHarmonic1000() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 5; i <= 5_000; i *= 10) {
BigInteger refRes = harmonic1000(i);
@@ -106,7 +107,7 @@ public class BigIntegerPerfTest {
// us to time and check it for consistency as well.
@Test
public void repeatToString() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 5; i <= 5_000; i *= 10) {
BigInteger refRes = harmonic1000(i);
@@ -146,7 +147,7 @@ public class BigIntegerPerfTest {
// to compare to reference.
@Test
public void repeatEApprox() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 10; i <= 10_000; i *= 10) {
BigInteger refRes = eApprox(100_000, i);
@@ -165,7 +166,7 @@ public class BigIntegerPerfTest {
// Test / time modPow()
@Test
public void repeatModPow() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 5; i <= 500; i *= 10) {
BigInteger odd1 = BigInteger.TEN.pow(i / 2).add(BigInteger.ONE);
@@ -198,7 +199,7 @@ public class BigIntegerPerfTest {
// Test / time modInverse()
@Test
public void repeatModInverse() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 10; i <= 10_000; i *= 10) {
BigInteger odd1 = BigInteger.TEN.pow(i / 2).add(BigInteger.ONE);
diff --git a/apct-tests/perftests/core/src/android/libcore/BufferedZipFilePerfTest.java b/apct-tests/perftests/core/src/android/libcore/BufferedZipFilePerfTest.java
index 2a1b5d1cc6ce..11ca73acd45b 100644
--- a/apct-tests/perftests/core/src/android/libcore/BufferedZipFilePerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/BufferedZipFilePerfTest.java
@@ -16,8 +16,9 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
+
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -39,7 +40,8 @@ import java.util.zip.ZipOutputStream;
@RunWith(AndroidJUnit4.class)
@LargeTest
public final class BufferedZipFilePerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
int[] mReadSize = new int[] {4, 32, 128};
int[] mCompressedSize = new int[] {128, 1024, 8192, 65536};
@@ -67,7 +69,7 @@ public final class BufferedZipFilePerfTest {
@Test
public void timeUnbufferedRead() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < mCompressedSize.length; i++) {
for (int j = 0; j < mReadSize.length; j++) {
@@ -87,7 +89,7 @@ public final class BufferedZipFilePerfTest {
@Test
public void timeBufferedRead() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < mCompressedSize.length; i++) {
for (int j = 0; j < mReadSize.length; j++) {
diff --git a/apct-tests/perftests/core/src/android/libcore/ClassLoaderResourcePerfTest.java b/apct-tests/perftests/core/src/android/libcore/ClassLoaderResourcePerfTest.java
index 5f599ea85eb4..0abe194b6fdb 100644
--- a/apct-tests/perftests/core/src/android/libcore/ClassLoaderResourcePerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/ClassLoaderResourcePerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -30,7 +30,8 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ClassLoaderResourcePerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private static final String EXISTENT_RESOURCE = "java/util/logging/logging.properties";
private static final String MISSING_RESOURCE = "missing_entry";
@@ -40,7 +41,7 @@ public class ClassLoaderResourcePerfTest {
ClassLoader currentClassLoader = getClass().getClassLoader();
Assert.assertNotNull(currentClassLoader.getResource(EXISTENT_RESOURCE));
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
currentClassLoader.getResource(EXISTENT_RESOURCE);
}
@@ -51,7 +52,7 @@ public class ClassLoaderResourcePerfTest {
ClassLoader currentClassLoader = getClass().getClassLoader();
Assert.assertNull(currentClassLoader.getResource(MISSING_RESOURCE));
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
currentClassLoader.getResource(MISSING_RESOURCE);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/ClonePerfTest.java b/apct-tests/perftests/core/src/android/libcore/ClonePerfTest.java
index ea249848daad..52441d1d868e 100644
--- a/apct-tests/perftests/core/src/android/libcore/ClonePerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/ClonePerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -29,7 +29,8 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ClonePerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static class CloneableObject implements Cloneable {
public Object clone() throws CloneNotSupportedException {
@@ -1127,7 +1128,7 @@ public class ClonePerfTest {
public void time_Object_clone() {
try {
CloneableObject o = new CloneableObject();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
o.clone();
}
@@ -1140,7 +1141,7 @@ public class ClonePerfTest {
public void time_Object_manyFieldClone() {
try {
CloneableManyFieldObject o = new CloneableManyFieldObject();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
o.clone();
}
@@ -1153,7 +1154,7 @@ public class ClonePerfTest {
public void time_Object_deepClone() {
try {
DeepCloneable o = new DeepCloneable();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
o.clone();
}
@@ -1165,7 +1166,7 @@ public class ClonePerfTest {
@Test
public void time_Array_clone() {
int[] o = new int[32];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
o.clone();
}
@@ -1177,7 +1178,7 @@ public class ClonePerfTest {
for (int i = 0; i < o.length / 2; ++i) {
o[i] = new Object();
}
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
o.clone();
}
@@ -1189,7 +1190,7 @@ public class ClonePerfTest {
for (int i = 0; i < o.length / 2; ++i) {
o[i] = new Object();
}
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
o.clone();
}
diff --git a/apct-tests/perftests/core/src/android/libcore/DeepArrayOpsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/DeepArrayOpsPerfTest.java
index 82247dcee772..e6c5aca2c330 100644
--- a/apct-tests/perftests/core/src/android/libcore/DeepArrayOpsPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/DeepArrayOpsPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -36,7 +36,8 @@ import java.util.Collection;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class DeepArrayOpsPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private Object[] mArray;
private Object[] mArray2;
@@ -99,7 +100,7 @@ public class DeepArrayOpsPerfTest {
@Parameters(method = "getData")
public void deepHashCode(int arrayLength) throws Exception {
setUp(arrayLength);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Arrays.deepHashCode(mArray);
}
@@ -109,7 +110,7 @@ public class DeepArrayOpsPerfTest {
@Parameters(method = "getData")
public void deepEquals(int arrayLength) throws Exception {
setUp(arrayLength);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Arrays.deepEquals(mArray, mArray2);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/FieldAccessPerfTest.java b/apct-tests/perftests/core/src/android/libcore/FieldAccessPerfTest.java
index 0bebf04c6897..378137b417e9 100644
--- a/apct-tests/perftests/core/src/android/libcore/FieldAccessPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/FieldAccessPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -30,7 +30,8 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class FieldAccessPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private static class Inner {
public int mPublicInnerIntVal;
@@ -47,7 +48,7 @@ public class FieldAccessPerfTest {
@Test
public void timeField() {
int result = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = mIntVal;
}
@@ -56,7 +57,7 @@ public class FieldAccessPerfTest {
@Test
public void timeFieldFinal() {
int result = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = mFinalIntVal;
}
@@ -65,7 +66,7 @@ public class FieldAccessPerfTest {
@Test
public void timeFieldStatic() {
int result = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = sStaticIntVal;
}
@@ -74,7 +75,7 @@ public class FieldAccessPerfTest {
@Test
public void timeFieldStaticFinal() {
int result = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = FINAL_INT_VAL;
}
@@ -84,7 +85,7 @@ public class FieldAccessPerfTest {
public void timeFieldCached() {
int result = 0;
int cachedIntVal = this.mIntVal;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = cachedIntVal;
}
@@ -94,7 +95,7 @@ public class FieldAccessPerfTest {
public void timeFieldPrivateInnerClassPublicField() {
int result = 0;
Inner inner = new Inner();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = inner.mPublicInnerIntVal;
}
@@ -104,7 +105,7 @@ public class FieldAccessPerfTest {
public void timeFieldPrivateInnerClassProtectedField() {
int result = 0;
Inner inner = new Inner();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = inner.mProtectedInnerIntVal;
}
@@ -114,7 +115,7 @@ public class FieldAccessPerfTest {
public void timeFieldPrivateInnerClassPrivateField() {
int result = 0;
Inner inner = new Inner();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = inner.mPrivateInnerIntVal;
}
@@ -124,7 +125,7 @@ public class FieldAccessPerfTest {
public void timeFieldPrivateInnerClassPackageField() {
int result = 0;
Inner inner = new Inner();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = inner.mPackageInnerIntVal;
}
diff --git a/apct-tests/perftests/core/src/android/libcore/HashedCollectionsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/HashedCollectionsPerfTest.java
index 55c1027e1add..610e8e56c951 100644
--- a/apct-tests/perftests/core/src/android/libcore/HashedCollectionsPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/HashedCollectionsPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -35,13 +35,14 @@ import java.util.concurrent.ConcurrentHashMap;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class HashedCollectionsPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeHashMapGet() {
HashMap<String, String> map = new HashMap<String, String>();
map.put("hello", "world");
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
map.get("hello");
}
@@ -53,7 +54,7 @@ public class HashedCollectionsPerfTest {
synchronized (map) {
map.put("hello", "world");
}
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
synchronized (map) {
map.get("hello");
@@ -65,7 +66,7 @@ public class HashedCollectionsPerfTest {
public void timeHashtableGet() {
Hashtable<String, String> map = new Hashtable<String, String>();
map.put("hello", "world");
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
map.get("hello");
}
@@ -75,7 +76,7 @@ public class HashedCollectionsPerfTest {
public void timeLinkedHashMapGet() {
LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
map.put("hello", "world");
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
map.get("hello");
}
@@ -85,7 +86,7 @@ public class HashedCollectionsPerfTest {
public void timeConcurrentHashMapGet() {
ConcurrentHashMap<String, String> map = new ConcurrentHashMap<String, String>();
map.put("hello", "world");
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
map.get("hello");
}
diff --git a/apct-tests/perftests/core/src/android/libcore/ImtConflictPerfTest.java b/apct-tests/perftests/core/src/android/libcore/ImtConflictPerfTest.java
index da60a7773528..40c07e05bbde 100644
--- a/apct-tests/perftests/core/src/android/libcore/ImtConflictPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/ImtConflictPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -41,7 +41,8 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ImtConflictPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Before
public void setup() {
@@ -280,7 +281,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth01() {
C0 c0 = new C0();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c0);
callF0(c0);
@@ -308,7 +309,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth02() {
C1 c1 = new C1();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c1);
callF19(c1);
@@ -336,7 +337,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth03() {
C2 c2 = new C2();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c2);
callF19(c2);
@@ -364,7 +365,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth04() {
C3 c3 = new C3();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c3);
callF19(c3);
@@ -392,7 +393,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth05() {
C4 c4 = new C4();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c4);
callF19(c4);
@@ -420,7 +421,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth06() {
C5 c5 = new C5();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c5);
callF19(c5);
@@ -448,7 +449,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth07() {
C6 c6 = new C6();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c6);
callF19(c6);
@@ -476,7 +477,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth08() {
C7 c7 = new C7();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c7);
callF19(c7);
@@ -504,7 +505,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth09() {
C8 c8 = new C8();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c8);
callF19(c8);
@@ -532,7 +533,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth10() {
C9 c9 = new C9();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c9);
callF19(c9);
@@ -560,7 +561,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth11() {
C10 c10 = new C10();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c10);
callF19(c10);
@@ -588,7 +589,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth12() {
C11 c11 = new C11();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c11);
callF19(c11);
@@ -616,7 +617,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth13() {
C12 c12 = new C12();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c12);
callF19(c12);
@@ -644,7 +645,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth14() {
C13 c13 = new C13();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c13);
callF19(c13);
@@ -672,7 +673,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth15() {
C14 c14 = new C14();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c14);
callF19(c14);
@@ -700,7 +701,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth16() {
C15 c15 = new C15();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c15);
callF19(c15);
@@ -728,7 +729,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth17() {
C16 c16 = new C16();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c16);
callF19(c16);
@@ -756,7 +757,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth18() {
C17 c17 = new C17();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c17);
callF19(c17);
@@ -784,7 +785,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth19() {
C18 c18 = new C18();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c18);
callF19(c18);
@@ -812,7 +813,7 @@ public class ImtConflictPerfTest {
@Test
public void timeConflictDepth20() {
C19 c19 = new C19();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
callF0(c19);
callF19(c19);
diff --git a/apct-tests/perftests/core/src/android/libcore/MethodInvocationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/MethodInvocationPerfTest.java
index 6d9d0c92ff25..e1d0bf2f9491 100644
--- a/apct-tests/perftests/core/src/android/libcore/MethodInvocationPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/MethodInvocationPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -30,7 +30,8 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class MethodInvocationPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
interface I {
void emptyInterface();
@@ -65,12 +66,12 @@ public class MethodInvocationPerfTest {
}
public void timeInternalGetter() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
new C().timeInternalGetter(state);
}
public void timeInternalFieldAccess() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
new C().timeInternalFieldAccess(state);
}
@@ -78,7 +79,7 @@ public class MethodInvocationPerfTest {
@Test
public void timeStringLength() {
int result = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = "hello, world!".length();
}
@@ -87,7 +88,7 @@ public class MethodInvocationPerfTest {
@Test
public void timeEmptyStatic() {
C c = new C();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
c.emptyStatic();
}
@@ -96,7 +97,7 @@ public class MethodInvocationPerfTest {
@Test
public void timeEmptyVirtual() {
C c = new C();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
c.emptyVirtual();
}
@@ -105,7 +106,7 @@ public class MethodInvocationPerfTest {
@Test
public void timeEmptyInterface() {
I c = new C();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
c.emptyInterface();
}
@@ -138,7 +139,7 @@ public class MethodInvocationPerfTest {
@Test
public void timePrivateInnerPublicMethod() {
Inner inner = new Inner();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
inner.publicMethod();
}
@@ -147,7 +148,7 @@ public class MethodInvocationPerfTest {
@Test
public void timePrivateInnerProtectedMethod() {
Inner inner = new Inner();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
inner.protectedMethod();
}
@@ -156,7 +157,7 @@ public class MethodInvocationPerfTest {
@Test
public void timePrivateInnerPrivateMethod() {
Inner inner = new Inner();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
inner.privateMethod();
}
@@ -165,7 +166,7 @@ public class MethodInvocationPerfTest {
@Test
public void timePrivateInnerPackageMethod() {
Inner inner = new Inner();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
inner.packageMethod();
}
@@ -174,7 +175,7 @@ public class MethodInvocationPerfTest {
@Test
public void timePrivateInnerFinalPackageMethod() {
Inner inner = new Inner();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
inner.finalPackageMethod();
}
diff --git a/apct-tests/perftests/core/src/android/libcore/MultiplicationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/MultiplicationPerfTest.java
index 09b09771e9de..c5e9d1e1d5e4 100644
--- a/apct-tests/perftests/core/src/android/libcore/MultiplicationPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/MultiplicationPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -30,12 +30,13 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class MultiplicationPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeMultiplyIntByConstant10() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result *= 10;
}
@@ -44,7 +45,7 @@ public class MultiplicationPerfTest {
@Test
public void timeMultiplyIntByConstant8() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result *= 8;
}
@@ -54,7 +55,7 @@ public class MultiplicationPerfTest {
public void timeMultiplyIntByVariable10() {
int result = 1;
int factor = 10;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result *= factor;
}
@@ -64,7 +65,7 @@ public class MultiplicationPerfTest {
public void timeMultiplyIntByVariable8() {
int result = 1;
int factor = 8;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result *= factor;
}
diff --git a/apct-tests/perftests/core/src/android/libcore/ReferenceGetPerfTest.java b/apct-tests/perftests/core/src/android/libcore/ReferenceGetPerfTest.java
index ba21ed33bdb2..d073f9163f39 100644
--- a/apct-tests/perftests/core/src/android/libcore/ReferenceGetPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/ReferenceGetPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -35,7 +35,8 @@ import java.lang.reflect.Field;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ReferenceGetPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
boolean mIntrinsicDisabled;
@@ -51,7 +52,7 @@ public class ReferenceGetPerfTest {
@Test
public void timeSoftReferenceGet() throws Exception {
Reference soft = new SoftReference(mObj);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Object o = soft.get();
}
@@ -60,7 +61,7 @@ public class ReferenceGetPerfTest {
@Test
public void timeWeakReferenceGet() throws Exception {
Reference weak = new WeakReference(mObj);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Object o = weak.get();
}
@@ -71,7 +72,7 @@ public class ReferenceGetPerfTest {
Reference weak = new WeakReference(mObj);
mObj = null;
Runtime.getRuntime().gc();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Object o = weak.get();
}
diff --git a/apct-tests/perftests/core/src/android/libcore/ReferencePerfTest.java b/apct-tests/perftests/core/src/android/libcore/ReferencePerfTest.java
index 293752ee5dd1..af13773dd177 100644
--- a/apct-tests/perftests/core/src/android/libcore/ReferencePerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/ReferencePerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -34,7 +34,8 @@ import java.util.concurrent.atomic.AtomicInteger;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ReferencePerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private Object mObject;
@@ -42,7 +43,7 @@ public class ReferencePerfTest {
@Test
public void timeAlloc() {
ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new PhantomReference(mObject, queue);
}
@@ -52,7 +53,7 @@ public class ReferencePerfTest {
@Test
public void timeAllocAndEnqueue() {
ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
(new PhantomReference<Object>(mObject, queue)).enqueue();
}
@@ -62,7 +63,7 @@ public class ReferencePerfTest {
@Test
public void timeAllocEnqueueAndPoll() {
ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
(new PhantomReference<Object>(mObject, queue)).enqueue();
queue.poll();
@@ -73,7 +74,7 @@ public class ReferencePerfTest {
@Test
public void timeAllocEnqueueAndRemove() {
ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
(new PhantomReference<Object>(mObject, queue)).enqueue();
try {
@@ -102,7 +103,7 @@ public class ReferencePerfTest {
// Allocate a bunch of finalizable objects.
int n = 0;
AtomicInteger count = new AtomicInteger(0);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
n++;
new FinalizableObject(count);
diff --git a/apct-tests/perftests/core/src/android/libcore/SmallBigIntegerPerfTest.java b/apct-tests/perftests/core/src/android/libcore/SmallBigIntegerPerfTest.java
index 528b751d1551..cf573fa6f250 100644
--- a/apct-tests/perftests/core/src/android/libcore/SmallBigIntegerPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/SmallBigIntegerPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -41,7 +41,9 @@ import java.util.Random;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class SmallBigIntegerPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
+
// We allocate about 2 1/3 BigIntegers per iteration.
// Assuming 100 bytes/BigInteger, this gives us around 500MB total.
static final BigInteger BIG_THREE = BigInteger.valueOf(3);
@@ -51,7 +53,7 @@ public class SmallBigIntegerPerfTest {
public void testSmallBigInteger() {
final Random r = new Random();
BigInteger x = new BigInteger(20, r);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
// We know this converges, but the compiler doesn't.
if (x.and(BigInteger.ONE).equals(BigInteger.ONE)) {
diff --git a/apct-tests/perftests/core/src/android/libcore/StringDexCachePerfTest.java b/apct-tests/perftests/core/src/android/libcore/StringDexCachePerfTest.java
index 1f301acd1dc6..d28154c76067 100644
--- a/apct-tests/perftests/core/src/android/libcore/StringDexCachePerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/StringDexCachePerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -30,13 +30,14 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class StringDexCachePerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeStringDexCacheAccess() {
int v = 0;
int count = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
// Deliberately obscured to make optimizations less likely.
String s = (count >= 0) ? "hello, world!" : null;
diff --git a/apct-tests/perftests/core/src/android/libcore/StringIterationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/StringIterationPerfTest.java
index 4268325f8c64..40a8db0c5903 100644
--- a/apct-tests/perftests/core/src/android/libcore/StringIterationPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/StringIterationPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -30,12 +30,13 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class StringIterationPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeStringIteration0() {
String s = "hello, world!";
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
char ch;
for (int i = 0; i < s.length(); ++i) {
@@ -47,7 +48,7 @@ public class StringIterationPerfTest {
@Test
public void timeStringIteration1() {
String s = "hello, world!";
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
char ch;
for (int i = 0, length = s.length(); i < length; ++i) {
@@ -59,7 +60,7 @@ public class StringIterationPerfTest {
@Test
public void timeStringIteration2() {
String s = "hello, world!";
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
char ch;
char[] chars = s.toCharArray();
@@ -72,7 +73,7 @@ public class StringIterationPerfTest {
@Test
public void timeStringToCharArray() {
String s = "hello, world!";
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
char[] chars = s.toCharArray();
}
diff --git a/apct-tests/perftests/core/src/android/libcore/VirtualVersusInterfacePerfTest.java b/apct-tests/perftests/core/src/android/libcore/VirtualVersusInterfacePerfTest.java
index cb3d3acb337f..147ea50f3a3c 100644
--- a/apct-tests/perftests/core/src/android/libcore/VirtualVersusInterfacePerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/VirtualVersusInterfacePerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -36,12 +36,13 @@ import java.util.Map;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VirtualVersusInterfacePerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeMapPut() {
Map<String, String> map = new HashMap<String, String>();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
map.put("hello", "world");
}
@@ -50,7 +51,7 @@ public class VirtualVersusInterfacePerfTest {
@Test
public void timeHashMapPut() {
HashMap<String, String> map = new HashMap<String, String>();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
map.put("hello", "world");
}
diff --git a/apct-tests/perftests/core/src/android/libcore/XmlSerializePerfTest.java b/apct-tests/perftests/core/src/android/libcore/XmlSerializePerfTest.java
index 5be8ee6e67e2..bb1c298c67b2 100644
--- a/apct-tests/perftests/core/src/android/libcore/XmlSerializePerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/XmlSerializePerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -36,7 +36,8 @@ import java.util.Random;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class XmlSerializePerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private Object[] getParams() {
return new Object[][] {
@@ -108,7 +109,7 @@ public class XmlSerializePerfTest {
private void internalTimeSerializer(Constructor<? extends XmlSerializer> ctor, int seed)
throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
serializeRandomXml(ctor, seed);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/XmlSerializerPerfTest.java b/apct-tests/perftests/core/src/android/libcore/XmlSerializerPerfTest.java
index a37b89ddf033..9360a25fc86a 100644
--- a/apct-tests/perftests/core/src/android/libcore/XmlSerializerPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/XmlSerializerPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import android.util.Xml;
import androidx.test.filters.LargeTest;
@@ -44,11 +44,11 @@ import java.nio.charset.StandardCharsets;
public class XmlSerializerPerfTest {
@Rule
- public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeFastSerializer_nonIndent_depth100() throws IOException {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
XmlSerializer serializer = Xml.newFastSerializer();
runTest(serializer, 100);
@@ -57,7 +57,7 @@ public class XmlSerializerPerfTest {
@Test
public void timeFastSerializer_indent_depth100() throws IOException {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
XmlSerializer serializer = Xml.newFastSerializer();
serializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);
@@ -67,7 +67,7 @@ public class XmlSerializerPerfTest {
@Test
public void timeKXmlSerializer_nonIndent_depth100() throws IOException {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
XmlSerializer serializer = XmlObjectFactory.newXmlSerializer();
runTest(serializer, 100);
@@ -76,7 +76,7 @@ public class XmlSerializerPerfTest {
@Test
public void timeKXmlSerializer_indent_depth100() throws IOException {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
XmlSerializer serializer = XmlObjectFactory.newXmlSerializer();
serializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);
diff --git a/apct-tests/perftests/core/src/android/libcore/ZipFilePerfTest.java b/apct-tests/perftests/core/src/android/libcore/ZipFilePerfTest.java
index ed669beae1ce..03f183a01d11 100644
--- a/apct-tests/perftests/core/src/android/libcore/ZipFilePerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/ZipFilePerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -42,7 +42,8 @@ import java.util.zip.ZipOutputStream;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class ZipFilePerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private File mFile;
@@ -65,7 +66,7 @@ public class ZipFilePerfTest {
@Parameters(method = "getData")
public void timeZipFileOpen(int numEntries) throws Exception {
setUp(numEntries);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
ZipFile zf = new ZipFile(mFile);
state.pauseTiming();
diff --git a/apct-tests/perftests/core/src/android/libcore/ZipFileReadPerfTest.java b/apct-tests/perftests/core/src/android/libcore/ZipFileReadPerfTest.java
index d239a054fac7..36140611c978 100644
--- a/apct-tests/perftests/core/src/android/libcore/ZipFileReadPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/ZipFileReadPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -44,7 +44,8 @@ import java.util.zip.ZipOutputStream;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class ZipFileReadPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public static Collection<Object[]> getData() {
return Arrays.asList(new Object[][] {{1024}, {16384}, {65536}});
@@ -91,7 +92,7 @@ public class ZipFileReadPerfTest {
@Parameters(method = "getData")
public void timeZipFileRead(int readBufferSize) throws Exception {
byte[] readBuffer = new byte[readBufferSize];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
ZipFile zipFile = new ZipFile(mFile);
for (Enumeration<? extends ZipEntry> e = zipFile.entries(); e.hasMoreElements(); ) {
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/AnnotatedElementPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/AnnotatedElementPerfTest.java
index 487295c03c0e..8890f51fe5cd 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/AnnotatedElementPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/AnnotatedElementPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -35,7 +35,8 @@ import java.lang.reflect.Method;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class AnnotatedElementPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private Class<?> mType;
private Field mField;
@@ -52,7 +53,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetTypeAnnotations() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mType.getAnnotations();
}
@@ -60,7 +61,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetFieldAnnotations() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mField.getAnnotations();
}
@@ -68,7 +69,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetMethodAnnotations() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mMethod.getAnnotations();
}
@@ -76,7 +77,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetParameterAnnotations() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mMethod.getParameterAnnotations();
}
@@ -84,7 +85,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetTypeAnnotation() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mType.getAnnotation(Marker.class);
}
@@ -92,7 +93,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetFieldAnnotation() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mField.getAnnotation(Marker.class);
}
@@ -100,7 +101,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetMethodAnnotation() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mMethod.getAnnotation(Marker.class);
}
@@ -108,7 +109,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeIsTypeAnnotationPresent() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mType.isAnnotationPresent(Marker.class);
}
@@ -116,7 +117,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeIsFieldAnnotationPresent() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mField.isAnnotationPresent(Marker.class);
}
@@ -124,7 +125,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeIsMethodAnnotationPresent() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mMethod.isAnnotationPresent(Marker.class);
}
@@ -134,7 +135,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetAllReturnsLargeAnnotation() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
HasLargeAnnotation.class.getAnnotations();
}
@@ -142,7 +143,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetAllReturnsSmallAnnotation() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
HasSmallAnnotation.class.getAnnotations();
}
@@ -150,7 +151,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetAllReturnsMarkerAnnotation() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
HasMarkerAnnotation.class.getAnnotations();
}
@@ -158,7 +159,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetAllReturnsNoAnnotation() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
HasNoAnnotations.class.getAnnotations();
}
@@ -166,7 +167,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetAllReturnsThreeAnnotations() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
HasThreeAnnotations.class.getAnnotations();
}
@@ -176,7 +177,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetAnnotationsOnSubclass() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
ExtendsHasThreeAnnotations.class.getAnnotations();
}
@@ -184,7 +185,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetDeclaredAnnotationsOnSubclass() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
ExtendsHasThreeAnnotations.class.getDeclaredAnnotations();
}
@@ -194,7 +195,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetDeclaredClasses() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
AnnotatedElementPerfTest.class.getDeclaredClasses();
}
@@ -202,7 +203,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetDeclaringClass() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
HasSmallAnnotation.class.getDeclaringClass();
}
@@ -211,7 +212,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetEnclosingClass() {
Object anonymousClass = new Object() {};
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
anonymousClass.getClass().getEnclosingClass();
}
@@ -220,7 +221,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetEnclosingConstructor() {
Object anonymousClass = new Object() {};
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
anonymousClass.getClass().getEnclosingConstructor();
}
@@ -229,7 +230,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetEnclosingMethod() {
Object anonymousClass = new Object() {};
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
anonymousClass.getClass().getEnclosingMethod();
}
@@ -237,7 +238,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetModifiers() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
HasSmallAnnotation.class.getModifiers();
}
@@ -245,7 +246,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeGetSimpleName() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
HasSmallAnnotation.class.getSimpleName();
}
@@ -254,7 +255,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeIsAnonymousClass() {
Object anonymousClass = new Object() {};
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
anonymousClass.getClass().isAnonymousClass();
}
@@ -262,7 +263,7 @@ public class AnnotatedElementPerfTest {
@Test
public void timeIsLocalClass() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
HasSmallAnnotation.class.isLocalClass();
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/BidiPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/BidiPerfTest.java
index adc5d8c2bb3e..baab8602b265 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/BidiPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/BidiPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -34,14 +34,14 @@ import java.text.DecimalFormat;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class BidiPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private static final AttributedCharacterIterator CHAR_ITER =
DecimalFormat.getInstance().formatToCharacterIterator(new BigDecimal(Math.PI));
@Test
public void time_createBidiFromIter() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Bidi bidi = new Bidi(CHAR_ITER);
}
@@ -49,7 +49,7 @@ public class BidiPerfTest {
@Test
public void time_createBidiFromCharArray() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Bidi bd =
new Bidi(
@@ -64,7 +64,7 @@ public class BidiPerfTest {
@Test
public void time_createBidiFromString() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Bidi bidi = new Bidi("Hello", Bidi.DIRECTION_LEFT_TO_RIGHT);
}
@@ -72,7 +72,7 @@ public class BidiPerfTest {
@Test
public void time_reorderVisually() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Bidi.reorderVisually(
new byte[] {2, 1, 3, 0, 4}, 0, new String[] {"H", "e", "l", "l", "o"}, 0, 5);
@@ -81,7 +81,7 @@ public class BidiPerfTest {
@Test
public void time_hebrewBidi() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Bidi bd =
new Bidi(
@@ -104,7 +104,7 @@ public class BidiPerfTest {
@Test
public void time_complicatedOverrideBidi() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Bidi bd =
new Bidi(
@@ -119,7 +119,7 @@ public class BidiPerfTest {
@Test
public void time_requiresBidi() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Bidi.requiresBidi("\u05D0".toCharArray(), 1, 1); // false.
Bidi.requiresBidi("\u05D0".toCharArray(), 0, 1); // true.
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/BigIntegerPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/BigIntegerPerfTest.java
index 286d70339c5f..8a539f89d3ca 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/BigIntegerPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/BigIntegerPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -32,14 +32,14 @@ import java.util.Random;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class BigIntegerPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeRandomDivision() throws Exception {
Random r = new Random();
BigInteger x = new BigInteger(1024, r);
BigInteger y = new BigInteger(1024, r);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x.divide(y);
}
@@ -50,7 +50,7 @@ public class BigIntegerPerfTest {
Random r = new Random();
BigInteger x = new BigInteger(1024, r);
BigInteger y = new BigInteger(1024, r);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x.gcd(y);
}
@@ -61,7 +61,7 @@ public class BigIntegerPerfTest {
Random r = new Random();
BigInteger x = new BigInteger(1024, r);
BigInteger y = new BigInteger(1024, r);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x.multiply(y);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/BitSetPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/BitSetPerfTest.java
index d6462024a380..1b46ff4f433a 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/BitSetPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/BitSetPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -35,7 +35,7 @@ import java.util.Collection;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class BitSetPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public static Collection<Object[]> getData() {
return Arrays.asList(new Object[][] {{1000}, {10000}});
@@ -45,7 +45,7 @@ public class BitSetPerfTest {
@Parameters(method = "getData")
public void timeIsEmptyTrue(int size) {
BitSet bitSet = new BitSet(size);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
if (!bitSet.isEmpty()) throw new RuntimeException();
}
@@ -56,7 +56,7 @@ public class BitSetPerfTest {
public void timeIsEmptyFalse(int size) {
BitSet bitSet = new BitSet(size);
bitSet.set(bitSet.size() - 1);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
if (bitSet.isEmpty()) throw new RuntimeException();
}
@@ -66,7 +66,7 @@ public class BitSetPerfTest {
@Parameters(method = "getData")
public void timeGet(int size) {
BitSet bitSet = new BitSet(size);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
int i = 1;
while (state.keepRunning()) {
bitSet.get(++i % size);
@@ -77,7 +77,7 @@ public class BitSetPerfTest {
@Parameters(method = "getData")
public void timeClear(int size) {
BitSet bitSet = new BitSet(size);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
int i = 1;
while (state.keepRunning()) {
bitSet.clear(++i % size);
@@ -89,7 +89,7 @@ public class BitSetPerfTest {
public void timeSet(int size) {
BitSet bitSet = new BitSet(size);
int i = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
bitSet.set(++i % size);
}
@@ -100,7 +100,7 @@ public class BitSetPerfTest {
public void timeSetOn(int size) {
BitSet bitSet = new BitSet(size);
int i = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
bitSet.set(++i % size, true);
}
@@ -111,7 +111,7 @@ public class BitSetPerfTest {
public void timeSetOff(int size) {
BitSet bitSet = new BitSet(size);
int i = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
bitSet.set(++i % size, false);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/BreakIteratorPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/BreakIteratorPerfTest.java
index b887f4033462..3c5e4fd159c8 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/BreakIteratorPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/BreakIteratorPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -36,7 +36,7 @@ import java.util.Locale;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public final class BreakIteratorPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public enum Text {
LIPSUM(
@@ -165,7 +165,7 @@ public final class BreakIteratorPerfTest {
@Test
@Parameters(method = "getData")
public void timeBreakIterator(Text text) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
BreakIterator it = BreakIterator.getLineInstance(text.mLocale);
it.setText(text.mText);
@@ -179,7 +179,7 @@ public final class BreakIteratorPerfTest {
@Test
@Parameters(method = "getData")
public void timeIcuBreakIterator(Text text) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
android.icu.text.BreakIterator it =
android.icu.text.BreakIterator.getLineInstance(text.mLocale);
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/BulkPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/BulkPerfTest.java
index e4eaf12e9dcb..6df67bccae06 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/BulkPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/BulkPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -39,7 +39,7 @@ import java.util.Collection;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class BulkPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public static Collection<Object[]> getData() {
return Arrays.asList(
@@ -120,7 +120,7 @@ public class BulkPerfTest {
throws Exception {
ByteBuffer src = BulkPerfTest.newBuffer(align, sBuf, size);
ByteBuffer data = BulkPerfTest.newBuffer(align, dBuf, size);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(align ? 0 : 1);
data.position(align ? 0 : 1);
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferPerfTest.java
index 42e3910aab4b..f01ac0247908 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -46,7 +46,7 @@ import java.util.Collection;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class ByteBufferPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public enum MyByteOrder {
BIG(ByteOrder.BIG_ENDIAN),
@@ -121,7 +121,7 @@ public class ByteBufferPerfTest {
public void timeByteBuffer_getByte(
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
for (int i = 0; i < 1024; ++i) {
@@ -136,7 +136,7 @@ public class ByteBufferPerfTest {
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
byte[] dst = new byte[1024];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < 1024; ++i) {
src.position(aligned ? 0 : 1);
@@ -150,7 +150,7 @@ public class ByteBufferPerfTest {
public void timeByteBuffer_getByte_indexed(
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
for (int i = 0; i < 1024; ++i) {
@@ -164,7 +164,7 @@ public class ByteBufferPerfTest {
public void timeByteBuffer_getChar(
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
for (int i = 0; i < 1024; ++i) {
@@ -180,7 +180,7 @@ public class ByteBufferPerfTest {
CharBuffer src =
ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType).asCharBuffer();
char[] dst = new char[1024];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < 1024; ++i) {
src.position(0);
@@ -194,7 +194,7 @@ public class ByteBufferPerfTest {
public void timeByteBuffer_getChar_indexed(
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
for (int i = 0; i < 1024; ++i) {
@@ -208,7 +208,7 @@ public class ByteBufferPerfTest {
public void timeByteBuffer_getDouble(
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
for (int i = 0; i < 1024; ++i) {
@@ -224,7 +224,7 @@ public class ByteBufferPerfTest {
DoubleBuffer src =
ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType).asDoubleBuffer();
double[] dst = new double[1024];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < 1024; ++i) {
src.position(0);
@@ -238,7 +238,7 @@ public class ByteBufferPerfTest {
public void timeByteBuffer_getFloat(
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
for (int i = 0; i < 1024; ++i) {
@@ -254,7 +254,7 @@ public class ByteBufferPerfTest {
FloatBuffer src =
ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType).asFloatBuffer();
float[] dst = new float[1024];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < 1024; ++i) {
src.position(0);
@@ -268,7 +268,7 @@ public class ByteBufferPerfTest {
public void timeByteBuffer_getInt(
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
for (int i = 0; i < 1024; ++i) {
@@ -283,7 +283,7 @@ public class ByteBufferPerfTest {
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
IntBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType).asIntBuffer();
int[] dst = new int[1024];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < 1024; ++i) {
src.position(0);
@@ -297,7 +297,7 @@ public class ByteBufferPerfTest {
public void timeByteBuffer_getLong(
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
for (int i = 0; i < 1024; ++i) {
@@ -313,7 +313,7 @@ public class ByteBufferPerfTest {
LongBuffer src =
ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType).asLongBuffer();
long[] dst = new long[1024];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < 1024; ++i) {
src.position(0);
@@ -327,7 +327,7 @@ public class ByteBufferPerfTest {
public void timeByteBuffer_getShort(
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
for (int i = 0; i < 1024; ++i) {
@@ -343,7 +343,7 @@ public class ByteBufferPerfTest {
ShortBuffer src =
ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType).asShortBuffer();
short[] dst = new short[1024];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < 1024; ++i) {
src.position(0);
@@ -361,7 +361,7 @@ public class ByteBufferPerfTest {
public void timeByteBuffer_putByte(
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(0);
for (int i = 0; i < 1024; ++i) {
@@ -376,7 +376,7 @@ public class ByteBufferPerfTest {
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer dst = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
byte[] src = new byte[1024];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < 1024; ++i) {
dst.position(aligned ? 0 : 1);
@@ -390,7 +390,7 @@ public class ByteBufferPerfTest {
public void timeByteBuffer_putChar(
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
for (int i = 0; i < 1024; ++i) {
@@ -406,7 +406,7 @@ public class ByteBufferPerfTest {
CharBuffer dst =
ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType).asCharBuffer();
char[] src = new char[1024];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < 1024; ++i) {
dst.position(0);
@@ -420,7 +420,7 @@ public class ByteBufferPerfTest {
public void timeByteBuffer_putDouble(
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
for (int i = 0; i < 1024; ++i) {
@@ -436,7 +436,7 @@ public class ByteBufferPerfTest {
DoubleBuffer dst =
ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType).asDoubleBuffer();
double[] src = new double[1024];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < 1024; ++i) {
dst.position(0);
@@ -450,7 +450,7 @@ public class ByteBufferPerfTest {
public void timeByteBuffer_putFloat(
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
for (int i = 0; i < 1024; ++i) {
@@ -466,7 +466,7 @@ public class ByteBufferPerfTest {
FloatBuffer dst =
ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType).asFloatBuffer();
float[] src = new float[1024];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < 1024; ++i) {
dst.position(0);
@@ -480,7 +480,7 @@ public class ByteBufferPerfTest {
public void timeByteBuffer_putInt(
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
for (int i = 0; i < 1024; ++i) {
@@ -495,7 +495,7 @@ public class ByteBufferPerfTest {
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
IntBuffer dst = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType).asIntBuffer();
int[] src = new int[1024];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < 1024; ++i) {
dst.position(0);
@@ -509,7 +509,7 @@ public class ByteBufferPerfTest {
public void timeByteBuffer_putLong(
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
for (int i = 0; i < 1024; ++i) {
@@ -525,7 +525,7 @@ public class ByteBufferPerfTest {
LongBuffer dst =
ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType).asLongBuffer();
long[] src = new long[1024];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < 1024; ++i) {
dst.position(0);
@@ -539,7 +539,7 @@ public class ByteBufferPerfTest {
public void timeByteBuffer_putShort(
MyByteOrder byteOrder, boolean aligned, MyBufferType bufferType) throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
for (int i = 0; i < 1024; ++i) {
@@ -555,7 +555,7 @@ public class ByteBufferPerfTest {
ShortBuffer dst =
ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType).asShortBuffer();
short[] src = new short[1024];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < 1024; ++i) {
dst.position(0);
@@ -566,7 +566,7 @@ public class ByteBufferPerfTest {
@Test
public void time_new_byteArray() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
byte[] bs = new byte[8192];
}
@@ -574,7 +574,7 @@ public class ByteBufferPerfTest {
@Test
public void time_ByteBuffer_allocate() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
ByteBuffer bs = ByteBuffer.allocate(8192);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferScalarVersusVectorPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferScalarVersusVectorPerfTest.java
index 9ee927cfc353..8c318cd0a298 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferScalarVersusVectorPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferScalarVersusVectorPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -35,7 +35,7 @@ import java.util.Collection;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class ByteBufferScalarVersusVectorPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public static Collection<Object[]> getData() {
return Arrays.asList(
@@ -112,7 +112,7 @@ public class ByteBufferScalarVersusVectorPerfTest {
throws Exception {
ByteBuffer src = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
ByteBuffer dst = ByteBufferPerfTest.newBuffer(byteOrder, aligned, bufferType);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(0);
dst.position(0);
@@ -127,7 +127,7 @@ public class ByteBufferScalarVersusVectorPerfTest {
public void timeByteBufferBulkGet(boolean aligned) throws Exception {
ByteBuffer src = ByteBuffer.allocate(aligned ? 8192 : 8192 + 1);
byte[] dst = new byte[8192];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
src.get(dst, 0, dst.length);
@@ -139,7 +139,7 @@ public class ByteBufferScalarVersusVectorPerfTest {
public void timeDirectByteBufferBulkGet(boolean aligned) throws Exception {
ByteBuffer src = ByteBuffer.allocateDirect(aligned ? 8192 : 8192 + 1);
byte[] dst = new byte[8192];
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
src.position(aligned ? 0 : 1);
src.get(dst, 0, dst.length);
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/CharacterPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/CharacterPerfTest.java
index e4a4db739235..12c1f8cca0ec 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/CharacterPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/CharacterPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -38,7 +38,7 @@ import java.util.Collection;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class CharacterPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public static Collection<Object[]> getData() {
return Arrays.asList(
@@ -84,7 +84,7 @@ public class CharacterPerfTest {
public void timeIsSpace(CharacterSet characterSet, Overload overload) {
setUp(characterSet);
boolean fake = false;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
if (overload == Overload.CHAR) {
while (state.keepRunning()) {
for (int ch = 0; ch < 65536; ++ch) {
@@ -104,7 +104,7 @@ public class CharacterPerfTest {
@Parameters(method = "getData")
public void timeDigit(CharacterSet characterSet, Overload overload) {
setUp(characterSet);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
if (overload == Overload.CHAR) {
while (state.keepRunning()) {
for (int ch = 0; ch < 65536; ++ch) {
@@ -124,7 +124,7 @@ public class CharacterPerfTest {
@Parameters(method = "getData")
public void timeGetNumericValue(CharacterSet characterSet, Overload overload) {
setUp(characterSet);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
if (overload == Overload.CHAR) {
while (state.keepRunning()) {
for (int ch = 0; ch < 65536; ++ch) {
@@ -144,7 +144,7 @@ public class CharacterPerfTest {
@Parameters(method = "getData")
public void timeIsDigit(CharacterSet characterSet, Overload overload) {
setUp(characterSet);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
if (overload == Overload.CHAR) {
while (state.keepRunning()) {
for (int ch = 0; ch < 65536; ++ch) {
@@ -164,7 +164,7 @@ public class CharacterPerfTest {
@Parameters(method = "getData")
public void timeIsIdentifierIgnorable(CharacterSet characterSet, Overload overload) {
setUp(characterSet);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
if (overload == Overload.CHAR) {
while (state.keepRunning()) {
for (int ch = 0; ch < 65536; ++ch) {
@@ -184,7 +184,7 @@ public class CharacterPerfTest {
@Parameters(method = "getData")
public void timeIsJavaIdentifierPart(CharacterSet characterSet, Overload overload) {
setUp(characterSet);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
if (overload == Overload.CHAR) {
while (state.keepRunning()) {
for (int ch = 0; ch < 65536; ++ch) {
@@ -204,7 +204,7 @@ public class CharacterPerfTest {
@Parameters(method = "getData")
public void timeIsJavaIdentifierStart(CharacterSet characterSet, Overload overload) {
setUp(characterSet);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
if (overload == Overload.CHAR) {
while (state.keepRunning()) {
for (int ch = 0; ch < 65536; ++ch) {
@@ -224,7 +224,7 @@ public class CharacterPerfTest {
@Parameters(method = "getData")
public void timeIsLetter(CharacterSet characterSet, Overload overload) {
setUp(characterSet);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
if (overload == Overload.CHAR) {
while (state.keepRunning()) {
for (int ch = 0; ch < 65536; ++ch) {
@@ -244,7 +244,7 @@ public class CharacterPerfTest {
@Parameters(method = "getData")
public void timeIsLetterOrDigit(CharacterSet characterSet, Overload overload) {
setUp(characterSet);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
if (overload == Overload.CHAR) {
while (state.keepRunning()) {
for (int ch = 0; ch < 65536; ++ch) {
@@ -264,7 +264,7 @@ public class CharacterPerfTest {
@Parameters(method = "getData")
public void timeIsLowerCase(CharacterSet characterSet, Overload overload) {
setUp(characterSet);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
if (overload == Overload.CHAR) {
while (state.keepRunning()) {
for (int ch = 0; ch < 65536; ++ch) {
@@ -284,7 +284,7 @@ public class CharacterPerfTest {
@Parameters(method = "getData")
public void timeIsSpaceChar(CharacterSet characterSet, Overload overload) {
setUp(characterSet);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
if (overload == Overload.CHAR) {
while (state.keepRunning()) {
for (int ch = 0; ch < 65536; ++ch) {
@@ -304,7 +304,7 @@ public class CharacterPerfTest {
@Parameters(method = "getData")
public void timeIsUpperCase(CharacterSet characterSet, Overload overload) {
setUp(characterSet);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
if (overload == Overload.CHAR) {
while (state.keepRunning()) {
for (int ch = 0; ch < 65536; ++ch) {
@@ -324,7 +324,7 @@ public class CharacterPerfTest {
@Parameters(method = "getData")
public void timeIsWhitespace(CharacterSet characterSet, Overload overload) {
setUp(characterSet);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
if (overload == Overload.CHAR) {
while (state.keepRunning()) {
for (int ch = 0; ch < 65536; ++ch) {
@@ -344,7 +344,7 @@ public class CharacterPerfTest {
@Parameters(method = "getData")
public void timeToLowerCase(CharacterSet characterSet, Overload overload) {
setUp(characterSet);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
if (overload == Overload.CHAR) {
while (state.keepRunning()) {
for (int ch = 0; ch < 65536; ++ch) {
@@ -364,7 +364,7 @@ public class CharacterPerfTest {
@Parameters(method = "getData")
public void timeToUpperCase(CharacterSet characterSet, Overload overload) {
setUp(characterSet);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
if (overload == Overload.CHAR) {
while (state.keepRunning()) {
for (int ch = 0; ch < 65536; ++ch) {
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/CharsetForNamePerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/CharsetForNamePerfTest.java
index 858c101fc33e..4dd890ad2a45 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/CharsetForNamePerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/CharsetForNamePerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -33,7 +33,7 @@ import java.nio.charset.Charset;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class CharsetForNamePerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public static String[] charsetNames() {
return new String[] {
@@ -52,7 +52,7 @@ public class CharsetForNamePerfTest {
@Test
@Parameters(method = "charsetNames")
public void timeCharsetForName(String charsetName) throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Charset.forName(charsetName);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/CharsetPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/CharsetPerfTest.java
index a2fb7d7f83d8..3a71ce9692bd 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/CharsetPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/CharsetPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -34,7 +34,7 @@ import java.util.Collection;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class CharsetPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public static Collection<Object[]> getData() {
return Arrays.asList(
@@ -91,7 +91,7 @@ public class CharsetPerfTest {
@Parameters(method = "getData")
public void time_new_String_BString(int length, String name) throws Exception {
byte[] bytes = makeBytes(makeString(length));
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new String(bytes, name);
}
@@ -101,7 +101,7 @@ public class CharsetPerfTest {
@Parameters(method = "getData")
public void time_new_String_BII(int length, String name) throws Exception {
byte[] bytes = makeBytes(makeString(length));
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new String(bytes, 0, bytes.length);
}
@@ -111,7 +111,7 @@ public class CharsetPerfTest {
@Parameters(method = "getData")
public void time_new_String_BIIString(int length, String name) throws Exception {
byte[] bytes = makeBytes(makeString(length));
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new String(bytes, 0, bytes.length, name);
}
@@ -121,7 +121,7 @@ public class CharsetPerfTest {
@Parameters(method = "getData")
public void time_String_getBytes(int length, String name) throws Exception {
String string = makeString(length);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
string.getBytes(name);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/CharsetUtf8PerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/CharsetUtf8PerfTest.java
index 2047444a7f52..6c30a163f519 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/CharsetUtf8PerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/CharsetUtf8PerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
import android.icu.lang.UCharacter;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -35,7 +35,7 @@ import java.nio.charset.Charset;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class CharsetUtf8PerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private void makeUnicodeRange(int startingCodePoint, int endingCodePoint) {
StringBuilder builder = new StringBuilder();
@@ -46,7 +46,7 @@ public class CharsetUtf8PerfTest {
}
String str = builder.toString();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder builder2 = new StringBuilder();
builder2.append(str);
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ChecksumPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ChecksumPerfTest.java
index 4ce8b41de403..dcdfd371e7f6 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/ChecksumPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/ChecksumPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -32,13 +32,13 @@ import java.util.zip.CRC32;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ChecksumPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeAdler_block() throws Exception {
byte[] bytes = new byte[10000];
Adler32 adler = new Adler32();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
adler.update(bytes);
}
@@ -47,7 +47,7 @@ public class ChecksumPerfTest {
@Test
public void timeAdler_byte() throws Exception {
Adler32 adler = new Adler32();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
adler.update(1);
}
@@ -57,7 +57,7 @@ public class ChecksumPerfTest {
public void timeCrc_block() throws Exception {
byte[] bytes = new byte[10000];
CRC32 crc = new CRC32();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
crc.update(bytes);
}
@@ -66,7 +66,7 @@ public class ChecksumPerfTest {
@Test
public void timeCrc_byte() throws Exception {
CRC32 crc = new CRC32();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
crc.update(1);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/CipherInputStreamPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/CipherInputStreamPerfTest.java
index 6a7ec1ad62e9..6c175b191429 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/CipherInputStreamPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/CipherInputStreamPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -41,7 +41,7 @@ import javax.crypto.spec.IvParameterSpec;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class CipherInputStreamPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private static final int DATA_SIZE = 1024 * 1024;
private static final byte[] DATA = new byte[DATA_SIZE];
@@ -80,7 +80,7 @@ public class CipherInputStreamPerfTest {
@Test
public void timeEncrypt() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mCipherEncrypt.init(Cipher.ENCRYPT_MODE, mKey, mSpec);
InputStream is = new CipherInputStream(new ByteArrayInputStream(DATA), mCipherEncrypt);
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/CipherPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/CipherPerfTest.java
index 238c028fa0cf..136822ec7002 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/CipherPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/CipherPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -47,7 +47,7 @@ import javax.crypto.spec.IvParameterSpec;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class CipherPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public static Collection getCases() {
int[] keySizes = new int[] {128, 192, 256};
@@ -180,7 +180,7 @@ public class CipherPerfTest {
Mode mode, Padding padding, int keySize, int inputSize, Implementation implementation)
throws Exception {
setUp(mode, padding, keySize, implementation);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mCipherEncrypt.doFinal(DATA, 0, inputSize, mOutput);
}
@@ -192,7 +192,7 @@ public class CipherPerfTest {
Mode mode, Padding padding, int keySize, int inputSize, Implementation implementation)
throws Exception {
setUp(mode, padding, keySize, implementation);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mCipherDecrypt.doFinal(DATA, 0, inputSize, mOutput);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/CollatorPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/CollatorPerfTest.java
index 7e5566055fb4..9efb7ce7c2d0 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/CollatorPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/CollatorPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -33,7 +33,7 @@ import java.util.Locale;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class CollatorPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private static final RuleBasedCollator COLLATOR =
(RuleBasedCollator) Collator.getInstance(Locale.US);
@@ -41,7 +41,7 @@ public class CollatorPerfTest {
@Test
public void timeCollatorPrimary() {
COLLATOR.setStrength(Collator.PRIMARY);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
COLLATOR.compare("abcde", "abcdf");
COLLATOR.compare("abcde", "abcde");
@@ -52,7 +52,7 @@ public class CollatorPerfTest {
@Test
public void timeCollatorSecondary() {
COLLATOR.setStrength(Collator.SECONDARY);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
COLLATOR.compare("abcdÂ", "abcdÄ");
COLLATOR.compare("abcdÂ", "abcdÂ");
@@ -63,7 +63,7 @@ public class CollatorPerfTest {
@Test
public void timeCollatorTertiary() {
COLLATOR.setStrength(Collator.TERTIARY);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
COLLATOR.compare("abcdE", "abcde");
COLLATOR.compare("abcde", "abcde");
@@ -74,7 +74,7 @@ public class CollatorPerfTest {
@Test
public void timeCollatorIdentical() {
COLLATOR.setStrength(Collator.IDENTICAL);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
COLLATOR.compare("abcdȪ", "abcdȫ");
COLLATOR.compare("abcdȪ", "abcdȪ");
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/CollectionsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/CollectionsPerfTest.java
index 100798a7957b..4e5ceaf12403 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/CollectionsPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/CollectionsPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -40,7 +40,7 @@ import java.util.Vector;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class CollectionsPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public static Collection<Object[]> getData() {
return Arrays.asList(new Object[][] {{4}, {16}, {64}, {256}, {1024}});
@@ -60,7 +60,7 @@ public class CollectionsPerfTest {
@Parameters(method = "getData")
public void timeSort_arrayList(int arrayListLength) throws Exception {
List<Integer> input = buildList(arrayListLength, ArrayList.class);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Collections.sort(input);
}
@@ -70,7 +70,7 @@ public class CollectionsPerfTest {
@Parameters(method = "getData")
public void timeSortWithComparator_arrayList(int arrayListLength) throws Exception {
List<Integer> input = buildList(arrayListLength, ArrayList.class);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Collections.sort(input, REVERSE);
}
@@ -80,7 +80,7 @@ public class CollectionsPerfTest {
@Parameters(method = "getData")
public void timeSort_vector(int arrayListLength) throws Exception {
List<Integer> input = buildList(arrayListLength, Vector.class);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Collections.sort(input);
}
@@ -90,7 +90,7 @@ public class CollectionsPerfTest {
@Parameters(method = "getData")
public void timeSortWithComparator_vector(int arrayListLength) throws Exception {
List<Integer> input = buildList(arrayListLength, Vector.class);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Collections.sort(input, REVERSE);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/DateFormatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/DateFormatPerfTest.java
index b6784a8d3867..b0ccd9925d83 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/DateFormatPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/DateFormatPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -33,7 +33,7 @@ import java.util.Locale;
@RunWith(AndroidJUnit4.class)
@LargeTest
public final class DateFormatPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private Locale mLocale1;
private Locale mLocale2;
@@ -50,7 +50,7 @@ public final class DateFormatPerfTest {
@Test
public void timeGetDateTimeInstance() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
DateFormat.getDateTimeInstance();
}
@@ -58,7 +58,7 @@ public final class DateFormatPerfTest {
@Test
public void timeGetDateTimeInstance_multiple() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, mLocale1);
DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, mLocale2);
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatPerfTest.java
index 52f98738481f..3a2f6fab5460 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -34,7 +34,7 @@ import java.util.Locale;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class DecimalFormatPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private static final String EXP_PATTERN = "##E0";
@@ -58,7 +58,7 @@ public class DecimalFormatPerfTest {
public void formatWithGrouping(Object obj) {
DF.setGroupingSize(3);
DF.setGroupingUsed(true);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
DF.format(obj);
}
@@ -66,21 +66,21 @@ public class DecimalFormatPerfTest {
public void format(String pattern, Object obj) {
PATTERN_INSTANCE.applyPattern(pattern);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
PATTERN_INSTANCE.format(obj);
}
}
public void format(Object obj) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
DF.format(obj);
}
}
public void formatToCharacterIterator(Object obj) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
DF.formatToCharacterIterator(obj);
}
@@ -88,14 +88,14 @@ public class DecimalFormatPerfTest {
public void formatCurrencyUS(Object obj) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
DF_CURRENCY_US.format(obj);
}
}
public void formatCurrencyFR(Object obj) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
DF_CURRENCY_FR.format(obj);
}
@@ -213,7 +213,7 @@ public class DecimalFormatPerfTest {
@Test
public void time_instantiation() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new DecimalFormat();
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatSymbolsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatSymbolsPerfTest.java
index 610542061107..4bc550ebb9f1 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatSymbolsPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatSymbolsPerfTest.java
@@ -15,8 +15,8 @@
*/
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -31,13 +31,13 @@ import java.util.Locale;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class DecimalFormatSymbolsPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private static Locale sLocale = Locale.getDefault(Locale.Category.FORMAT);
@Test
public void time_instantiation() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new DecimalFormatSymbols(sLocale);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/DefaultCharsetPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/DefaultCharsetPerfTest.java
index fae74a5e8620..597447bef90e 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/DefaultCharsetPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/DefaultCharsetPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -31,11 +31,11 @@ import java.nio.charset.Charset;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class DefaultCharsetPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void time_defaultCharset() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Charset.defaultCharset();
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/DnsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/DnsPerfTest.java
index 2915363786f3..b17d0f4194d8 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/DnsPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/DnsPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -32,7 +32,7 @@ import java.net.UnknownHostException;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class DnsPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeDns() throws Exception {
@@ -53,7 +53,7 @@ public class DnsPerfTest {
"www.cnn.com",
"bad.host.mtv.corp.google.com",
};
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
int i = 0;
while (state.keepRunning()) {
try {
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/DoPrivilegedPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/DoPrivilegedPerfTest.java
index dd7e5cc1057b..4c8a8eaea8c6 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/DoPrivilegedPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/DoPrivilegedPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -32,11 +32,11 @@ import java.security.PrivilegedAction;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class DoPrivilegedPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeDirect() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
String lineSeparator = System.getProperty("line.separator");
}
@@ -44,7 +44,7 @@ public class DoPrivilegedPerfTest {
@Test
public void timeFastAndSlow() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
String lineSeparator;
if (System.getSecurityManager() == null) {
@@ -61,7 +61,7 @@ public class DoPrivilegedPerfTest {
@Test
public void timeNewAction() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
String lineSeparator = AccessController.doPrivileged(new PrivilegedAction<String>() {
public String run() {
@@ -74,7 +74,7 @@ public class DoPrivilegedPerfTest {
@Test
public void timeReusedAction() throws Exception {
final PrivilegedAction<String> action = new ReusableAction("line.separator");
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
String lineSeparator = AccessController.doPrivileged(action);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/DoublePerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/DoublePerfTest.java
index e034a47e79d2..4ff65b197947 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/DoublePerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/DoublePerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -29,7 +29,7 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class DoublePerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private double mD = 1.2;
private long mL = 4608083138725491507L;
@@ -37,7 +37,7 @@ public class DoublePerfTest {
@Test
public void timeDoubleToLongBits() {
long result = 123;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Double.doubleToLongBits(mD);
}
@@ -49,7 +49,7 @@ public class DoublePerfTest {
@Test
public void timeDoubleToRawLongBits() {
long result = 123;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Double.doubleToRawLongBits(mD);
}
@@ -61,7 +61,7 @@ public class DoublePerfTest {
@Test
public void timeLongBitsToDouble() {
double result = 123.0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Double.longBitsToDouble(mL);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/EqualsHashCodePerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/EqualsHashCodePerfTest.java
index fe1b599cc5ad..aacdcee13e8d 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/EqualsHashCodePerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/EqualsHashCodePerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -37,7 +37,7 @@ import java.util.List;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public final class EqualsHashCodePerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private enum Type {
URI() {
@@ -82,7 +82,7 @@ public final class EqualsHashCodePerfTest {
mA2 = type.newInstance("https://mail.google.com/mail/u/0/?shva=1#inbox");
mB1 = type.newInstance("http://developer.android.com/reference/java/net/URI.html");
mB2 = type.newInstance("http://developer.android.com/reference/java/net/URI.html");
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mA1.equals(mB1);
mA1.equals(mA2);
@@ -95,7 +95,7 @@ public final class EqualsHashCodePerfTest {
public void timeHashCode(Type type) throws Exception {
mA1 = type.newInstance("https://mail.google.com/mail/u/0/?shva=1#inbox");
mB1 = type.newInstance("http://developer.android.com/reference/java/net/URI.html");
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mA1.hashCode();
mB1.hashCode();
@@ -112,7 +112,7 @@ public final class EqualsHashCodePerfTest {
"http://developer.android.com/query?q="
+ QUERY.substring(0, QUERY.length() - 3)
+ "%AF");
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mC1.equals(mC2);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java
index ecbfc7169945..9a6864ea5f66 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -41,11 +41,11 @@ import java.util.Locale;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ExpensiveObjectsPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeNewDateFormatTimeInstance() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT);
df.format(System.currentTimeMillis());
@@ -55,7 +55,7 @@ public class ExpensiveObjectsPerfTest {
@Test(timeout = 900000)
public void timeClonedDateFormatTimeInstance() {
DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
((DateFormat) df.clone()).format(System.currentTimeMillis());
}
@@ -64,7 +64,7 @@ public class ExpensiveObjectsPerfTest {
@Test
public void timeReusedDateFormatTimeInstance() {
DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
synchronized (df) {
df.format(System.currentTimeMillis());
@@ -74,7 +74,7 @@ public class ExpensiveObjectsPerfTest {
@Test(timeout = 900000)
public void timeNewCollator() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Collator.getInstance(Locale.US);
}
@@ -83,7 +83,7 @@ public class ExpensiveObjectsPerfTest {
@Test
public void timeClonedCollator() {
Collator c = Collator.getInstance(Locale.US);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
c.clone();
}
@@ -91,7 +91,7 @@ public class ExpensiveObjectsPerfTest {
@Test
public void timeNewDateFormatSymbols() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new DateFormatSymbols(Locale.US);
}
@@ -100,7 +100,7 @@ public class ExpensiveObjectsPerfTest {
@Test
public void timeClonedDateFormatSymbols() {
DateFormatSymbols dfs = new DateFormatSymbols(Locale.US);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
dfs.clone();
}
@@ -108,7 +108,7 @@ public class ExpensiveObjectsPerfTest {
@Test
public void timeNewDecimalFormatSymbols() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new DecimalFormatSymbols(Locale.US);
}
@@ -117,7 +117,7 @@ public class ExpensiveObjectsPerfTest {
@Test
public void timeClonedDecimalFormatSymbols() {
DecimalFormatSymbols dfs = new DecimalFormatSymbols(Locale.US);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
dfs.clone();
}
@@ -125,7 +125,7 @@ public class ExpensiveObjectsPerfTest {
@Test
public void timeNewNumberFormat() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
NumberFormat.getInstance(Locale.US);
}
@@ -134,7 +134,7 @@ public class ExpensiveObjectsPerfTest {
@Test
public void timeClonedNumberFormat() {
NumberFormat nf = NumberFormat.getInstance(Locale.US);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
nf.clone();
}
@@ -142,7 +142,7 @@ public class ExpensiveObjectsPerfTest {
@Test
public void timeLongToString() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Long.toString(1024L);
}
@@ -151,7 +151,7 @@ public class ExpensiveObjectsPerfTest {
@Test
public void timeNumberFormatTrivialFormatDouble() {
NumberFormat nf = NumberFormat.getInstance(Locale.US);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
nf.format(1024.0);
}
@@ -159,7 +159,7 @@ public class ExpensiveObjectsPerfTest {
@Test
public void timeNewSimpleDateFormat() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new SimpleDateFormat();
}
@@ -167,7 +167,7 @@ public class ExpensiveObjectsPerfTest {
@Test
public void timeNewGregorianCalendar() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new GregorianCalendar();
}
@@ -176,7 +176,7 @@ public class ExpensiveObjectsPerfTest {
@Test
public void timeClonedGregorianCalendar() {
GregorianCalendar gc = new GregorianCalendar();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
gc.clone();
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/FilePerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/FilePerfTest.java
index 0c14d64c27a9..cef7e8c739d7 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/FilePerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/FilePerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -31,11 +31,11 @@ import java.io.File;
@RunWith(AndroidJUnit4.class)
@LargeTest
public final class FilePerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeFileCreationWithEmptyChild() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new File("/foo", "/");
}
@@ -43,7 +43,7 @@ public final class FilePerfTest {
@Test
public void timeFileCreationWithNormalizationNecessary() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new File("/foo//bar//baz//bag", "/baz/");
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/FloatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/FloatPerfTest.java
index 7d7d83b3fdbf..645c02357970 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/FloatPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/FloatPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -29,7 +29,7 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class FloatPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private float mFloat = 1.2f;
private int mInt = 1067030938;
@@ -37,7 +37,7 @@ public class FloatPerfTest {
@Test
public void timeFloatToIntBits() {
int result = 123;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Float.floatToIntBits(mFloat);
}
@@ -49,7 +49,7 @@ public class FloatPerfTest {
@Test
public void timeFloatToRawIntBits() {
int result = 123;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Float.floatToRawIntBits(mFloat);
}
@@ -61,7 +61,7 @@ public class FloatPerfTest {
@Test
public void timeIntBitsToFloat() {
float result = 123.0f;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Float.intBitsToFloat(mInt);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/FormatterPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/FormatterPerfTest.java
index 08dda5314eac..cf76137d5ec3 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/FormatterPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/FormatterPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -35,11 +35,11 @@ import java.util.Locale;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class FormatterPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeFormatter_NoFormatting() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Formatter f = new Formatter();
f.format("this is a reasonably short string that doesn't actually need any formatting");
@@ -48,7 +48,7 @@ public class FormatterPerfTest {
@Test
public void timeStringBuilder_NoFormatting() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
sb.append("this is a reasonably short string that doesn't actually need formatting");
@@ -58,7 +58,7 @@ public class FormatterPerfTest {
@Test
public void timeFormatter_OneInt() {
Integer value = Integer.valueOf(1024); // We're not trying to benchmark boxing here.
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Formatter f = new Formatter();
f.format("this is a reasonably short string that has an int %d in it", value);
@@ -69,7 +69,7 @@ public class FormatterPerfTest {
public void timeFormatter_OneIntArabic() {
Locale arabic = new Locale("ar");
Integer value = Integer.valueOf(1024); // We're not trying to benchmark boxing here.
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Formatter f = new Formatter();
f.format(arabic, "this is a reasonably short string that has an int %d in it", value);
@@ -78,7 +78,7 @@ public class FormatterPerfTest {
@Test
public void timeStringBuilder_OneInt() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
sb.append("this is a reasonably short string that has an int ");
@@ -90,7 +90,7 @@ public class FormatterPerfTest {
@Test
public void timeFormatter_OneHexInt() {
Integer value = Integer.valueOf(1024); // We're not trying to benchmark boxing here.
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Formatter f = new Formatter();
f.format("this is a reasonably short string that has an int %x in it", value);
@@ -99,7 +99,7 @@ public class FormatterPerfTest {
@Test
public void timeStringBuilder_OneHexInt() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
sb.append("this is a reasonably short string that has an int ");
@@ -111,7 +111,7 @@ public class FormatterPerfTest {
@Test
public void timeFormatter_OneFloat() {
Float value = Float.valueOf(10.24f); // We're not trying to benchmark boxing here.
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Formatter f = new Formatter();
f.format("this is a reasonably short string that has a float %f in it", value);
@@ -121,7 +121,7 @@ public class FormatterPerfTest {
@Test
public void timeFormatter_OneFloat_dot2f() {
Float value = Float.valueOf(10.24f); // We're not trying to benchmark boxing here.
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Formatter f = new Formatter();
f.format("this is a reasonably short string that has a float %.2f in it", value);
@@ -131,7 +131,7 @@ public class FormatterPerfTest {
@Test
public void timeFormatter_TwoFloats() {
Float value = Float.valueOf(10.24f); // We're not trying to benchmark boxing here.
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Formatter f = new Formatter();
f.format("this is a short string that has two floats %f and %f in it", value, value);
@@ -140,7 +140,7 @@ public class FormatterPerfTest {
@Test
public void timeStringBuilder_OneFloat() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
sb.append("this is a reasonably short string that has a float ");
@@ -151,7 +151,7 @@ public class FormatterPerfTest {
@Test
public void timeFormatter_OneString() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Formatter f = new Formatter();
f.format("this is a reasonably short string that has a string %s in it", "hello");
@@ -160,7 +160,7 @@ public class FormatterPerfTest {
@Test
public void timeStringBuilder_OneString() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
sb.append("this is a reasonably short string that has a string ");
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/IdnPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/IdnPerfTest.java
index a09ad809a6a2..833575afe8dc 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/IdnPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/IdnPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -31,11 +31,11 @@ import java.net.IDN;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class IdnPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeToUnicode() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
IDN.toASCII("fass.de");
IDN.toASCII("faß.de");
@@ -51,7 +51,7 @@ public class IdnPerfTest {
@Test
public void timeToAscii() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
IDN.toUnicode("xn--fss-qla.de");
IDN.toUnicode("xn--n00d.com");
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/IntConstantDivisionPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/IntConstantDivisionPerfTest.java
index be22814ef8f4..1c901c867fe7 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/IntConstantDivisionPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/IntConstantDivisionPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -29,12 +29,12 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class IntConstantDivisionPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeDivideIntByConstant2() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result /= 2;
}
@@ -43,7 +43,7 @@ public class IntConstantDivisionPerfTest {
@Test
public void timeDivideIntByConstant8() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result /= 8;
}
@@ -52,7 +52,7 @@ public class IntConstantDivisionPerfTest {
@Test
public void timeDivideIntByConstant10() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result /= 10;
}
@@ -61,7 +61,7 @@ public class IntConstantDivisionPerfTest {
@Test
public void timeDivideIntByConstant100() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result /= 100;
}
@@ -70,7 +70,7 @@ public class IntConstantDivisionPerfTest {
@Test
public void timeDivideIntByConstant100_HandOptimized() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = (int) ((0x51eb851fL * result) >>> 37);
}
@@ -79,7 +79,7 @@ public class IntConstantDivisionPerfTest {
@Test
public void timeDivideIntByConstant2048() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result /= 2048;
}
@@ -89,7 +89,7 @@ public class IntConstantDivisionPerfTest {
public void timeDivideIntByVariable2() {
int result = 1;
int factor = 2;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result /= factor;
}
@@ -99,7 +99,7 @@ public class IntConstantDivisionPerfTest {
public void timeDivideIntByVariable10() {
int result = 1;
int factor = 10;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result /= factor;
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/IntConstantMultiplicationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/IntConstantMultiplicationPerfTest.java
index 4337c903ecd6..3d3af4cdb04c 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/IntConstantMultiplicationPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/IntConstantMultiplicationPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -29,12 +29,12 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class IntConstantMultiplicationPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeMultiplyIntByConstant6() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result *= 6;
}
@@ -43,7 +43,7 @@ public class IntConstantMultiplicationPerfTest {
@Test
public void timeMultiplyIntByConstant7() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result *= 7;
}
@@ -52,7 +52,7 @@ public class IntConstantMultiplicationPerfTest {
@Test
public void timeMultiplyIntByConstant8() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result *= 8;
}
@@ -61,7 +61,7 @@ public class IntConstantMultiplicationPerfTest {
@Test
public void timeMultiplyIntByConstant8_Shift() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result <<= 3;
}
@@ -70,7 +70,7 @@ public class IntConstantMultiplicationPerfTest {
@Test
public void timeMultiplyIntByConstant10() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result *= 10;
}
@@ -79,7 +79,7 @@ public class IntConstantMultiplicationPerfTest {
@Test
public void timeMultiplyIntByConstant10_Shift() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = (result + (result << 2)) << 1;
}
@@ -88,7 +88,7 @@ public class IntConstantMultiplicationPerfTest {
@Test
public void timeMultiplyIntByConstant2047() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result *= 2047;
}
@@ -97,7 +97,7 @@ public class IntConstantMultiplicationPerfTest {
@Test
public void timeMultiplyIntByConstant2048() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result *= 2048;
}
@@ -106,7 +106,7 @@ public class IntConstantMultiplicationPerfTest {
@Test
public void timeMultiplyIntByConstant2049() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result *= 2049;
}
@@ -116,7 +116,7 @@ public class IntConstantMultiplicationPerfTest {
public void timeMultiplyIntByVariable10() {
int result = 1;
int factor = 10;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result *= factor;
}
@@ -126,7 +126,7 @@ public class IntConstantMultiplicationPerfTest {
public void timeMultiplyIntByVariable8() {
int result = 1;
int factor = 8;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result *= factor;
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/IntConstantRemainderPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/IntConstantRemainderPerfTest.java
index 1b6c5026e1f6..7c86633accdc 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/IntConstantRemainderPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/IntConstantRemainderPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -29,12 +29,12 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class IntConstantRemainderPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeRemainderIntByConstant2() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result %= 2;
}
@@ -43,7 +43,7 @@ public class IntConstantRemainderPerfTest {
@Test
public void timeRemainderIntByConstant8() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result %= 8;
}
@@ -52,7 +52,7 @@ public class IntConstantRemainderPerfTest {
@Test
public void timeRemainderIntByConstant10() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result %= 10;
}
@@ -61,7 +61,7 @@ public class IntConstantRemainderPerfTest {
@Test
public void timeRemainderIntByConstant100() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result %= 100;
}
@@ -70,7 +70,7 @@ public class IntConstantRemainderPerfTest {
@Test
public void timeRemainderIntByConstant2048() {
int result = 1;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result %= 2048;
}
@@ -80,7 +80,7 @@ public class IntConstantRemainderPerfTest {
public void timeRemainderIntByVariable2() {
int result = 1;
int factor = 2;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result %= factor;
}
@@ -90,7 +90,7 @@ public class IntConstantRemainderPerfTest {
public void timeRemainderIntByVariable10() {
int result = 1;
int factor = 10;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result %= factor;
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/IntegerPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/IntegerPerfTest.java
index 170bb58c46ed..e2a9dcc8f93d 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/IntegerPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/IntegerPerfTest.java
@@ -16,20 +16,20 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import org.junit.Rule;
import org.junit.Test;
public class IntegerPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeLongSignumBranch() {
int t = 0;
int i = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
t += signum1(-(++i));
t += signum1(0);
@@ -41,7 +41,7 @@ public class IntegerPerfTest {
public void timeLongSignumBranchFree() {
int t = 0;
int i = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
t += signum2(-(++i));
t += signum2(0);
@@ -61,7 +61,7 @@ public class IntegerPerfTest {
public void timeLongBitCount_BitSet() {
int t = 0;
int i = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
t += pop((long) ++i);
}
@@ -89,7 +89,7 @@ public class IntegerPerfTest {
public void timeLongBitCount_2Int() {
int t = 0;
int i = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
t += pop2((long) ++i);
}
@@ -105,7 +105,7 @@ public class IntegerPerfTest {
public void timeLongBitCount_Long() {
int t = 0;
int i = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
t += Long.bitCount((long) ++i);
}
@@ -140,7 +140,7 @@ public class IntegerPerfTest {
public void timeNumberOfTrailingZerosHD() {
int t = 0;
int i = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
t += numberOfTrailingZerosHD(++i);
}
@@ -150,7 +150,7 @@ public class IntegerPerfTest {
public void timeNumberOfTrailingZerosOL() {
int t = 0;
int i = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
t += numberOfTrailingZerosOL(++i);
}
@@ -163,7 +163,7 @@ public class IntegerPerfTest {
"0", "1", "12", "123", "1234", "12345", "123456", "1234567", "12345678"
};
int t = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int j = 0; j < intStrings.length; ++j) {
t += Integer.valueOf(intStrings[j]);
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/IntegralToStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/IntegralToStringPerfTest.java
index 0aa854ecfa80..669bfbfb2b8d 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/IntegralToStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/IntegralToStringPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -29,7 +29,7 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class IntegralToStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private static final int SMALL = 12;
private static final int MEDIUM = 12345;
@@ -37,7 +37,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToString_small() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toString(SMALL);
}
@@ -45,7 +45,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToString_medium() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toString(MEDIUM);
}
@@ -53,7 +53,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToString_large() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toString(LARGE);
}
@@ -61,7 +61,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToString2_small() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toString(SMALL, 2);
}
@@ -69,7 +69,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToString2_medium() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toString(MEDIUM, 2);
}
@@ -77,7 +77,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToString2_large() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toString(LARGE, 2);
}
@@ -85,7 +85,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToString10_small() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toString(SMALL, 10);
}
@@ -93,7 +93,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToString10_medium() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toString(MEDIUM, 10);
}
@@ -101,7 +101,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToString10_large() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toString(LARGE, 10);
}
@@ -109,7 +109,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToString16_small() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toString(SMALL, 16);
}
@@ -117,7 +117,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToString16_medium() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toString(MEDIUM, 16);
}
@@ -125,7 +125,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToString16_large() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toString(LARGE, 16);
}
@@ -133,7 +133,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToBinaryString_small() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toBinaryString(SMALL);
}
@@ -141,7 +141,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToBinaryString_medium() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toBinaryString(MEDIUM);
}
@@ -149,7 +149,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToBinaryString_large() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toBinaryString(LARGE);
}
@@ -157,7 +157,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToHexString_small() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toHexString(SMALL);
}
@@ -165,7 +165,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToHexString_medium() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toHexString(MEDIUM);
}
@@ -173,7 +173,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_IntegerToHexString_large() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Integer.toHexString(LARGE);
}
@@ -181,7 +181,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_StringBuilder_small() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new StringBuilder().append(SMALL);
}
@@ -189,7 +189,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_StringBuilder_medium() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new StringBuilder().append(MEDIUM);
}
@@ -197,7 +197,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_StringBuilder_large() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new StringBuilder().append(LARGE);
}
@@ -205,7 +205,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_Formatter_small() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
String.format("%d", SMALL);
}
@@ -213,7 +213,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_Formatter_medium() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
String.format("%d", MEDIUM);
}
@@ -221,7 +221,7 @@ public class IntegralToStringPerfTest {
@Test
public void time_Formatter_large() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
String.format("%d", LARGE);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/KeyPairGeneratorPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/KeyPairGeneratorPerfTest.java
index 9b3d7a044720..cda8512ad6af 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/KeyPairGeneratorPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/KeyPairGeneratorPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -36,7 +36,7 @@ import java.util.Collection;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class KeyPairGeneratorPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public static Collection<Object[]> getData() {
return Arrays.asList(
@@ -78,7 +78,7 @@ public class KeyPairGeneratorPerfTest {
@Parameters(method = "getData")
public void time(Algorithm algorithm, Implementation implementation) throws Exception {
setUp(algorithm, implementation);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
KeyPair keyPair = mGenerator.generateKeyPair();
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/LoopingBackwardsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/LoopingBackwardsPerfTest.java
index 1a9e19aeb78d..8b062d390dbb 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/LoopingBackwardsPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/LoopingBackwardsPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -39,7 +39,7 @@ import java.util.Collection;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class LoopingBackwardsPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public static Collection<Object[]> getData() {
return Arrays.asList(new Object[][] {{2}, {20}, {2000}, {20000000}});
@@ -49,7 +49,7 @@ public class LoopingBackwardsPerfTest {
@Parameters(method = "getData")
public void timeForwards(int max) {
int fake = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int j = 0; j < max; j++) {
fake += j;
@@ -61,7 +61,7 @@ public class LoopingBackwardsPerfTest {
@Parameters(method = "getData")
public void timeBackwards(int max) {
int fake = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int j = max - 1; j >= 0; j--) {
fake += j;
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/MathPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/MathPerfTest.java
index a8a704c09d6d..bcf556c26716 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/MathPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/MathPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -33,7 +33,7 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class MathPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private final double mDouble = 1.2;
private final float mFloat = 1.2f;
@@ -48,7 +48,7 @@ public class MathPerfTest {
@Test
public void timeAbsD() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.abs(mDouble);
}
@@ -57,7 +57,7 @@ public class MathPerfTest {
@Test
public void timeAbsF() {
float result = mFloat;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.abs(mFloat);
}
@@ -66,7 +66,7 @@ public class MathPerfTest {
@Test
public void timeAbsI() {
int result = mInt;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.abs(mInt);
}
@@ -75,7 +75,7 @@ public class MathPerfTest {
@Test
public void timeAbsL() {
long result = mLong;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.abs(mLong);
}
@@ -84,7 +84,7 @@ public class MathPerfTest {
@Test
public void timeAcos() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.acos(mDouble);
}
@@ -93,7 +93,7 @@ public class MathPerfTest {
@Test
public void timeAsin() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.asin(mDouble);
}
@@ -102,7 +102,7 @@ public class MathPerfTest {
@Test
public void timeAtan() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.atan(mDouble);
}
@@ -111,7 +111,7 @@ public class MathPerfTest {
@Test
public void timeAtan2() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.atan2(3, 4);
}
@@ -120,7 +120,7 @@ public class MathPerfTest {
@Test
public void timeCbrt() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.cbrt(mDouble);
}
@@ -129,7 +129,7 @@ public class MathPerfTest {
@Test
public void timeCeil() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.ceil(mDouble);
}
@@ -138,7 +138,7 @@ public class MathPerfTest {
@Test
public void timeCopySignD() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.copySign(mDouble, mDouble);
}
@@ -147,7 +147,7 @@ public class MathPerfTest {
@Test
public void timeCopySignF() {
float result = mFloat;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.copySign(mFloat, mFloat);
}
@@ -156,7 +156,7 @@ public class MathPerfTest {
@Test
public void timeCopySignD_strict() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = StrictMath.copySign(mDouble, mDouble);
}
@@ -165,7 +165,7 @@ public class MathPerfTest {
@Test
public void timeCopySignF_strict() {
float result = mFloat;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = StrictMath.copySign(mFloat, mFloat);
}
@@ -174,7 +174,7 @@ public class MathPerfTest {
@Test
public void timeCos() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.cos(mDouble);
}
@@ -183,7 +183,7 @@ public class MathPerfTest {
@Test
public void timeCosh() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.cosh(mDouble);
}
@@ -192,7 +192,7 @@ public class MathPerfTest {
@Test
public void timeExp() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.exp(mDouble);
}
@@ -201,7 +201,7 @@ public class MathPerfTest {
@Test
public void timeExpm1() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.expm1(mDouble);
}
@@ -210,7 +210,7 @@ public class MathPerfTest {
@Test
public void timeFloor() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.floor(mDouble);
}
@@ -219,7 +219,7 @@ public class MathPerfTest {
@Test
public void timeGetExponentD() {
int result = mInt;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.getExponent(mDouble);
}
@@ -228,7 +228,7 @@ public class MathPerfTest {
@Test
public void timeGetExponentF() {
int result = mInt;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.getExponent(mFloat);
}
@@ -237,7 +237,7 @@ public class MathPerfTest {
@Test
public void timeHypot() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.hypot(mDouble, mDouble);
}
@@ -246,7 +246,7 @@ public class MathPerfTest {
@Test
public void timeIEEEremainder() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.IEEEremainder(mDouble, mDouble);
}
@@ -255,7 +255,7 @@ public class MathPerfTest {
@Test
public void timeLog() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.log(mDouble);
}
@@ -264,7 +264,7 @@ public class MathPerfTest {
@Test
public void timeLog10() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.log10(mDouble);
}
@@ -273,7 +273,7 @@ public class MathPerfTest {
@Test
public void timeLog1p() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.log1p(mDouble);
}
@@ -282,7 +282,7 @@ public class MathPerfTest {
@Test
public void timeMaxD() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.max(mDouble, mDouble);
}
@@ -291,7 +291,7 @@ public class MathPerfTest {
@Test
public void timeMaxF() {
float result = mFloat;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.max(mFloat, mFloat);
}
@@ -300,7 +300,7 @@ public class MathPerfTest {
@Test
public void timeMaxI() {
int result = mInt;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.max(mInt, mInt);
}
@@ -309,7 +309,7 @@ public class MathPerfTest {
@Test
public void timeMaxL() {
long result = mLong;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.max(mLong, mLong);
}
@@ -318,7 +318,7 @@ public class MathPerfTest {
@Test
public void timeMinD() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.min(mDouble, mDouble);
}
@@ -327,7 +327,7 @@ public class MathPerfTest {
@Test
public void timeMinF() {
float result = mFloat;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.min(mFloat, mFloat);
}
@@ -336,7 +336,7 @@ public class MathPerfTest {
@Test
public void timeMinI() {
int result = mInt;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.min(mInt, mInt);
}
@@ -345,7 +345,7 @@ public class MathPerfTest {
@Test
public void timeMinL() {
long result = mLong;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.min(mLong, mLong);
}
@@ -354,7 +354,7 @@ public class MathPerfTest {
@Test
public void timeNextAfterD() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.nextAfter(mDouble, mDouble);
}
@@ -363,7 +363,7 @@ public class MathPerfTest {
@Test
public void timeNextAfterF() {
float result = mFloat;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.nextAfter(mFloat, mFloat);
}
@@ -372,7 +372,7 @@ public class MathPerfTest {
@Test
public void timeNextUpD() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.nextUp(mDouble);
}
@@ -381,7 +381,7 @@ public class MathPerfTest {
@Test
public void timeNextUpF() {
float result = mFloat;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.nextUp(mFloat);
}
@@ -390,7 +390,7 @@ public class MathPerfTest {
@Test
public void timePow() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.pow(mDouble, mDouble);
}
@@ -399,7 +399,7 @@ public class MathPerfTest {
@Test
public void timeRandom() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.random();
}
@@ -408,7 +408,7 @@ public class MathPerfTest {
@Test
public void timeRint() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.rint(mDouble);
}
@@ -417,7 +417,7 @@ public class MathPerfTest {
@Test
public void timeRoundD() {
long result = mLong;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.round(mDouble);
}
@@ -426,7 +426,7 @@ public class MathPerfTest {
@Test
public void timeRoundF() {
int result = mInt;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.round(mFloat);
}
@@ -435,7 +435,7 @@ public class MathPerfTest {
@Test
public void timeScalbD() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.scalb(mDouble, 5);
}
@@ -444,7 +444,7 @@ public class MathPerfTest {
@Test
public void timeScalbF() {
float result = mFloat;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.scalb(mFloat, 5);
}
@@ -453,7 +453,7 @@ public class MathPerfTest {
@Test
public void timeSignumD() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.signum(mDouble);
}
@@ -462,7 +462,7 @@ public class MathPerfTest {
@Test
public void timeSignumF() {
float result = mFloat;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.signum(mFloat);
}
@@ -471,7 +471,7 @@ public class MathPerfTest {
@Test
public void timeSin() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.sin(mDouble);
}
@@ -480,7 +480,7 @@ public class MathPerfTest {
@Test
public void timeSinh() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.sinh(mDouble);
}
@@ -489,7 +489,7 @@ public class MathPerfTest {
@Test
public void timeSqrt() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.sqrt(mDouble);
}
@@ -498,7 +498,7 @@ public class MathPerfTest {
@Test
public void timeTan() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.tan(mDouble);
}
@@ -507,7 +507,7 @@ public class MathPerfTest {
@Test
public void timeTanh() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.tanh(mDouble);
}
@@ -516,7 +516,7 @@ public class MathPerfTest {
@Test
public void timeToDegrees() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.toDegrees(mDouble);
}
@@ -525,7 +525,7 @@ public class MathPerfTest {
@Test
public void timeToRadians() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.toRadians(mDouble);
}
@@ -534,7 +534,7 @@ public class MathPerfTest {
@Test
public void timeUlpD() {
double result = mDouble;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.ulp(mDouble);
}
@@ -543,7 +543,7 @@ public class MathPerfTest {
@Test
public void timeUlpF() {
float result = mFloat;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result = Math.ulp(mFloat);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/MessageDigestPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/MessageDigestPerfTest.java
index 6da9666db23b..8325dae67797 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/MessageDigestPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/MessageDigestPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -36,7 +36,7 @@ import java.util.Collection;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class MessageDigestPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public static Collection<Object[]> getData() {
return Arrays.asList(
@@ -97,7 +97,7 @@ public class MessageDigestPerfTest {
@Test
@Parameters(method = "getData")
public void time(Algorithm algorithm) throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
MessageDigest digest = MessageDigest.getInstance(algorithm.toString(), mProvider);
digest.update(DATA, 0, DATA_SIZE);
@@ -108,7 +108,7 @@ public class MessageDigestPerfTest {
@Test
@Parameters(method = "getData")
public void timeLargeArray(Algorithm algorithm) throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
MessageDigest digest = MessageDigest.getInstance(algorithm.toString(), mProvider);
digest.update(LARGE_DATA, 0, LARGE_DATA_SIZE);
@@ -119,7 +119,7 @@ public class MessageDigestPerfTest {
@Test
@Parameters(method = "getData")
public void timeSmallChunkOfLargeArray(Algorithm algorithm) throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
MessageDigest digest = MessageDigest.getInstance(algorithm.toString(), mProvider);
digest.update(LARGE_DATA, LARGE_DATA_SIZE / 2, DATA_SIZE);
@@ -130,7 +130,7 @@ public class MessageDigestPerfTest {
@Test
@Parameters(method = "getData")
public void timeSmallByteBuffer(Algorithm algorithm) throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
MessageDigest digest = MessageDigest.getInstance(algorithm.toString(), mProvider);
SMALL_BUFFER.position(0);
@@ -143,7 +143,7 @@ public class MessageDigestPerfTest {
@Test
@Parameters(method = "getData")
public void timeSmallDirectByteBuffer(Algorithm algorithm) throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
MessageDigest digest = MessageDigest.getInstance(algorithm.toString(), mProvider);
SMALL_DIRECT_BUFFER.position(0);
@@ -156,7 +156,7 @@ public class MessageDigestPerfTest {
@Test
@Parameters(method = "getData")
public void timeLargeByteBuffer(Algorithm algorithm) throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
MessageDigest digest = MessageDigest.getInstance(algorithm.toString(), mProvider);
LARGE_BUFFER.position(0);
@@ -169,7 +169,7 @@ public class MessageDigestPerfTest {
@Test
@Parameters(method = "getData")
public void timeLargeDirectByteBuffer(Algorithm algorithm) throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
MessageDigest digest = MessageDigest.getInstance(algorithm.toString(), mProvider);
LARGE_DIRECT_BUFFER.position(0);
@@ -182,7 +182,7 @@ public class MessageDigestPerfTest {
@Test
@Parameters(method = "getData")
public void timeSmallChunkOfLargeByteBuffer(Algorithm algorithm) throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
MessageDigest digest = MessageDigest.getInstance(algorithm.toString(), mProvider);
LARGE_BUFFER.position(LARGE_BUFFER.capacity() / 2);
@@ -195,7 +195,7 @@ public class MessageDigestPerfTest {
@Test
@Parameters(method = "getData")
public void timeSmallChunkOfLargeDirectByteBuffer(Algorithm algorithm) throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
MessageDigest digest = MessageDigest.getInstance(algorithm.toString(), mProvider);
LARGE_DIRECT_BUFFER.position(LARGE_DIRECT_BUFFER.capacity() / 2);
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/MutableIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/MutableIntPerfTest.java
index 060d18fb3de3..266d42cba6f0 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/MutableIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/MutableIntPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -35,7 +35,7 @@ import java.util.concurrent.atomic.AtomicInteger;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public final class MutableIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
enum Kind {
ARRAY() {
@@ -105,21 +105,21 @@ public final class MutableIntPerfTest {
@Test
@Parameters(method = "getData")
public void timeCreate(Kind kind) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
kind.timeCreate(state);
}
@Test
@Parameters(method = "getData")
public void timeIncrement(Kind kind) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
kind.timeIncrement(state);
}
@Test
@Parameters(method = "getData")
public void timeGet(Kind kind) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
kind.timeGet(state);
}
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/NumberFormatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/NumberFormatPerfTest.java
index 7cb3b2283779..c2f84fb71405 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/NumberFormatPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/NumberFormatPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -32,13 +32,13 @@ import java.util.Locale;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class NumberFormatPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private static Locale sLocale = Locale.getDefault(Locale.Category.FORMAT);
@Test
public void time_instantiation() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
NumberFormat.getInstance(sLocale);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/NumberFormatTrivialFormatLongPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/NumberFormatTrivialFormatLongPerfTest.java
index 272b45a3affe..cdf0911c74ab 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/NumberFormatTrivialFormatLongPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/NumberFormatTrivialFormatLongPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -36,12 +36,12 @@ import java.util.Locale;
@LargeTest
public class NumberFormatTrivialFormatLongPerfTest {
@Rule
- public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeNumberFormatTrivialFormatLong() {
NumberFormat nf = NumberFormat.getInstance(Locale.US);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
nf.format(1024L);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/PriorityQueuePerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/PriorityQueuePerfTest.java
index c3a09662fd1f..51f47bb60ac7 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/PriorityQueuePerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/PriorityQueuePerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -39,7 +39,7 @@ import java.util.Random;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class PriorityQueuePerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public static Collection<Object[]> getData() {
return Arrays.asList(
@@ -108,7 +108,7 @@ public class PriorityQueuePerfTest {
// At most allow the queue to empty 10%.
int resizingThreshold = queueSize / 10;
int i = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
// Reset queue every so often. This will be called more often for smaller
// queueSizes, but since a copy is linear, it will also cost proportionally
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/PropertyAccessPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/PropertyAccessPerfTest.java
index 2ac56bed1910..1f20cae0c162 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/PropertyAccessPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/PropertyAccessPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -33,7 +33,7 @@ import java.lang.reflect.Method;
@RunWith(AndroidJUnit4.class)
@LargeTest
public final class PropertyAccessPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private View mView = new View();
private Method mSetX;
@@ -50,7 +50,7 @@ public final class PropertyAccessPerfTest {
@Test
public void timeDirectSetter() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mView.mSetX(0.1f);
}
@@ -58,7 +58,7 @@ public final class PropertyAccessPerfTest {
@Test
public void timeDirectFieldSet() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mView.mX = 0.1f;
}
@@ -66,7 +66,7 @@ public final class PropertyAccessPerfTest {
@Test
public void timeDirectSetterAndBomXing() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Float value = 0.1f;
mView.mSetX(value);
@@ -75,7 +75,7 @@ public final class PropertyAccessPerfTest {
@Test
public void timeDirectFieldSetAndBomXing() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Float value = 0.1f;
mView.mX = value;
@@ -84,7 +84,7 @@ public final class PropertyAccessPerfTest {
@Test
public void timeReflectionSetterAndTwoBomXes() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mSetX.invoke(mView, 0.1f);
}
@@ -92,7 +92,7 @@ public final class PropertyAccessPerfTest {
@Test
public void timeReflectionSetterAndOneBomX() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mArgsBomX[0] = 0.1f;
mSetX.invoke(mView, mArgsBomX);
@@ -101,7 +101,7 @@ public final class PropertyAccessPerfTest {
@Test
public void timeReflectionFieldSet() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mX.setFloat(mView, 0.1f);
}
@@ -109,7 +109,7 @@ public final class PropertyAccessPerfTest {
@Test
public void timeGeneratedSetter() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mGeneratedSetter.setFloat(mView, 0.1f);
}
@@ -117,7 +117,7 @@ public final class PropertyAccessPerfTest {
@Test
public void timeGeneratedFieldSet() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mGeneratedField.setFloat(mView, 0.1f);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ProviderPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ProviderPerfTest.java
index 7ad0141c8471..0c16265fa6f7 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/ProviderPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/ProviderPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -34,11 +34,11 @@ import javax.crypto.Cipher;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ProviderPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeStableProviders() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Cipher c = Cipher.getInstance("RSA");
}
@@ -46,7 +46,7 @@ public class ProviderPerfTest {
@Test
public void timeWithNewProvider() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Security.addProvider(new MockProvider());
try {
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/RandomPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/RandomPerfTest.java
index c7b6cb5a190c..5f1bfc29129e 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/RandomPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/RandomPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -32,11 +32,11 @@ import java.util.Random;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class RandomPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeNewRandom() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Random rng = new Random();
rng.nextInt();
@@ -46,7 +46,7 @@ public class RandomPerfTest {
@Test
public void timeReusedRandom() throws Exception {
Random rng = new Random();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
rng.nextInt();
}
@@ -55,7 +55,7 @@ public class RandomPerfTest {
@Test
public void timeReusedSecureRandom() throws Exception {
SecureRandom rng = new SecureRandom();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
rng.nextInt();
}
@@ -63,7 +63,7 @@ public class RandomPerfTest {
@Test
public void timeNewSecureRandom() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
SecureRandom rng = new SecureRandom();
rng.nextInt();
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/RealToStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/RealToStringPerfTest.java
index 44e5f227b00a..008c94c52492 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/RealToStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/RealToStringPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -29,7 +29,7 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class RealToStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private static final float SMALL = -123.45f;
private static final float MEDIUM = -123.45e8f;
@@ -37,7 +37,7 @@ public class RealToStringPerfTest {
@Test
public void timeFloat_toString_NaN() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Float.toString(Float.NaN);
}
@@ -45,7 +45,7 @@ public class RealToStringPerfTest {
@Test
public void timeFloat_toString_NEGATIVE_INFINITY() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Float.toString(Float.NEGATIVE_INFINITY);
}
@@ -53,7 +53,7 @@ public class RealToStringPerfTest {
@Test
public void timeFloat_toString_POSITIVE_INFINITY() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Float.toString(Float.POSITIVE_INFINITY);
}
@@ -61,7 +61,7 @@ public class RealToStringPerfTest {
@Test
public void timeFloat_toString_zero() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Float.toString(0.0f);
}
@@ -69,7 +69,7 @@ public class RealToStringPerfTest {
@Test
public void timeFloat_toString_minusZero() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Float.toString(-0.0f);
}
@@ -77,7 +77,7 @@ public class RealToStringPerfTest {
@Test
public void timeFloat_toString_small() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Float.toString(SMALL);
}
@@ -85,7 +85,7 @@ public class RealToStringPerfTest {
@Test
public void timeFloat_toString_medium() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Float.toString(MEDIUM);
}
@@ -93,7 +93,7 @@ public class RealToStringPerfTest {
@Test
public void timeFloat_toString_large() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Float.toString(LARGE);
}
@@ -101,7 +101,7 @@ public class RealToStringPerfTest {
@Test
public void timeStringBuilder_small() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new StringBuilder().append(SMALL);
}
@@ -109,7 +109,7 @@ public class RealToStringPerfTest {
@Test
public void timeStringBuilder_medium() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new StringBuilder().append(MEDIUM);
}
@@ -117,7 +117,7 @@ public class RealToStringPerfTest {
@Test
public void timeStringBuilder_large() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new StringBuilder().append(LARGE);
}
@@ -125,7 +125,7 @@ public class RealToStringPerfTest {
@Test
public void timeFormatter_small() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
String.format("%f", SMALL);
}
@@ -133,7 +133,7 @@ public class RealToStringPerfTest {
@Test
public void timeFormatter_medium() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
String.format("%f", MEDIUM);
}
@@ -141,7 +141,7 @@ public class RealToStringPerfTest {
@Test
public void timeFormatter_large() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
String.format("%f", LARGE);
}
@@ -149,7 +149,7 @@ public class RealToStringPerfTest {
@Test
public void timeFormatter_dot2f_small() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
String.format("%.2f", SMALL);
}
@@ -157,7 +157,7 @@ public class RealToStringPerfTest {
@Test
public void timeFormatter_dot2f_medium() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
String.format("%.2f", MEDIUM);
}
@@ -165,7 +165,7 @@ public class RealToStringPerfTest {
@Test
public void timeFormatter_dot2f_large() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
String.format("%.2f", LARGE);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ReflectionPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ReflectionPerfTest.java
index 6e00b10838a6..45b623d740ee 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/ReflectionPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/ReflectionPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -33,12 +33,12 @@ import java.lang.reflect.Method;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ReflectionPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeObject_getClass() throws Exception {
C c = new C();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
c.getClass();
}
@@ -47,7 +47,7 @@ public class ReflectionPerfTest {
@Test
public void timeClass_getField() throws Exception {
Class<?> klass = C.class;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
klass.getField("f");
}
@@ -56,7 +56,7 @@ public class ReflectionPerfTest {
@Test
public void timeClass_getDeclaredField() throws Exception {
Class<?> klass = C.class;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
klass.getDeclaredField("f");
}
@@ -65,7 +65,7 @@ public class ReflectionPerfTest {
@Test
public void timeClass_getConstructor() throws Exception {
Class<?> klass = C.class;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
klass.getConstructor();
}
@@ -75,7 +75,7 @@ public class ReflectionPerfTest {
public void timeClass_newInstance() throws Exception {
Class<?> klass = C.class;
Constructor constructor = klass.getConstructor();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
constructor.newInstance();
}
@@ -84,7 +84,7 @@ public class ReflectionPerfTest {
@Test
public void timeClass_getMethod() throws Exception {
Class<?> klass = C.class;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
klass.getMethod("m");
}
@@ -93,7 +93,7 @@ public class ReflectionPerfTest {
@Test
public void timeClass_getDeclaredMethod() throws Exception {
Class<?> klass = C.class;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
klass.getDeclaredMethod("m");
}
@@ -104,7 +104,7 @@ public class ReflectionPerfTest {
Class<?> klass = C.class;
Field f = klass.getDeclaredField("f");
C instance = new C();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
f.setInt(instance, 1);
}
@@ -115,7 +115,7 @@ public class ReflectionPerfTest {
Class<?> klass = C.class;
Field f = klass.getDeclaredField("f");
C instance = new C();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
f.getInt(instance);
}
@@ -126,7 +126,7 @@ public class ReflectionPerfTest {
Class<?> klass = C.class;
Method m = klass.getDeclaredMethod("m");
C instance = new C();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
m.invoke(instance);
}
@@ -136,7 +136,7 @@ public class ReflectionPerfTest {
public void timeMethod_invokeStaticV() throws Exception {
Class<?> klass = C.class;
Method m = klass.getDeclaredMethod("sm");
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
m.invoke(null);
}
@@ -147,7 +147,7 @@ public class ReflectionPerfTest {
Class<?> klass = C.class;
Method m = klass.getDeclaredMethod("setField", int.class);
C instance = new C();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
m.invoke(instance, 1);
}
@@ -159,7 +159,7 @@ public class ReflectionPerfTest {
Method m = klass.getDeclaredMethod("setField", int.class);
C instance = new C();
Integer one = Integer.valueOf(1);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
m.invoke(instance, one);
}
@@ -169,7 +169,7 @@ public class ReflectionPerfTest {
public void timeMethod_invokeStaticI() throws Exception {
Class<?> klass = C.class;
Method m = klass.getDeclaredMethod("setStaticField", int.class);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
m.invoke(null, 1);
}
@@ -180,7 +180,7 @@ public class ReflectionPerfTest {
Class<?> klass = C.class;
Method m = klass.getDeclaredMethod("setStaticField", int.class);
Integer one = Integer.valueOf(1);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
m.invoke(null, one);
}
@@ -189,7 +189,7 @@ public class ReflectionPerfTest {
@Test
public void timeRegularMethodInvocation() throws Exception {
C instance = new C();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
instance.setField(1);
}
@@ -197,7 +197,7 @@ public class ReflectionPerfTest {
@Test
public void timeRegularConstructor() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
new C();
}
@@ -206,7 +206,7 @@ public class ReflectionPerfTest {
@Test
public void timeClass_classNewInstance() throws Exception {
Class<?> klass = C.class;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
klass.newInstance();
}
@@ -216,7 +216,7 @@ public class ReflectionPerfTest {
public void timeClass_isInstance() throws Exception {
D d = new D();
Class<?> klass = IC.class;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
klass.isInstance(d);
}
@@ -224,7 +224,7 @@ public class ReflectionPerfTest {
@Test
public void timeGetInstanceField() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
// TODO: Write a test script that generates both the classes we're
// reflecting on and the test case for each of its fields.
@@ -234,7 +234,7 @@ public class ReflectionPerfTest {
@Test
public void timeGetStaticField() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
R.class.getField("WEEK_NUMBER_COLOR");
}
@@ -242,7 +242,7 @@ public class ReflectionPerfTest {
@Test
public void timeGetInterfaceStaticField() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
F.class.getField("SF");
}
@@ -250,7 +250,7 @@ public class ReflectionPerfTest {
@Test
public void timeGetSuperClassField() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
G.class.getField("f");
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/SSLLoopbackPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/SSLLoopbackPerfTest.java
index 5a9b5c36d0d3..da69f9fc9fcf 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/SSLLoopbackPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/SSLLoopbackPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -35,11 +35,11 @@ import javax.net.ssl.SSLSocket;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class SSLLoopbackPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void time() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
TestSSLContext context =
TestSSLContext.create(TestKeyStore.getClient(), TestKeyStore.getServer());
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/SSLSocketFactoryPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/SSLSocketFactoryPerfTest.java
index 6d48cf26c971..9f2c312f33ee 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/SSLSocketFactoryPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/SSLSocketFactoryPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -31,11 +31,11 @@ import javax.net.ssl.SSLSocketFactory;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class SSLSocketFactoryPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void time() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
SSLSocketFactory.getDefault();
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/SchemePrefixPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/SchemePrefixPerfTest.java
index 86416291f26d..7c60c05ef679 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/SchemePrefixPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/SchemePrefixPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -37,7 +37,7 @@ import java.util.regex.Pattern;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public final class SchemePrefixPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
enum Strategy {
JAVA() {
@@ -94,7 +94,7 @@ public final class SchemePrefixPerfTest {
@Test
@Parameters(method = "getData")
public void timeSchemePrefix(Strategy strategy) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
strategy.execute("http://android.com");
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/SerializationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/SerializationPerfTest.java
index afd1191a07fa..181298305cb5 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/SerializationPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/SerializationPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -37,7 +37,7 @@ import java.util.ArrayList;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class SerializationPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private static byte[] bytes(Object o) throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
@@ -110,7 +110,7 @@ public class SerializationPerfTest {
public void timeWriteNoObjects() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
ObjectOutputStream out = new ObjectOutputStream(baos);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
out.reset();
baos.reset();
@@ -121,7 +121,7 @@ public class SerializationPerfTest {
private void readSingleObject(Object object) throws Exception {
byte[] bytes = bytes(object);
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
ObjectInputStream in = new ObjectInputStream(bais);
in.readObject();
@@ -133,7 +133,7 @@ public class SerializationPerfTest {
private void writeSingleObject(Object o) throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
ObjectOutputStream out = new ObjectOutputStream(baos);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
out.writeObject(o);
out.reset();
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/SignaturePerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/SignaturePerfTest.java
index 6c261332aa99..34e9bfb84813 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/SignaturePerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/SignaturePerfTest.java
@@ -15,8 +15,8 @@
*/
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -41,7 +41,7 @@ import java.util.Map;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class SignaturePerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public static Collection<Object[]> getData() {
return Arrays.asList(
@@ -117,7 +117,7 @@ public class SignaturePerfTest {
@Parameters(method = "getData")
public void timeSign(Algorithm algorithm, Implementation implementation) throws Exception {
setUp(algorithm);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Signature signer;
switch (implementation) {
@@ -140,7 +140,7 @@ public class SignaturePerfTest {
@Parameters(method = "getData")
public void timeVerify(Algorithm algorithm, Implementation implementation) throws Exception {
setUp(algorithm);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Signature verifier;
switch (implementation) {
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/SimpleDateFormatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/SimpleDateFormatPerfTest.java
index 274b51f6fae4..2fe67985d205 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/SimpleDateFormatPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/SimpleDateFormatPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -37,11 +37,11 @@ import java.util.Date;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class SimpleDateFormatPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void time_createFormatWithTimeZone() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd z");
}
@@ -50,7 +50,7 @@ public class SimpleDateFormatPerfTest {
@Test
public void time_parseWithTimeZoneShort() throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd z");
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
sdf.parse("2000.01.01 PST");
}
@@ -59,7 +59,7 @@ public class SimpleDateFormatPerfTest {
@Test
public void time_parseWithTimeZoneLong() throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd zzzz");
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
sdf.parse("2000.01.01 Pacific Standard Time");
}
@@ -68,7 +68,7 @@ public class SimpleDateFormatPerfTest {
@Test
public void time_parseWithoutTimeZone() throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
sdf.parse("2000.01.01");
}
@@ -76,7 +76,7 @@ public class SimpleDateFormatPerfTest {
@Test
public void time_createAndParseWithTimeZoneShort() throws ParseException {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd z");
sdf.parse("2000.01.01 PST");
@@ -85,7 +85,7 @@ public class SimpleDateFormatPerfTest {
@Test
public void time_createAndParseWithTimeZoneLong() throws ParseException {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd zzzz");
sdf.parse("2000.01.01 Pacific Standard Time");
@@ -95,7 +95,7 @@ public class SimpleDateFormatPerfTest {
@Test
public void time_formatWithTimeZoneShort() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd z");
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
sdf.format(new Date());
}
@@ -104,7 +104,7 @@ public class SimpleDateFormatPerfTest {
@Test
public void time_formatWithTimeZoneLong() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd zzzz");
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
sdf.format(new Date());
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StrictMathPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StrictMathPerfTest.java
index b4c427beac65..fbe3cefff776 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/StrictMathPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/StrictMathPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -33,7 +33,7 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class StrictMathPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private final double mDouble = 1.2;
private final float mFloat = 1.2f;
@@ -74,7 +74,7 @@ public class StrictMathPerfTest {
@Test
public void timeAbsD() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.abs(mDouble);
}
@@ -82,7 +82,7 @@ public class StrictMathPerfTest {
@Test
public void timeAbsF() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.abs(mFloat);
}
@@ -90,7 +90,7 @@ public class StrictMathPerfTest {
@Test
public void timeAbsI() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.abs(mInt);
}
@@ -98,7 +98,7 @@ public class StrictMathPerfTest {
@Test
public void timeAbsL() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.abs(mLong);
}
@@ -106,7 +106,7 @@ public class StrictMathPerfTest {
@Test
public void timeAcos() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.acos(mDouble);
}
@@ -114,7 +114,7 @@ public class StrictMathPerfTest {
@Test
public void timeAsin() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.asin(mDouble);
}
@@ -122,7 +122,7 @@ public class StrictMathPerfTest {
@Test
public void timeAtan() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.atan(mDouble);
}
@@ -130,7 +130,7 @@ public class StrictMathPerfTest {
@Test
public void timeAtan2() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.atan2(3, 4);
}
@@ -138,7 +138,7 @@ public class StrictMathPerfTest {
@Test
public void timeCbrt() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.cbrt(mDouble);
}
@@ -146,7 +146,7 @@ public class StrictMathPerfTest {
@Test
public void timeCeilOverInterestingValues() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < CEIL_DOUBLES.length; ++i) {
StrictMath.ceil(CEIL_DOUBLES[i]);
@@ -156,7 +156,7 @@ public class StrictMathPerfTest {
@Test
public void timeCopySignD() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.copySign(mDouble, mDouble);
}
@@ -164,7 +164,7 @@ public class StrictMathPerfTest {
@Test
public void timeCopySignF() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.copySign(mFloat, mFloat);
}
@@ -172,7 +172,7 @@ public class StrictMathPerfTest {
@Test
public void timeCos() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.cos(mDouble);
}
@@ -180,7 +180,7 @@ public class StrictMathPerfTest {
@Test
public void timeCosh() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.cosh(mDouble);
}
@@ -188,7 +188,7 @@ public class StrictMathPerfTest {
@Test
public void timeExp() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.exp(mDouble);
}
@@ -196,7 +196,7 @@ public class StrictMathPerfTest {
@Test
public void timeExpm1() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.expm1(mDouble);
}
@@ -204,7 +204,7 @@ public class StrictMathPerfTest {
@Test
public void timeFloorOverInterestingValues() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < FLOOR_DOUBLES.length; ++i) {
StrictMath.floor(FLOOR_DOUBLES[i]);
@@ -214,7 +214,7 @@ public class StrictMathPerfTest {
@Test
public void timeGetExponentD() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.getExponent(mDouble);
}
@@ -222,7 +222,7 @@ public class StrictMathPerfTest {
@Test
public void timeGetExponentF() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.getExponent(mFloat);
}
@@ -230,7 +230,7 @@ public class StrictMathPerfTest {
@Test
public void timeHypot() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.hypot(mDouble, mDouble);
}
@@ -238,7 +238,7 @@ public class StrictMathPerfTest {
@Test
public void timeIEEEremainder() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.IEEEremainder(mDouble, mDouble);
}
@@ -246,7 +246,7 @@ public class StrictMathPerfTest {
@Test
public void timeLog() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.log(mDouble);
}
@@ -254,7 +254,7 @@ public class StrictMathPerfTest {
@Test
public void timeLog10() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.log10(mDouble);
}
@@ -262,7 +262,7 @@ public class StrictMathPerfTest {
@Test
public void timeLog1p() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.log1p(mDouble);
}
@@ -270,7 +270,7 @@ public class StrictMathPerfTest {
@Test
public void timeMaxD() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.max(mDouble, mDouble);
}
@@ -278,7 +278,7 @@ public class StrictMathPerfTest {
@Test
public void timeMaxF() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.max(mFloat, mFloat);
}
@@ -286,7 +286,7 @@ public class StrictMathPerfTest {
@Test
public void timeMaxI() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.max(mInt, mInt);
}
@@ -294,7 +294,7 @@ public class StrictMathPerfTest {
@Test
public void timeMaxL() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.max(mLong, mLong);
}
@@ -302,7 +302,7 @@ public class StrictMathPerfTest {
@Test
public void timeMinD() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.min(mDouble, mDouble);
}
@@ -310,7 +310,7 @@ public class StrictMathPerfTest {
@Test
public void timeMinF() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.min(mFloat, mFloat);
}
@@ -318,7 +318,7 @@ public class StrictMathPerfTest {
@Test
public void timeMinI() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.min(mInt, mInt);
}
@@ -326,7 +326,7 @@ public class StrictMathPerfTest {
@Test
public void timeMinL() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.min(mLong, mLong);
}
@@ -334,7 +334,7 @@ public class StrictMathPerfTest {
@Test
public void timeNextAfterD() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.nextAfter(mDouble, mDouble);
}
@@ -342,7 +342,7 @@ public class StrictMathPerfTest {
@Test
public void timeNextAfterF() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.nextAfter(mFloat, mFloat);
}
@@ -350,7 +350,7 @@ public class StrictMathPerfTest {
@Test
public void timeNextUpD() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.nextUp(mDouble);
}
@@ -358,7 +358,7 @@ public class StrictMathPerfTest {
@Test
public void timeNextUpF() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.nextUp(mFloat);
}
@@ -366,7 +366,7 @@ public class StrictMathPerfTest {
@Test
public void timePow() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.pow(mDouble, mDouble);
}
@@ -374,7 +374,7 @@ public class StrictMathPerfTest {
@Test
public void timeRandom() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.random();
}
@@ -382,7 +382,7 @@ public class StrictMathPerfTest {
@Test
public void timeRint() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.rint(mDouble);
}
@@ -390,7 +390,7 @@ public class StrictMathPerfTest {
@Test
public void timeRoundD() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.round(mDouble);
}
@@ -398,7 +398,7 @@ public class StrictMathPerfTest {
@Test
public void timeRoundF() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.round(mFloat);
}
@@ -406,7 +406,7 @@ public class StrictMathPerfTest {
@Test
public void timeScalbD() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.scalb(mDouble, 5);
}
@@ -414,7 +414,7 @@ public class StrictMathPerfTest {
@Test
public void timeScalbF() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.scalb(mFloat, 5);
}
@@ -422,7 +422,7 @@ public class StrictMathPerfTest {
@Test
public void timeSignumD() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.signum(mDouble);
}
@@ -430,7 +430,7 @@ public class StrictMathPerfTest {
@Test
public void timeSignumF() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.signum(mFloat);
}
@@ -438,7 +438,7 @@ public class StrictMathPerfTest {
@Test
public void timeSin() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.sin(mDouble);
}
@@ -446,7 +446,7 @@ public class StrictMathPerfTest {
@Test
public void timeSinh() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.sinh(mDouble);
}
@@ -454,7 +454,7 @@ public class StrictMathPerfTest {
@Test
public void timeSqrt() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.sqrt(mDouble);
}
@@ -462,7 +462,7 @@ public class StrictMathPerfTest {
@Test
public void timeTan() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.tan(mDouble);
}
@@ -470,7 +470,7 @@ public class StrictMathPerfTest {
@Test
public void timeTanh() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.tanh(mDouble);
}
@@ -478,7 +478,7 @@ public class StrictMathPerfTest {
@Test
public void timeToDegrees() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.toDegrees(mDouble);
}
@@ -486,7 +486,7 @@ public class StrictMathPerfTest {
@Test
public void timeToRadians() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.toRadians(mDouble);
}
@@ -494,7 +494,7 @@ public class StrictMathPerfTest {
@Test
public void timeUlpD() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.ulp(mDouble);
}
@@ -502,7 +502,7 @@ public class StrictMathPerfTest {
@Test
public void timeUlpF() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StrictMath.ulp(mFloat);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringBuilderPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringBuilderPerfTest.java
index 2235cc5611a4..0155154037df 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/StringBuilderPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/StringBuilderPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -30,13 +30,13 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class StringBuilderPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public int mLength = 100;
@Test
public void timeAppendBoolean() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < mLength; ++j) {
@@ -47,7 +47,7 @@ public class StringBuilderPerfTest {
@Test
public void timeAppendChar() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < mLength; ++j) {
@@ -59,7 +59,7 @@ public class StringBuilderPerfTest {
@Test
public void timeAppendCharArray() {
char[] chars = "chars".toCharArray();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < mLength; ++j) {
@@ -71,7 +71,7 @@ public class StringBuilderPerfTest {
@Test
public void timeAppendCharSequence() {
CharSequence cs = "chars";
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < mLength; ++j) {
@@ -83,7 +83,7 @@ public class StringBuilderPerfTest {
@Test
public void timeAppendSubCharSequence() {
CharSequence cs = "chars";
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < mLength; ++j) {
@@ -95,7 +95,7 @@ public class StringBuilderPerfTest {
@Test
public void timeAppendDouble() {
double d = 1.2;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < mLength; ++j) {
@@ -107,7 +107,7 @@ public class StringBuilderPerfTest {
@Test
public void timeAppendFloat() {
float f = 1.2f;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < mLength; ++j) {
@@ -119,7 +119,7 @@ public class StringBuilderPerfTest {
@Test
public void timeAppendInt() {
int n = 123;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < mLength; ++j) {
@@ -131,7 +131,7 @@ public class StringBuilderPerfTest {
@Test
public void timeAppendLong() {
long l = 123;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < mLength; ++j) {
@@ -150,7 +150,7 @@ public class StringBuilderPerfTest {
return "constant";
}
};
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < mLength; ++j) {
@@ -162,7 +162,7 @@ public class StringBuilderPerfTest {
@Test
public void timeAppendString() {
String s = "chars";
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
StringBuilder sb = new StringBuilder();
for (int j = 0; j < mLength; ++j) {
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringEqualsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringEqualsPerfTest.java
index 9ab50005e62a..55337452611b 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/StringEqualsPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/StringEqualsPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -38,7 +38,7 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class StringEqualsPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private final String mLong1 =
"Ahead-of-time compilation is possible as the compiler may just convert an instruction"
@@ -226,7 +226,7 @@ public class StringEqualsPerfTest {
// Benchmark cases of String.equals(null)
@Test
public void timeEqualsNull() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < mMediumStrings.length; i++) {
mMediumStrings[i][0].equals(null);
@@ -237,7 +237,7 @@ public class StringEqualsPerfTest {
// Benchmark cases with very short (<5 character) Strings
@Test
public void timeEqualsShort() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < mShortStrings.length; i++) {
mShortStrings[i][0].equals(mShortStrings[i][1]);
@@ -248,7 +248,7 @@ public class StringEqualsPerfTest {
// Benchmark cases with medium length (10-15 character) Strings
@Test
public void timeEqualsMedium() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < mMediumStrings.length; i++) {
mMediumStrings[i][0].equals(mMediumStrings[i][1]);
@@ -259,7 +259,7 @@ public class StringEqualsPerfTest {
// Benchmark cases with long (>100 character) Strings
@Test
public void timeEqualsLong() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < mLongStrings.length; i++) {
mLongStrings[i][0].equals(mLongStrings[i][1]);
@@ -270,7 +270,7 @@ public class StringEqualsPerfTest {
// Benchmark cases with very long (>1000 character) Strings
@Test
public void timeEqualsVeryLong() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < mVeryLongStrings.length; i++) {
mVeryLongStrings[i][0].equals(mVeryLongStrings[i][1]);
@@ -281,7 +281,7 @@ public class StringEqualsPerfTest {
// Benchmark cases with non-word aligned Strings
@Test
public void timeEqualsNonWordAligned() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < mNonalignedStrings.length; i++) {
mNonalignedStrings[i][0].equals(mNonalignedStrings[i][1]);
@@ -292,7 +292,7 @@ public class StringEqualsPerfTest {
// Benchmark cases with slight differences in the endings
@Test
public void timeEqualsEnd() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < mEndStrings.length; i++) {
mEndStrings[i][0].equals(mEndStrings[i][1]);
@@ -303,7 +303,7 @@ public class StringEqualsPerfTest {
// Benchmark cases of comparing a string to a non-string object
@Test
public void timeEqualsNonString() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
for (int i = 0; i < mMediumStrings.length; i++) {
mMediumStrings[i][0].equals(mObjects[i]);
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringIsEmptyPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringIsEmptyPerfTest.java
index b1e749cc538c..a5662b0a33bd 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/StringIsEmptyPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/StringIsEmptyPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -29,12 +29,12 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class StringIsEmptyPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeIsEmpty_NonEmpty() {
boolean result = true;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result &= !("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".isEmpty());
}
@@ -44,7 +44,7 @@ public class StringIsEmptyPerfTest {
@Test
public void timeIsEmpty_Empty() {
boolean result = true;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result &= ("".isEmpty());
}
@@ -54,7 +54,7 @@ public class StringIsEmptyPerfTest {
@Test
public void timeLengthEqualsZero() {
boolean result = true;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result &= !("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".length() == 0);
}
@@ -64,7 +64,7 @@ public class StringIsEmptyPerfTest {
@Test
public void timeEqualsEmpty() {
boolean result = true;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
result &= !"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".equals("");
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringLengthPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringLengthPerfTest.java
index 9e5759171a6f..41e64f2810c3 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/StringLengthPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/StringLengthPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -29,12 +29,12 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class StringLengthPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeLength() {
int length = 0;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
length = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".length();
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringPerfTest.java
index a80514c72e95..2cd2a0976451 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/StringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/StringPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -34,7 +34,7 @@ import java.util.Collection;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class StringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
enum StringLengths {
EMPTY(""),
@@ -69,7 +69,7 @@ public class StringPerfTest {
@Test
@Parameters(method = "getData")
public void timeHashCode(StringLengths stringLengths) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
stringLengths.mValue.hashCode();
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringReplaceAllPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringReplaceAllPerfTest.java
index 78ae3952719b..219dccf6901b 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/StringReplaceAllPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/StringReplaceAllPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -34,7 +34,7 @@ import java.util.Collection;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class StringReplaceAllPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
// NOTE: These estimates of MOVEABLE / NON_MOVEABLE are based on a knowledge of
// ART implementation details. They make a difference here because JNI calls related
@@ -86,7 +86,7 @@ public class StringReplaceAllPerfTest {
@Test
@Parameters(method = "getData")
public void timeReplaceAllTrivialPatternNonExistent(StringLengths stringLengths) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
stringLengths.mValue.replaceAll("fish", "0");
}
@@ -95,7 +95,7 @@ public class StringReplaceAllPerfTest {
@Test
@Parameters(method = "getData")
public void timeReplaceTrivialPatternAllRepeated(StringLengths stringLengths) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
stringLengths.mValue.replaceAll("jklm", "0");
}
@@ -104,7 +104,7 @@ public class StringReplaceAllPerfTest {
@Test
@Parameters(method = "getData")
public void timeReplaceAllTrivialPatternSingleOccurrence(StringLengths stringLengths) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
stringLengths.mValue.replaceAll("qrst", "0");
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringReplacePerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringReplacePerfTest.java
index 73911c71c351..d6fef5ed84e7 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/StringReplacePerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/StringReplacePerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -34,7 +34,7 @@ import java.util.Collection;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class StringReplacePerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
enum StringLengths {
EMPTY(""),
@@ -80,7 +80,7 @@ public class StringReplacePerfTest {
@Test
@Parameters(method = "getData")
public void timeReplaceCharNonExistent(StringLengths stringLengths) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
stringLengths.mValue.replace('z', '0');
}
@@ -89,7 +89,7 @@ public class StringReplacePerfTest {
@Test
@Parameters(method = "getData")
public void timeReplaceCharRepeated(StringLengths stringLengths) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
stringLengths.mValue.replace('a', '0');
}
@@ -98,7 +98,7 @@ public class StringReplacePerfTest {
@Test
@Parameters(method = "getData")
public void timeReplaceSingleChar(StringLengths stringLengths) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
stringLengths.mValue.replace('q', '0');
}
@@ -107,7 +107,7 @@ public class StringReplacePerfTest {
@Test
@Parameters(method = "getData")
public void timeReplaceSequenceNonExistent(StringLengths stringLengths) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
stringLengths.mValue.replace("fish", "0");
}
@@ -116,7 +116,7 @@ public class StringReplacePerfTest {
@Test
@Parameters(method = "getData")
public void timeReplaceSequenceRepeated(StringLengths stringLengths) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
stringLengths.mValue.replace("jklm", "0");
}
@@ -125,7 +125,7 @@ public class StringReplacePerfTest {
@Test
@Parameters(method = "getData")
public void timeReplaceSingleSequence(StringLengths stringLengths) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
stringLengths.mValue.replace("qrst", "0");
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringSplitPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringSplitPerfTest.java
index 1539271c2b3c..9d0ec2f368c9 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/StringSplitPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/StringSplitPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -31,11 +31,11 @@ import java.util.regex.Pattern;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class StringSplitPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeStringSplitComma() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
"this,is,a,simple,example".split(",");
}
@@ -43,7 +43,7 @@ public class StringSplitPerfTest {
@Test
public void timeStringSplitLiteralDot() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
"this.is.a.simple.example".split("\\.");
}
@@ -51,7 +51,7 @@ public class StringSplitPerfTest {
@Test
public void timeStringSplitNewline() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
"this\nis\na\nsimple\nexample\n".split("\n");
}
@@ -60,7 +60,7 @@ public class StringSplitPerfTest {
@Test
public void timePatternSplitComma() {
Pattern p = Pattern.compile(",");
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
p.split("this,is,a,simple,example");
}
@@ -69,7 +69,7 @@ public class StringSplitPerfTest {
@Test
public void timePatternSplitLiteralDot() {
Pattern p = Pattern.compile("\\.");
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
p.split("this.is.a.simple.example");
}
@@ -77,7 +77,7 @@ public class StringSplitPerfTest {
@Test
public void timeStringSplitHard() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
"this,is,a,harder,example".split("[,]");
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringToBytesPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringToBytesPerfTest.java
index 0d5e62b4268c..11950b70ab3d 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/StringToBytesPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/StringToBytesPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -35,7 +35,7 @@ import java.util.Collection;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class StringToBytesPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
enum StringLengths {
EMPTY(""),
@@ -89,7 +89,7 @@ public class StringToBytesPerfTest {
@Test
@Parameters(method = "getData")
public void timeGetBytesUtf8(StringLengths stringLengths) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
stringLengths.mValue.getBytes(StandardCharsets.UTF_8);
}
@@ -98,7 +98,7 @@ public class StringToBytesPerfTest {
@Test
@Parameters(method = "getData")
public void timeGetBytesIso88591(StringLengths stringLengths) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
stringLengths.mValue.getBytes(StandardCharsets.ISO_8859_1);
}
@@ -107,7 +107,7 @@ public class StringToBytesPerfTest {
@Test
@Parameters(method = "getData")
public void timeGetBytesAscii(StringLengths stringLengths) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
stringLengths.mValue.getBytes(StandardCharsets.US_ASCII);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringToRealPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringToRealPerfTest.java
index ecdf809f1610..4b27a16538ab 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/StringToRealPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/StringToRealPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -34,7 +34,7 @@ import java.util.Collection;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class StringToRealPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public static Collection<Object[]> getData() {
return Arrays.asList(
@@ -53,7 +53,7 @@ public class StringToRealPerfTest {
@Test
@Parameters(method = "getData")
public void timeFloat_parseFloat(String string) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Float.parseFloat(string);
}
@@ -62,7 +62,7 @@ public class StringToRealPerfTest {
@Test
@Parameters(method = "getData")
public void timeDouble_parseDouble(String string) {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
Double.parseDouble(string);
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ThreadLocalPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ThreadLocalPerfTest.java
index 2b2a6b5727de..0ab012dc2871 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/ThreadLocalPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/ThreadLocalPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -29,7 +29,7 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ThreadLocalPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
private static final ThreadLocal<char[]> BUFFER =
new ThreadLocal<char[]>() {
@@ -41,7 +41,7 @@ public class ThreadLocalPerfTest {
@Test
public void timeThreadLocal_get() {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
BUFFER.get();
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/TimeZonePerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/TimeZonePerfTest.java
index 6eb8fccf5b2a..ddf410eccbcb 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/TimeZonePerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/TimeZonePerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
@@ -31,11 +31,11 @@ import java.util.TimeZone;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class TimeZonePerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
@Test
public void timeTimeZone_getDefault() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
TimeZone.getDefault();
}
@@ -43,7 +43,7 @@ public class TimeZonePerfTest {
@Test
public void timeTimeZone_getTimeZoneUTC() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
TimeZone.getTimeZone("UTC");
}
@@ -52,7 +52,7 @@ public class TimeZonePerfTest {
@Test
public void timeTimeZone_getTimeZone_default() throws Exception {
String defaultId = TimeZone.getDefault().getID();
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
TimeZone.getTimeZone(defaultId);
}
@@ -61,7 +61,7 @@ public class TimeZonePerfTest {
// A time zone with relatively few transitions.
@Test
public void timeTimeZone_getTimeZone_America_Caracas() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
TimeZone.getTimeZone("America/Caracas");
}
@@ -70,7 +70,7 @@ public class TimeZonePerfTest {
// A time zone with a lot of transitions.
@Test
public void timeTimeZone_getTimeZone_America_Santiago() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
TimeZone.getTimeZone("America/Santiago");
}
@@ -78,7 +78,7 @@ public class TimeZonePerfTest {
@Test
public void timeTimeZone_getTimeZone_GMT_plus_10() throws Exception {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
TimeZone.getTimeZone("GMT+10");
}
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/XMLEntitiesPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/XMLEntitiesPerfTest.java
index 288c646ec67d..a38763b6ffad 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/XMLEntitiesPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/XMLEntitiesPerfTest.java
@@ -16,8 +16,8 @@
package android.libcore.regression;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
@@ -42,7 +42,7 @@ import javax.xml.parsers.DocumentBuilderFactory;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public final class XMLEntitiesPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
public static Collection<Object[]> getData() {
return Arrays.asList(
@@ -85,7 +85,7 @@ public final class XMLEntitiesPerfTest {
@Parameters(method = "getData")
public void timeXmlParser(int length, float entityFraction) throws Exception {
setUp(length, entityFraction);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
XmlPullParser parser = mXmlPullParserFactory.newPullParser();
parser.setInput(new StringReader(mXml));
@@ -99,7 +99,7 @@ public final class XMLEntitiesPerfTest {
@Parameters(method = "getData")
public void timeDocumentBuilder(int length, float entityFraction) throws Exception {
setUp(length, entityFraction);
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
DocumentBuilder documentBuilder = mDocumentBuilderFactory.newDocumentBuilder();
documentBuilder.parse(new InputSource(new StringReader(mXml)));
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianIntPerfTest.java
index 003c957d894f..4076c9d18e57 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianIntPerfTest.java
@@ -13,25 +13,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
+
import java.lang.reflect.Field;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ReflectGetFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
Field mField;
int mValue;
@@ -42,7 +47,7 @@ public class ReflectGetFieldLittleEndianIntPerfTest {
@Test
public void run() throws Throwable {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mField.getInt(this);
x = (int) mField.getInt(this);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianStringPerfTest.java
index 4f216181d5e3..2c65dd4a90f3 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianStringPerfTest.java
@@ -13,25 +13,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
+
import java.lang.reflect.Field;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ReflectGetFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
Field mField;
String mValue;
@@ -42,7 +47,7 @@ public class ReflectGetFieldLittleEndianStringPerfTest {
@Test
public void run() throws Throwable {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mField.get(this);
x = (String) mField.get(this);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianIntPerfTest.java
index 210014ad3f6e..dcd25db01f18 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianIntPerfTest.java
@@ -13,25 +13,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
+
import java.lang.reflect.Field;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ReflectGetStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
Field mField;
static int sValue;
@@ -42,7 +47,7 @@ public class ReflectGetStaticFieldLittleEndianIntPerfTest {
@Test
public void run() throws Throwable {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mField.getInt(null);
x = (int) mField.getInt(null);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianStringPerfTest.java
index 22c68273bf12..c938a4cda5a0 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianStringPerfTest.java
@@ -13,25 +13,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
+
import java.lang.reflect.Field;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ReflectGetStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
Field mField;
static String sValue;
@@ -42,7 +47,7 @@ public class ReflectGetStaticFieldLittleEndianStringPerfTest {
@Test
public void run() throws Throwable {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mField.get(null);
x = (String) mField.get(null);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianIntPerfTest.java
index 5b391091253b..618e1b5f5b41 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianIntPerfTest.java
@@ -13,25 +13,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
+
import java.lang.reflect.Field;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ReflectSetFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
Field mField;
int mValue;
@@ -41,7 +46,7 @@ public class ReflectSetFieldLittleEndianIntPerfTest {
@Test
public void run() throws Throwable {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mField.setInt(this, 42);
mField.setInt(this, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianStringPerfTest.java
index 883e8a76586b..8c2e3ca8d586 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianStringPerfTest.java
@@ -13,25 +13,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
+
import java.lang.reflect.Field;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ReflectSetFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
Field mField;
String mValue;
@@ -41,7 +46,7 @@ public class ReflectSetFieldLittleEndianStringPerfTest {
@Test
public void run() throws Throwable {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mField.set(this, "qwerty");
mField.set(this, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianIntPerfTest.java
index 50bc85c31280..e888cc68d471 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianIntPerfTest.java
@@ -13,25 +13,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
+
import java.lang.reflect.Field;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ReflectSetStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
Field mField;
static int sValue;
@@ -41,7 +46,7 @@ public class ReflectSetStaticFieldLittleEndianIntPerfTest {
@Test
public void run() throws Throwable {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mField.setInt(null, 42);
mField.setInt(null, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianStringPerfTest.java
index 13fa2bf7d230..7016611a1b1d 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianStringPerfTest.java
@@ -13,25 +13,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
+
import java.lang.reflect.Field;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ReflectSetStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
Field mField;
static String sValue;
@@ -41,7 +46,7 @@ public class ReflectSetStaticFieldLittleEndianStringPerfTest {
@Test
public void run() throws Throwable {
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mField.set(null, "qwerty");
mField.set(null, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianIntPerfTest.java
index 85c9bae9a9d9..65c82cca87be 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleCompareandexchangeAcquireFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleCompareandexchangeAcquireFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.compareAndExchangeAcquire(this, mField, ~42);
x = (int) mVh.compareAndExchangeAcquire(this, mField, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianStringPerfTest.java
index 2b8f430440f5..a350b61da20b 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleCompareandexchangeAcquireFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleCompareandexchangeAcquireFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.compareAndExchangeAcquire(this, mField, null);
x = (String) mVh.compareAndExchangeAcquire(this, mField, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianIntPerfTest.java
index 246fa43d0dca..34f596eea6aa 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleCompareandexchangeAcquireStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleCompareandexchangeAcquireStaticFieldLittleEndianIntPerfTes
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.compareAndExchangeAcquire(sField, ~42);
x = (int) mVh.compareAndExchangeAcquire(sField, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianStringPerfTest.java
index d12ffae25c5e..2216d7b2a507 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,20 +34,19 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleCompareandexchangeAcquireStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
- public VarHandleCompareandexchangeAcquireStaticFieldLittleEndianStringPerfTest()
- throws Throwable {
+ public VarHandleCompareandexchangeAcquireStaticFieldLittleEndianStringPerfTest() throws Throwable {
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
}
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.compareAndExchangeAcquire(sField, null);
x = (String) mVh.compareAndExchangeAcquire(sField, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianIntPerfTest.java
index 5ced1157cb73..bda551fd9069 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleCompareandexchangeFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleCompareandexchangeFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.compareAndExchange(this, mField, ~42);
x = (int) mVh.compareAndExchange(this, mField, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianStringPerfTest.java
index b955d506fe85..f4d7893a64c2 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleCompareandexchangeFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleCompareandexchangeFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.compareAndExchange(this, mField, null);
x = (String) mVh.compareAndExchange(this, mField, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianIntPerfTest.java
index 601ff3461f5b..f4380870f7fc 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleCompareandexchangeReleaseFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleCompareandexchangeReleaseFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.compareAndExchangeRelease(this, mField, ~42);
x = (int) mVh.compareAndExchangeRelease(this, mField, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianStringPerfTest.java
index 0e567f9568e6..78df5c0eaf07 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleCompareandexchangeReleaseFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleCompareandexchangeReleaseFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.compareAndExchangeRelease(this, mField, null);
x = (String) mVh.compareAndExchangeRelease(this, mField, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianIntPerfTest.java
index 6be287006f42..f45cc6247fc0 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleCompareandexchangeReleaseStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleCompareandexchangeReleaseStaticFieldLittleEndianIntPerfTes
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.compareAndExchangeRelease(sField, ~42);
x = (int) mVh.compareAndExchangeRelease(sField, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianStringPerfTest.java
index 84c186bd24e6..08aa7e254dcb 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,20 +34,19 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleCompareandexchangeReleaseStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
- public VarHandleCompareandexchangeReleaseStaticFieldLittleEndianStringPerfTest()
- throws Throwable {
+ public VarHandleCompareandexchangeReleaseStaticFieldLittleEndianStringPerfTest() throws Throwable {
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
}
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.compareAndExchangeRelease(sField, null);
x = (String) mVh.compareAndExchangeRelease(sField, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianIntPerfTest.java
index b093234b2bc5..5d4b2e0978f3 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleCompareandexchangeStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleCompareandexchangeStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.compareAndExchange(sField, ~42);
x = (int) mVh.compareAndExchange(sField, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianStringPerfTest.java
index 0d2037b4ab27..ba4f2c8a8d7d 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleCompareandexchangeStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleCompareandexchangeStaticFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.compareAndExchange(sField, null);
x = (String) mVh.compareAndExchange(sField, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianIntPerfTest.java
index ee31973c308a..7fca4504b2c6 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleCompareandsetFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleCompareandsetFieldLittleEndianIntPerfTest {
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.compareAndSet(this, mField, ~42);
success = mVh.compareAndSet(this, mField, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianStringPerfTest.java
index 0571fefe2a43..7eb7ac026517 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleCompareandsetFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleCompareandsetFieldLittleEndianStringPerfTest {
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.compareAndSet(this, mField, null);
success = mVh.compareAndSet(this, mField, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianIntPerfTest.java
index f619dabdd50a..ddfd407eda11 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleCompareandsetStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleCompareandsetStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.compareAndSet(sField, ~42);
success = mVh.compareAndSet(sField, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianStringPerfTest.java
index fc443fa362bc..f1f39681dce0 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleCompareandsetStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleCompareandsetStaticFieldLittleEndianStringPerfTest {
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.compareAndSet(sField, null);
success = mVh.compareAndSet(sField, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianIntPerfTest.java
index bf3d58b68692..09127c4eed7b 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetAcquireFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -53,7 +54,7 @@ public class VarHandleGetAcquireFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAcquire(this);
x = (int) mVh.getAcquire(this);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianStringPerfTest.java
index 1f4bc31f24c6..87be4a66aa52 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetAcquireFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -53,7 +54,7 @@ public class VarHandleGetAcquireFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.getAcquire(this);
x = (String) mVh.getAcquire(this);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianIntPerfTest.java
index 2085552e91dd..5d5fc110cbaf 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetAcquireStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -53,7 +54,7 @@ public class VarHandleGetAcquireStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAcquire();
x = (int) mVh.getAcquire();
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianStringPerfTest.java
index d9c7d7b7695e..c7034b80a008 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetAcquireStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
@@ -53,7 +54,7 @@ public class VarHandleGetAcquireStaticFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.getAcquire();
x = (String) mVh.getAcquire();
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianIntPerfTest.java
index acd2533a38e4..f22865b01009 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianIntPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,9 +34,9 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetArrayLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int ELEMENT_VALUE = 42;
- int[] mArray = {ELEMENT_VALUE};
+ int[] mArray = { ELEMENT_VALUE };
VarHandle mVh;
public VarHandleGetArrayLittleEndianIntPerfTest() throws Throwable {
@@ -54,7 +55,7 @@ public class VarHandleGetArrayLittleEndianIntPerfTest {
public void run() {
int[] a = mArray;
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.get(a, 0);
x = (int) mVh.get(a, 0);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianStringPerfTest.java
index de9944a8c274..fdb9e84fa847 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianStringPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,9 +34,9 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetArrayLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String ELEMENT_VALUE = "qwerty";
- String[] mArray = {ELEMENT_VALUE};
+ String[] mArray = { ELEMENT_VALUE };
VarHandle mVh;
public VarHandleGetArrayLittleEndianStringPerfTest() throws Throwable {
@@ -54,7 +55,7 @@ public class VarHandleGetArrayLittleEndianStringPerfTest {
public void run() {
String[] a = mArray;
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.get(a, 0);
x = (String) mVh.get(a, 0);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewBigEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewBigEndianIntPerfTest.java
index a8639292cbb3..347b0cf4effb 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewBigEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewBigEndianIntPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -29,22 +30,22 @@ import org.junit.runner.RunWith;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
+
+import java.util.Arrays;
import java.nio.ByteOrder;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetByteArrayViewBigEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int VALUE = 42;
- byte[] mArray1 = {
- (byte) (VALUE >> 24), (byte) (VALUE >> 16), (byte) (VALUE >> 8), (byte) VALUE
- };
- byte[] mArray2 = {(byte) (-1 >> 24), (byte) (-1 >> 16), (byte) (-1 >> 8), (byte) VALUE};
+ byte[] mArray1 = { (byte) (VALUE >> 24), (byte) (VALUE >> 16), (byte) (VALUE >> 8), (byte) VALUE };
+ byte[] mArray2 = { (byte) (-1 >> 24), (byte) (-1 >> 16), (byte) (-1 >> 8), (byte) VALUE };
VarHandle mVh;
public VarHandleGetByteArrayViewBigEndianIntPerfTest() throws Throwable {
mVh = MethodHandles.byteArrayViewVarHandle(int[].class, ByteOrder.BIG_ENDIAN);
- }
+ }
@Before
public void setup() {
@@ -58,7 +59,7 @@ public class VarHandleGetByteArrayViewBigEndianIntPerfTest {
public void run() {
byte[] a = mArray1;
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.get(a, 0);
x = (int) mVh.get(a, 0);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewLittleEndianIntPerfTest.java
index 4999b9bf6850..dedc94f278bf 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewLittleEndianIntPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -29,22 +30,22 @@ import org.junit.runner.RunWith;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
+
+import java.util.Arrays;
import java.nio.ByteOrder;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetByteArrayViewLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int VALUE = 42;
- byte[] mArray1 = {
- (byte) VALUE, (byte) (VALUE >> 8), (byte) (VALUE >> 16), (byte) (VALUE >> 24)
- };
- byte[] mArray2 = {(byte) VALUE, (byte) (-1 >> 8), (byte) (-1 >> 16), (byte) (-1 >> 24)};
+ byte[] mArray1 = { (byte) VALUE, (byte) (VALUE >> 8), (byte) (VALUE >> 16), (byte) (VALUE >> 24) };
+ byte[] mArray2 = { (byte) VALUE, (byte) (-1 >> 8), (byte) (-1 >> 16), (byte) (-1 >> 24) };
VarHandle mVh;
public VarHandleGetByteArrayViewLittleEndianIntPerfTest() throws Throwable {
mVh = MethodHandles.byteArrayViewVarHandle(int[].class, ByteOrder.LITTLE_ENDIAN);
- }
+ }
@Before
public void setup() {
@@ -58,7 +59,7 @@ public class VarHandleGetByteArrayViewLittleEndianIntPerfTest {
public void run() {
byte[] a = mArray1;
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.get(a, 0);
x = (int) mVh.get(a, 0);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianIntPerfTest.java
index ee80a6f72c93..3f0f624dfccb 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -53,7 +54,7 @@ public class VarHandleGetFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.get(this);
x = (int) mVh.get(this);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianStringPerfTest.java
index ec29f7a33b39..9db6328ea4c5 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -53,7 +54,7 @@ public class VarHandleGetFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.get(this);
x = (String) mVh.get(this);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianIntPerfTest.java
index ee6a669f2f83..17b74a8d807e 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetOpaqueFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -53,7 +54,7 @@ public class VarHandleGetOpaqueFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getOpaque(this);
x = (int) mVh.getOpaque(this);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianStringPerfTest.java
index 1702b84e703b..5df13800365b 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetOpaqueFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -53,7 +54,7 @@ public class VarHandleGetOpaqueFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.getOpaque(this);
x = (String) mVh.getOpaque(this);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianIntPerfTest.java
index 514ddb9c4b11..f656ef239625 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetOpaqueStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -53,7 +54,7 @@ public class VarHandleGetOpaqueStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getOpaque();
x = (int) mVh.getOpaque();
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianStringPerfTest.java
index fbcee6906bd7..1087df3d11c5 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetOpaqueStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
@@ -53,7 +54,7 @@ public class VarHandleGetOpaqueStaticFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.getOpaque();
x = (String) mVh.getOpaque();
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianIntPerfTest.java
index 2c5658810b05..004345187c96 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -53,7 +54,7 @@ public class VarHandleGetStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.get();
x = (int) mVh.get();
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianStringPerfTest.java
index 8fce69e62033..0162637f7a64 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
@@ -53,7 +54,7 @@ public class VarHandleGetStaticFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.get();
x = (String) mVh.get();
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianIntPerfTest.java
index ef530607bb56..b0c4631574e8 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetVolatileFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -53,7 +54,7 @@ public class VarHandleGetVolatileFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getVolatile(this);
x = (int) mVh.getVolatile(this);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianStringPerfTest.java
index 64c08983a063..5cbbc08521ad 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetVolatileFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -53,7 +54,7 @@ public class VarHandleGetVolatileFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.getVolatile(this);
x = (String) mVh.getVolatile(this);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianIntPerfTest.java
index 939100c47c05..368ae69ab8f5 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetVolatileStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -53,7 +54,7 @@ public class VarHandleGetVolatileStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getVolatile();
x = (int) mVh.getVolatile();
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianStringPerfTest.java
index 728b1995ff52..3387a8da60c1 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetVolatileStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
@@ -53,7 +54,7 @@ public class VarHandleGetVolatileStaticFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.getVolatile();
x = (String) mVh.getVolatile();
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianFloatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianFloatPerfTest.java
index bf5ef99ff456..781e04f6b818 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianFloatPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianFloatPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandaddAcquireFieldLittleEndianFloatPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final float FIELD_VALUE = 3.14f;
float mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandaddAcquireFieldLittleEndianFloatPerfTest {
@Test
public void run() {
float x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (float) mVh.getAndAddAcquire(this, 2.17f);
x = (float) mVh.getAndAddAcquire(this, 2.17f);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianIntPerfTest.java
index d15705e9106d..97f29ba38bc1 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandaddAcquireFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandaddAcquireFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndAddAcquire(this, ~42);
x = (int) mVh.getAndAddAcquire(this, ~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianFloatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianFloatPerfTest.java
index 222a60da3550..e108f7f4edbc 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianFloatPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianFloatPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandaddAcquireStaticFieldLittleEndianFloatPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final float FIELD_VALUE = 3.14f;
static float sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandaddAcquireStaticFieldLittleEndianFloatPerfTest {
@Test
public void run() {
float x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (float) mVh.getAndAddAcquire(2.17f);
x = (float) mVh.getAndAddAcquire(2.17f);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianIntPerfTest.java
index 7436476b5329..d0ae322987f3 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandaddAcquireStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandaddAcquireStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndAddAcquire(~42);
x = (int) mVh.getAndAddAcquire(~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianFloatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianFloatPerfTest.java
index cca97f42e4b7..1b80c4064741 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianFloatPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianFloatPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandaddFieldLittleEndianFloatPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final float FIELD_VALUE = 3.14f;
float mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandaddFieldLittleEndianFloatPerfTest {
@Test
public void run() {
float x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (float) mVh.getAndAdd(this, 2.17f);
x = (float) mVh.getAndAdd(this, 2.17f);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianIntPerfTest.java
index 170ee7313891..edacf181149b 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandaddFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandaddFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndAdd(this, ~42);
x = (int) mVh.getAndAdd(this, ~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianFloatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianFloatPerfTest.java
index 184f796ad61c..0e86b0d6f76b 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianFloatPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianFloatPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandaddReleaseFieldLittleEndianFloatPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final float FIELD_VALUE = 3.14f;
float mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandaddReleaseFieldLittleEndianFloatPerfTest {
@Test
public void run() {
float x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (float) mVh.getAndAddRelease(this, 2.17f);
x = (float) mVh.getAndAddRelease(this, 2.17f);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianIntPerfTest.java
index 7e75c44089ff..83446ff85b9a 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandaddReleaseFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandaddReleaseFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndAddRelease(this, ~42);
x = (int) mVh.getAndAddRelease(this, ~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianFloatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianFloatPerfTest.java
index 39c386b645d8..c1f1e6f44c80 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianFloatPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianFloatPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandaddReleaseStaticFieldLittleEndianFloatPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final float FIELD_VALUE = 3.14f;
static float sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandaddReleaseStaticFieldLittleEndianFloatPerfTest {
@Test
public void run() {
float x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (float) mVh.getAndAddRelease(2.17f);
x = (float) mVh.getAndAddRelease(2.17f);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianIntPerfTest.java
index 04ab5310655c..1b154a157622 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandaddReleaseStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandaddReleaseStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndAddRelease(~42);
x = (int) mVh.getAndAddRelease(~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianFloatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianFloatPerfTest.java
index b71351fca81c..7de128d7a5a5 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianFloatPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianFloatPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandaddStaticFieldLittleEndianFloatPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final float FIELD_VALUE = 3.14f;
static float sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandaddStaticFieldLittleEndianFloatPerfTest {
@Test
public void run() {
float x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (float) mVh.getAndAdd(2.17f);
x = (float) mVh.getAndAdd(2.17f);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianIntPerfTest.java
index e3955c051890..c9a0926db637 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandaddStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandaddStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndAdd(~42);
x = (int) mVh.getAndAdd(~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireFieldLittleEndianIntPerfTest.java
index adf05a6befb1..fd9d9b13e9b2 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseAndAcquireFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseAndAcquireFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseAndAcquire(this, ~42);
x = (int) mVh.getAndBitwiseAndAcquire(this, ~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireStaticFieldLittleEndianIntPerfTest.java
index 4d657d9a3511..c3c367f80c26 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseAndAcquireStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseAndAcquireStaticFieldLittleEndianIntPerfTest
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseAndAcquire(~42);
x = (int) mVh.getAndBitwiseAndAcquire(~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndFieldLittleEndianIntPerfTest.java
index dc6417416917..e073d28a820f 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseAndFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseAndFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseAnd(this, ~42);
x = (int) mVh.getAndBitwiseAnd(this, ~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseFieldLittleEndianIntPerfTest.java
index 25d5631308ef..ca78f5ac53ec 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseAndReleaseFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseAndReleaseFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseAndRelease(this, ~42);
x = (int) mVh.getAndBitwiseAndRelease(this, ~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseStaticFieldLittleEndianIntPerfTest.java
index de2d5489dbcc..599f18669695 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseAndReleaseStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseAndReleaseStaticFieldLittleEndianIntPerfTest
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseAndRelease(~42);
x = (int) mVh.getAndBitwiseAndRelease(~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndStaticFieldLittleEndianIntPerfTest.java
index 36544c6f8f50..71fc0ae08196 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseAndStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseAndStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseAnd(~42);
x = (int) mVh.getAndBitwiseAnd(~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireFieldLittleEndianIntPerfTest.java
index fb36d0cb495f..8fc4eabbaccc 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseOrAcquireFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseOrAcquireFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseOrAcquire(this, ~42);
x = (int) mVh.getAndBitwiseOrAcquire(this, ~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireStaticFieldLittleEndianIntPerfTest.java
index 4194b12a4a6e..33689533d565 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseOrAcquireStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseOrAcquireStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseOrAcquire(~42);
x = (int) mVh.getAndBitwiseOrAcquire(~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrFieldLittleEndianIntPerfTest.java
index 355c6e823803..583a3a029059 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseOrFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseOrFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseOr(this, ~42);
x = (int) mVh.getAndBitwiseOr(this, ~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseFieldLittleEndianIntPerfTest.java
index 401079d0bece..1592fa6b9a8c 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseOrReleaseFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseOrReleaseFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseOrRelease(this, ~42);
x = (int) mVh.getAndBitwiseOrRelease(this, ~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseStaticFieldLittleEndianIntPerfTest.java
index 322dcbf7453e..d496083416a3 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseOrReleaseStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseOrReleaseStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseOrRelease(~42);
x = (int) mVh.getAndBitwiseOrRelease(~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrStaticFieldLittleEndianIntPerfTest.java
index c98281416012..87276a591699 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseOrStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseOrStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseOr(~42);
x = (int) mVh.getAndBitwiseOr(~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireFieldLittleEndianIntPerfTest.java
index 0b1cb32528ff..f7a372fc806f 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseXorAcquireFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseXorAcquireFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseXorAcquire(this, ~42);
x = (int) mVh.getAndBitwiseXorAcquire(this, ~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireStaticFieldLittleEndianIntPerfTest.java
index 473707201782..22726fcaa151 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseXorAcquireStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseXorAcquireStaticFieldLittleEndianIntPerfTest
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseXorAcquire(~42);
x = (int) mVh.getAndBitwiseXorAcquire(~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorFieldLittleEndianIntPerfTest.java
index 204cd70b2f9e..d071d6ead1ef 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseXorFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseXorFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseXor(this, ~42);
x = (int) mVh.getAndBitwiseXor(this, ~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseFieldLittleEndianIntPerfTest.java
index b3ffed7de91a..be2aa9cf61b4 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseXorReleaseFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseXorReleaseFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseXorRelease(this, ~42);
x = (int) mVh.getAndBitwiseXorRelease(this, ~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseStaticFieldLittleEndianIntPerfTest.java
index d0ab8de4502d..b0a7dcf2e7d3 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseXorReleaseStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseXorReleaseStaticFieldLittleEndianIntPerfTest
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseXorRelease(~42);
x = (int) mVh.getAndBitwiseXorRelease(~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorStaticFieldLittleEndianIntPerfTest.java
index b378b684114e..c5f99deff29c 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandbitwiseXorStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandbitwiseXorStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndBitwiseXor(~42);
x = (int) mVh.getAndBitwiseXor(~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianIntPerfTest.java
index c7c66fe20513..572e0c8dc57b 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandsetAcquireFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandsetAcquireFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndSetAcquire(this, ~42);
x = (int) mVh.getAndSetAcquire(this, ~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianStringPerfTest.java
index 98d6bd71c610..09be6d9d3204 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandsetAcquireFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandsetAcquireFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.getAndSetAcquire(this, null);
x = (String) mVh.getAndSetAcquire(this, null);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianIntPerfTest.java
index 206358f21c1d..4e0554a541b2 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandsetAcquireStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandsetAcquireStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndSetAcquire(~42);
x = (int) mVh.getAndSetAcquire(~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianStringPerfTest.java
index 0532e73c9d66..5491522b0122 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandsetAcquireStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandsetAcquireStaticFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.getAndSetAcquire(null);
x = (String) mVh.getAndSetAcquire(null);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianIntPerfTest.java
index f192d7153fce..a9303c6cff57 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandsetFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandsetFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndSet(this, ~42);
x = (int) mVh.getAndSet(this, ~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianStringPerfTest.java
index 0a8909c6c7b5..bd4703f6a5d6 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandsetFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandsetFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.getAndSet(this, null);
x = (String) mVh.getAndSet(this, null);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianIntPerfTest.java
index bfcb0f410256..d9aee0037a0c 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandsetReleaseFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandsetReleaseFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndSetRelease(this, ~42);
x = (int) mVh.getAndSetRelease(this, ~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianStringPerfTest.java
index c6b0509d619b..2c79ca2634b3 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandsetReleaseFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandsetReleaseFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.getAndSetRelease(this, null);
x = (String) mVh.getAndSetRelease(this, null);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianIntPerfTest.java
index 45a01eda2fd5..ceff81634f62 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandsetReleaseStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandsetReleaseStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndSetRelease(~42);
x = (int) mVh.getAndSetRelease(~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianStringPerfTest.java
index 30472811d5d6..9b83504b94d6 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandsetReleaseStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandsetReleaseStaticFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.getAndSetRelease(null);
x = (String) mVh.getAndSetRelease(null);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianIntPerfTest.java
index 6f1f1a016039..638da6fd37b6 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandsetStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandsetStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (int) mVh.getAndSet(~42);
x = (int) mVh.getAndSet(~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianStringPerfTest.java
index c4d279f37a4c..25d411417fb8 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleGetandsetStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleGetandsetStaticFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
x = (String) mVh.getAndSet(null);
x = (String) mVh.getAndSet(null);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianIntPerfTest.java
index c4f600593067..64ea9f32b698 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianIntPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,9 +34,9 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetArrayLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int ELEMENT_VALUE = 42;
- int[] mArray = {ELEMENT_VALUE};
+ int[] mArray = { ELEMENT_VALUE };
VarHandle mVh;
public VarHandleSetArrayLittleEndianIntPerfTest() throws Throwable {
@@ -53,7 +54,7 @@ public class VarHandleSetArrayLittleEndianIntPerfTest {
public void run() {
int[] a = mArray;
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.set(a, 0, ~42);
mVh.set(a, 0, ~42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianStringPerfTest.java
index a6858c261eb0..989d682f1b9f 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianStringPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,9 +34,9 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetArrayLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String ELEMENT_VALUE = "qwerty";
- String[] mArray = {ELEMENT_VALUE};
+ String[] mArray = { ELEMENT_VALUE };
VarHandle mVh;
public VarHandleSetArrayLittleEndianStringPerfTest() throws Throwable {
@@ -53,7 +54,7 @@ public class VarHandleSetArrayLittleEndianStringPerfTest {
public void run() {
String[] a = mArray;
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.set(a, 0, null);
mVh.set(a, 0, null);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewBigEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewBigEndianIntPerfTest.java
index a994cbeaf02c..9d6d6b8c0963 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewBigEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewBigEndianIntPerfTest.java
@@ -13,59 +13,52 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
-import java.nio.ByteOrder;
+
import java.util.Arrays;
+import java.nio.ByteOrder;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetByteArrayViewBigEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int VALUE = 42;
- byte[] mArray1 = {
- (byte) (VALUE >> 24), (byte) (VALUE >> 16), (byte) (VALUE >> 8), (byte) VALUE
- };
- byte[] mArray2 = {(byte) (-1 >> 24), (byte) (-1 >> 16), (byte) (-1 >> 8), (byte) VALUE};
+ byte[] mArray1 = { (byte) (VALUE >> 24), (byte) (VALUE >> 16), (byte) (VALUE >> 8), (byte) VALUE };
+ byte[] mArray2 = { (byte) (-1 >> 24), (byte) (-1 >> 16), (byte) (-1 >> 8), (byte) VALUE };
VarHandle mVh;
public VarHandleSetByteArrayViewBigEndianIntPerfTest() throws Throwable {
mVh = MethodHandles.byteArrayViewVarHandle(int[].class, ByteOrder.BIG_ENDIAN);
- }
+ }
@After
public void teardown() {
if (!Arrays.equals(mArray2, mArray1)) {
- throw new RuntimeException(
- "array has unexpected values: "
- + mArray2[0]
- + " "
- + mArray2[1]
- + " "
- + mArray2[2]
- + " "
- + mArray2[3]);
+ throw new RuntimeException("array has unexpected values: " +
+ mArray2[0] + " " + mArray2[1] + " " + mArray2[2] + " " + mArray2[3]);
}
}
@Test
public void run() {
byte[] a = mArray2;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.set(a, 0, VALUE);
mVh.set(a, 0, VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewLittleEndianIntPerfTest.java
index 65412ec84aa4..e8c3fa3cd01b 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewLittleEndianIntPerfTest.java
@@ -13,59 +13,52 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
-import java.nio.ByteOrder;
+
import java.util.Arrays;
+import java.nio.ByteOrder;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetByteArrayViewLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int VALUE = 42;
- byte[] mArray1 = {
- (byte) VALUE, (byte) (VALUE >> 8), (byte) (VALUE >> 16), (byte) (VALUE >> 24)
- };
- byte[] mArray2 = {(byte) VALUE, (byte) (-1 >> 8), (byte) (-1 >> 16), (byte) (-1 >> 24)};
+ byte[] mArray1 = { (byte) VALUE, (byte) (VALUE >> 8), (byte) (VALUE >> 16), (byte) (VALUE >> 24) };
+ byte[] mArray2 = { (byte) VALUE, (byte) (-1 >> 8), (byte) (-1 >> 16), (byte) (-1 >> 24) };
VarHandle mVh;
public VarHandleSetByteArrayViewLittleEndianIntPerfTest() throws Throwable {
mVh = MethodHandles.byteArrayViewVarHandle(int[].class, ByteOrder.LITTLE_ENDIAN);
- }
+ }
@After
public void teardown() {
if (!Arrays.equals(mArray2, mArray1)) {
- throw new RuntimeException(
- "array has unexpected values: "
- + mArray2[0]
- + " "
- + mArray2[1]
- + " "
- + mArray2[2]
- + " "
- + mArray2[3]);
+ throw new RuntimeException("array has unexpected values: " +
+ mArray2[0] + " " + mArray2[1] + " " + mArray2[2] + " " + mArray2[3]);
}
}
@Test
public void run() {
byte[] a = mArray2;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.set(a, 0, VALUE);
mVh.set(a, 0, VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianIntPerfTest.java
index 573b0ff277cc..08294c06d438 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianIntPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -52,7 +53,7 @@ public class VarHandleSetFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.set(this, FIELD_VALUE);
mVh.set(this, FIELD_VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianStringPerfTest.java
index fe3c0fc04a84..1e8a5bfd2a53 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianStringPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -52,7 +53,7 @@ public class VarHandleSetFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.set(this, FIELD_VALUE);
mVh.set(this, FIELD_VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianIntPerfTest.java
index f398899880ce..2e5fb1815b4b 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianIntPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetOpaqueFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -52,7 +53,7 @@ public class VarHandleSetOpaqueFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.setOpaque(this, FIELD_VALUE);
mVh.setOpaque(this, FIELD_VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianStringPerfTest.java
index 74931205fd3e..86a771f75b73 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianStringPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetOpaqueFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -52,7 +53,7 @@ public class VarHandleSetOpaqueFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.setOpaque(this, FIELD_VALUE);
mVh.setOpaque(this, FIELD_VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianIntPerfTest.java
index 5e7326985c9d..903b31003510 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianIntPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetOpaqueStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -52,7 +53,7 @@ public class VarHandleSetOpaqueStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.setOpaque(FIELD_VALUE);
mVh.setOpaque(FIELD_VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianStringPerfTest.java
index 9a217d1fd142..63cf7d25d0fd 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianStringPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetOpaqueStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
@@ -52,7 +53,7 @@ public class VarHandleSetOpaqueStaticFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.setOpaque(FIELD_VALUE);
mVh.setOpaque(FIELD_VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianIntPerfTest.java
index 1ce2270ecc58..d1a358dc662e 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianIntPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetReleaseFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -52,7 +53,7 @@ public class VarHandleSetReleaseFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.setRelease(this, FIELD_VALUE);
mVh.setRelease(this, FIELD_VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianStringPerfTest.java
index ed84528fe869..b65832469685 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianStringPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetReleaseFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -52,7 +53,7 @@ public class VarHandleSetReleaseFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.setRelease(this, FIELD_VALUE);
mVh.setRelease(this, FIELD_VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianIntPerfTest.java
index aeb96404a223..47cb77959f2e 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianIntPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetReleaseStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -52,7 +53,7 @@ public class VarHandleSetReleaseStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.setRelease(FIELD_VALUE);
mVh.setRelease(FIELD_VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianStringPerfTest.java
index 8959a0c3d50c..e48374e2224a 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianStringPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetReleaseStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
@@ -52,7 +53,7 @@ public class VarHandleSetReleaseStaticFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.setRelease(FIELD_VALUE);
mVh.setRelease(FIELD_VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianIntPerfTest.java
index 400772231d48..0470d67180c9 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianIntPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -52,7 +53,7 @@ public class VarHandleSetStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.set(FIELD_VALUE);
mVh.set(FIELD_VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianStringPerfTest.java
index 732315862eb2..00abb0bab6bb 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianStringPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
@@ -52,7 +53,7 @@ public class VarHandleSetStaticFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.set(FIELD_VALUE);
mVh.set(FIELD_VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianIntPerfTest.java
index f4119c28b826..c66b23b19938 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianIntPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetVolatileFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -52,7 +53,7 @@ public class VarHandleSetVolatileFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.setVolatile(this, FIELD_VALUE);
mVh.setVolatile(this, FIELD_VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianStringPerfTest.java
index 9b9c2612fe25..1b364504d1d5 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianStringPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetVolatileFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -52,7 +53,7 @@ public class VarHandleSetVolatileFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.setVolatile(this, FIELD_VALUE);
mVh.setVolatile(this, FIELD_VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianIntPerfTest.java
index f125384706ca..75f927494f88 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianIntPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetVolatileStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -52,7 +53,7 @@ public class VarHandleSetVolatileStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
int x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.setVolatile(FIELD_VALUE);
mVh.setVolatile(FIELD_VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianStringPerfTest.java
index 2ad605d83d04..8289d4fdc0aa 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianStringPerfTest.java
@@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleSetVolatileStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
@@ -52,7 +53,7 @@ public class VarHandleSetVolatileStaticFieldLittleEndianStringPerfTest {
@Test
public void run() {
String x;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
mVh.setVolatile(FIELD_VALUE);
mVh.setVolatile(FIELD_VALUE);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianIntPerfTest.java
index 5ef3bf00204b..9fac8427eacf 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleWeakcompareandsetAcquireFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleWeakcompareandsetAcquireFieldLittleEndianIntPerfTest {
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.weakCompareAndSetAcquire(this, mField, ~42);
success = mVh.weakCompareAndSetAcquire(this, mField, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianStringPerfTest.java
index 0c4ed66fc6b7..2f601273076e 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleWeakcompareandsetAcquireFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleWeakcompareandsetAcquireFieldLittleEndianStringPerfTest {
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.weakCompareAndSetAcquire(this, mField, null);
success = mVh.weakCompareAndSetAcquire(this, mField, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianIntPerfTest.java
index db6bd2429e26..4efbd3e50637 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianIntPerfTest
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.weakCompareAndSetAcquire(sField, ~42);
success = mVh.weakCompareAndSetAcquire(sField, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianStringPerfTest.java
index d2b0bf76158f..099640c624e1 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,20 +34,19 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
- public VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianStringPerfTest()
- throws Throwable {
+ public VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianStringPerfTest() throws Throwable {
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
}
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.weakCompareAndSetAcquire(sField, null);
success = mVh.weakCompareAndSetAcquire(sField, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianIntPerfTest.java
index 3cd5ae6533b6..ce8f0f0ac269 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleWeakcompareandsetFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleWeakcompareandsetFieldLittleEndianIntPerfTest {
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.weakCompareAndSet(this, mField, ~42);
success = mVh.weakCompareAndSet(this, mField, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianStringPerfTest.java
index 6ddfc25deca9..c4119dc5411b 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleWeakcompareandsetFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleWeakcompareandsetFieldLittleEndianStringPerfTest {
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.weakCompareAndSet(this, mField, null);
success = mVh.weakCompareAndSet(this, mField, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianIntPerfTest.java
index 375f0bc08027..abd981c78f41 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleWeakcompareandsetPlainFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleWeakcompareandsetPlainFieldLittleEndianIntPerfTest {
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.weakCompareAndSetPlain(this, mField, ~42);
success = mVh.weakCompareAndSetPlain(this, mField, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianStringPerfTest.java
index 7e2492ace1dd..c71e65f77983 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleWeakcompareandsetPlainFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleWeakcompareandsetPlainFieldLittleEndianStringPerfTest {
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.weakCompareAndSetPlain(this, mField, null);
success = mVh.weakCompareAndSetPlain(this, mField, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianIntPerfTest.java
index 190118c551e6..f3c8f3ac0656 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleWeakcompareandsetPlainStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleWeakcompareandsetPlainStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.weakCompareAndSetPlain(sField, ~42);
success = mVh.weakCompareAndSetPlain(sField, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianStringPerfTest.java
index 484ba1b88183..5c943a46cedc 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleWeakcompareandsetPlainStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleWeakcompareandsetPlainStaticFieldLittleEndianStringPerfTes
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.weakCompareAndSetPlain(sField, null);
success = mVh.weakCompareAndSetPlain(sField, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianIntPerfTest.java
index 80e4e153a41f..1755a15aae76 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleWeakcompareandsetReleaseFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
int mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleWeakcompareandsetReleaseFieldLittleEndianIntPerfTest {
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.weakCompareAndSetRelease(this, mField, ~42);
success = mVh.weakCompareAndSetRelease(this, mField, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianStringPerfTest.java
index fa26c59304f9..77175b007af9 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleWeakcompareandsetReleaseFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
String mField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleWeakcompareandsetReleaseFieldLittleEndianStringPerfTest {
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.weakCompareAndSetRelease(this, mField, null);
success = mVh.weakCompareAndSetRelease(this, mField, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianIntPerfTest.java
index 16bf2a208870..985519e890af 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianIntPerfTest
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.weakCompareAndSetRelease(sField, ~42);
success = mVh.weakCompareAndSetRelease(sField, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianStringPerfTest.java
index e1716dede024..69e6ca7cce9c 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,20 +34,19 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
- public VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianStringPerfTest()
- throws Throwable {
+ public VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianStringPerfTest() throws Throwable {
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
}
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.weakCompareAndSetRelease(sField, null);
success = mVh.weakCompareAndSetRelease(sField, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianIntPerfTest.java
index dc6f2adfe951..88df5ff60341 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianIntPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianIntPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleWeakcompareandsetStaticFieldLittleEndianIntPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final int FIELD_VALUE = 42;
static int sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleWeakcompareandsetStaticFieldLittleEndianIntPerfTest {
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.weakCompareAndSet(sField, ~42);
success = mVh.weakCompareAndSet(sField, 42);
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianStringPerfTest.java
index d1096c629ed8..c296f66814a4 100644
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianStringPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianStringPerfTest.java
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// This file is generated by generate_java.py do not directly modify!
+ // This file is generated by generate_java.py do not directly modify!
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +34,7 @@ import java.lang.invoke.VarHandle;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class VarHandleWeakcompareandsetStaticFieldLittleEndianStringPerfTest {
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final String FIELD_VALUE = "qwerty";
static String sField = FIELD_VALUE;
VarHandle mVh;
@@ -44,7 +46,7 @@ public class VarHandleWeakcompareandsetStaticFieldLittleEndianStringPerfTest {
@Test
public void run() {
boolean success;
- BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
success = mVh.weakCompareAndSet(sField, null);
success = mVh.weakCompareAndSet(sField, "qwerty");
diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/generate_java.py b/apct-tests/perftests/core/src/android/libcore/varhandles/generate_java.py
index 4b4bc605a6c3..a43569a13813 100755
--- a/apct-tests/perftests/core/src/android/libcore/varhandles/generate_java.py
+++ b/apct-tests/perftests/core/src/android/libcore/varhandles/generate_java.py
@@ -42,7 +42,7 @@ def to_camel_case(word):
return ''.join(c for c in word.title() if not c == '_')
-LOOP ="BenchmarkState state = mPerfStatusReporter.getBenchmarkState();\n while (state.keepRunning())"
+LOOP ="final BenchmarkState state = mBenchmarkRule.getState();\n while (state.keepRunning())"
class Benchmark:
def __init__(self, code, static, vartype, flavour, klass, method, memloc,
@@ -158,10 +158,10 @@ BANNER = """/*
VH_IMPORTS = """
package android.libcore.varhandles;
-import android.perftests.utils.BenchmarkState;
-import android.perftests.utils.PerfStatusReporter;
-import android.test.suitebuilder.annotation.LargeTest;
+import androidx.benchmark.BenchmarkState;
+import androidx.benchmark.junit4.BenchmarkRule;
+import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
@@ -179,7 +179,7 @@ VH_START = BANNER + VH_IMPORTS + """
@RunWith(AndroidJUnit4.class)
@LargeTest
public class {name} {{
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final {vartype} FIELD_VALUE = {value1};
{static_kwd}{vartype} {static_prefix}Field = FIELD_VALUE;
VarHandle mVh;
@@ -273,7 +273,7 @@ VH_START_ARRAY = BANNER + VH_IMPORTS + """
@RunWith(AndroidJUnit4.class)
@LargeTest
public class {name} {{
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final {vartype} ELEMENT_VALUE = {value1};
{vartype}[] mArray = {{ ELEMENT_VALUE }};
VarHandle mVh;
@@ -324,7 +324,7 @@ import java.nio.ByteOrder;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class {name} {{
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
static final {vartype} VALUE = {value1};
byte[] mArray1 = {value1_byte_array};
byte[] mArray2 = {value2_byte_array};
@@ -375,7 +375,7 @@ import java.lang.reflect.Field;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class {name} {{
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
Field mField;
{static_kwd}{vartype} {static_prefix}Value;
@@ -407,7 +407,7 @@ import jdk.internal.misc.Unsafe;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class {name} {{
- @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ @Rule public BenchmarkRule mBenchmarkRule = new BenchmarkRule();
long mOffset;
public {static_kwd}{vartype} {static_prefix}Value = {value1};
diff --git a/apct-tests/perftests/healthconnect/Android.bp b/apct-tests/perftests/healthconnect/Android.bp
index c38a24ee05d2..072010e90fae 100644
--- a/apct-tests/perftests/healthconnect/Android.bp
+++ b/apct-tests/perftests/healthconnect/Android.bp
@@ -37,7 +37,7 @@ android_test {
"collector-device-lib-platform",
],
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs.system"],
platform_apis: true,
test_suites: ["device-tests"],
data: [":perfetto_artifacts"],
diff --git a/apct-tests/perftests/packagemanager/Android.bp b/apct-tests/perftests/packagemanager/Android.bp
index 02fc12cde04b..b2626911ea1e 100644
--- a/apct-tests/perftests/packagemanager/Android.bp
+++ b/apct-tests/perftests/packagemanager/Android.bp
@@ -28,7 +28,7 @@ android_test {
"services.core",
],
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs.system"],
platform_apis: true,
diff --git a/apct-tests/perftests/permission/Android.bp b/apct-tests/perftests/permission/Android.bp
index bc8e7696440a..f4c7fbbf6593 100644
--- a/apct-tests/perftests/permission/Android.bp
+++ b/apct-tests/perftests/permission/Android.bp
@@ -43,7 +43,7 @@ android_test {
"cts-install-lib-java",
],
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs.system"],
platform_apis: true,
diff --git a/apct-tests/perftests/settingsprovider/Android.bp b/apct-tests/perftests/settingsprovider/Android.bp
index e4aa14cd8a77..382803900507 100644
--- a/apct-tests/perftests/settingsprovider/Android.bp
+++ b/apct-tests/perftests/settingsprovider/Android.bp
@@ -28,7 +28,7 @@ android_test {
"services.core",
],
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs.system"],
platform_apis: true,
diff --git a/cmds/uiautomator/library/Android.bp b/cmds/uiautomator/library/Android.bp
index cd1fb9a0f047..966bf13adfe4 100644
--- a/cmds/uiautomator/library/Android.bp
+++ b/cmds/uiautomator/library/Android.bp
@@ -71,7 +71,7 @@ java_library_static {
":uiautomator-stubs",
],
libs: [
- "android.test.runner",
+ "android.test.runner.stubs.system",
"junit",
],
java_version: "1.8",
@@ -84,8 +84,8 @@ java_library_static {
"testrunner-src/**/*.java",
],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"junit",
diff --git a/core/tests/BroadcastRadioTests/Android.bp b/core/tests/BroadcastRadioTests/Android.bp
index beffb9aac12b..7d4ae00c405a 100644
--- a/core/tests/BroadcastRadioTests/Android.bp
+++ b/core/tests/BroadcastRadioTests/Android.bp
@@ -45,7 +45,7 @@ android_test {
"flag-junit",
"mockito-target-extended",
],
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs.system"],
test_suites: [
"general-tests",
"automotive-general-tests",
diff --git a/core/tests/ConnectivityManagerTest/Android.bp b/core/tests/ConnectivityManagerTest/Android.bp
index f17a28d22c17..6421899631ff 100644
--- a/core/tests/ConnectivityManagerTest/Android.bp
+++ b/core/tests/ConnectivityManagerTest/Android.bp
@@ -24,8 +24,8 @@ package {
android_test {
name: "ConnectivityManagerTest",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"junit",
diff --git a/core/tests/GameManagerTests/Android.bp b/core/tests/GameManagerTests/Android.bp
index a252f8b53fab..1abceb820fc1 100644
--- a/core/tests/GameManagerTests/Android.bp
+++ b/core/tests/GameManagerTests/Android.bp
@@ -32,7 +32,7 @@ android_test {
"platform-test-annotations",
"truth",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
test_suites: ["device-tests"],
diff --git a/core/tests/InputMethodCoreTests/Android.bp b/core/tests/InputMethodCoreTests/Android.bp
index ac6462589e16..2b524d58ced7 100644
--- a/core/tests/InputMethodCoreTests/Android.bp
+++ b/core/tests/InputMethodCoreTests/Android.bp
@@ -42,9 +42,9 @@ android_test {
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs",
+ "android.test.base.stubs",
+ "android.test.mock.stubs",
"framework",
"ext",
"framework-res",
diff --git a/core/tests/PackageInstallerSessions/Android.bp b/core/tests/PackageInstallerSessions/Android.bp
index b631df1fcf57..d10ecd07a44c 100644
--- a/core/tests/PackageInstallerSessions/Android.bp
+++ b/core/tests/PackageInstallerSessions/Android.bp
@@ -39,8 +39,8 @@ android_test {
],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs",
+ "android.test.base.stubs",
"framework",
"framework-res",
],
diff --git a/core/tests/PlatformCompatFramework/Android.bp b/core/tests/PlatformCompatFramework/Android.bp
index 2621d280bd9d..a3fdf7b43bee 100644
--- a/core/tests/PlatformCompatFramework/Android.bp
+++ b/core/tests/PlatformCompatFramework/Android.bp
@@ -12,8 +12,8 @@ android_test {
// Include all test java files.
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"junit",
diff --git a/core/tests/bandwidthtests/Android.bp b/core/tests/bandwidthtests/Android.bp
index 8645b39da5a8..b7357122dff8 100644
--- a/core/tests/bandwidthtests/Android.bp
+++ b/core/tests/bandwidthtests/Android.bp
@@ -27,9 +27,9 @@ android_test {
// Include all test java files.
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "org.apache.http.legacy",
- "android.test.base",
+ "android.test.runner.stubs",
+ "org.apache.http.legacy.stubs",
+ "android.test.base.stubs",
],
static_libs: [
"junit",
diff --git a/core/tests/batterystatstests/BatteryStatsLoadTests/Android.bp b/core/tests/batterystatstests/BatteryStatsLoadTests/Android.bp
index 1c0ea839ec02..926edfed16ef 100644
--- a/core/tests/batterystatstests/BatteryStatsLoadTests/Android.bp
+++ b/core/tests/batterystatstests/BatteryStatsLoadTests/Android.bp
@@ -16,7 +16,7 @@ android_test {
"compatibility-device-util-axt",
"junit",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
}
diff --git a/core/tests/batterystatstests/BatteryUsageStatsProtoTests/Android.bp b/core/tests/batterystatstests/BatteryUsageStatsProtoTests/Android.bp
index 1fb5f2c0789b..6a554f747182 100644
--- a/core/tests/batterystatstests/BatteryUsageStatsProtoTests/Android.bp
+++ b/core/tests/batterystatstests/BatteryUsageStatsProtoTests/Android.bp
@@ -21,7 +21,7 @@ android_test {
"truth",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
diff --git a/core/tests/bugreports/Android.bp b/core/tests/bugreports/Android.bp
index 7c1ac487bfdb..efeb33fdd3e6 100644
--- a/core/tests/bugreports/Android.bp
+++ b/core/tests/bugreports/Android.bp
@@ -26,8 +26,8 @@ android_test {
srcs: ["src/**/*.java"],
data: [":bugreport_artifacts"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.test",
+ "android.test.base.stubs.test",
],
static_libs: [
"androidx.test.rules",
diff --git a/core/tests/companiontests/Android.bp b/core/tests/companiontests/Android.bp
index d31b8f470108..cb0951e59d04 100644
--- a/core/tests/companiontests/Android.bp
+++ b/core/tests/companiontests/Android.bp
@@ -12,8 +12,8 @@ android_test {
// Include all test java files.
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: ["junit"],
platform_apis: true,
diff --git a/core/tests/coretests/Android.bp b/core/tests/coretests/Android.bp
index efd27c87c9cf..4ec014d5cf5e 100644
--- a/core/tests/coretests/Android.bp
+++ b/core/tests/coretests/Android.bp
@@ -107,10 +107,10 @@ android_test {
],
libs: [
- "android.test.runner",
- "org.apache.http.legacy",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs",
+ "org.apache.http.legacy.stubs",
+ "android.test.base.stubs",
+ "android.test.mock.stubs",
"framework",
"ext",
"framework-res",
@@ -156,8 +156,8 @@ android_app {
use_resource_processor: false,
libs: [
"framework-res",
- "android.test.runner",
- "org.apache.http.legacy",
+ "android.test.runner.stubs",
+ "org.apache.http.legacy.stubs",
],
uses_libs: [
"android.test.runner",
@@ -222,9 +222,9 @@ android_library {
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
"framework",
"framework-res",
],
@@ -233,8 +233,8 @@ android_library {
android_ravenwood_test {
name: "FrameworksCoreTestsRavenwood",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"core-test-rules", // for libcore.dalvik.system.CloseGuardSupport
diff --git a/core/tests/devicestatetests/Android.bp b/core/tests/devicestatetests/Android.bp
index 60848b31eaec..a3303c6ca6d7 100644
--- a/core/tests/devicestatetests/Android.bp
+++ b/core/tests/devicestatetests/Android.bp
@@ -32,7 +32,7 @@ android_test {
"platform-test-annotations",
"testng",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
}
diff --git a/core/tests/featureflagtests/Android.bp b/core/tests/featureflagtests/Android.bp
index d9f608ea34c4..c08066720477 100644
--- a/core/tests/featureflagtests/Android.bp
+++ b/core/tests/featureflagtests/Android.bp
@@ -19,8 +19,8 @@ android_test {
"androidx.test.rules",
],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
platform_apis: true,
certificate: "platform",
diff --git a/core/tests/hdmitests/Android.bp b/core/tests/hdmitests/Android.bp
index e11bc552cf15..7a5757cc7a85 100644
--- a/core/tests/hdmitests/Android.bp
+++ b/core/tests/hdmitests/Android.bp
@@ -32,7 +32,7 @@ android_test {
"platform-test-annotations",
"truth",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
test_suites: ["device-tests"],
diff --git a/core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.bp b/core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.bp
index d439124c72cb..c9fdec0e61fd 100644
--- a/core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.bp
+++ b/core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.bp
@@ -27,8 +27,8 @@ android_test {
"junit",
],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
platform_apis: true,
diff --git a/core/tests/mockingcoretests/Android.bp b/core/tests/mockingcoretests/Android.bp
index 7fd813a7421a..8657b8ca52e1 100644
--- a/core/tests/mockingcoretests/Android.bp
+++ b/core/tests/mockingcoretests/Android.bp
@@ -44,9 +44,9 @@ android_test {
],
libs: [
- "android.test.base",
- "android.test.mock",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
+ "android.test.runner.stubs.system",
],
// These are not normally accessible from apps so they must be explicitly included.
diff --git a/core/tests/packagemanagertests/Android.bp b/core/tests/packagemanagertests/Android.bp
index 5ce71c902c7c..8ff499826866 100644
--- a/core/tests/packagemanagertests/Android.bp
+++ b/core/tests/packagemanagertests/Android.bp
@@ -17,7 +17,7 @@ android_test {
"frameworks-base-testutils",
"mockito-target-minus-junit4",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
}
diff --git a/core/tests/packagemonitortests/Android.bp b/core/tests/packagemonitortests/Android.bp
index b08850e90d28..c3b084e4368e 100644
--- a/core/tests/packagemonitortests/Android.bp
+++ b/core/tests/packagemonitortests/Android.bp
@@ -34,7 +34,7 @@ android_test {
"mockito-target-minus-junit4",
"truth",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
test_suites: ["device-tests"],
@@ -52,7 +52,7 @@ android_test {
"compatibility-device-util-axt",
"frameworks-base-testutils",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
test_suites: ["device-tests"],
diff --git a/core/tests/privacytests/Android.bp b/core/tests/privacytests/Android.bp
index 4e24cd5d91cb..ac9cede84483 100644
--- a/core/tests/privacytests/Android.bp
+++ b/core/tests/privacytests/Android.bp
@@ -16,7 +16,7 @@ android_test {
"androidx.test.rules",
"truth",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
test_suites: ["device-tests"],
diff --git a/core/tests/screenshothelpertests/Android.bp b/core/tests/screenshothelpertests/Android.bp
index 3c71e6e4247b..49c3ee94bfd0 100644
--- a/core/tests/screenshothelpertests/Android.bp
+++ b/core/tests/screenshothelpertests/Android.bp
@@ -25,9 +25,9 @@ android_test {
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
platform_apis: true,
diff --git a/core/tests/systemproperties/Android.bp b/core/tests/systemproperties/Android.bp
index ed52cccfb9b9..ed99a1f5cc4a 100644
--- a/core/tests/systemproperties/Android.bp
+++ b/core/tests/systemproperties/Android.bp
@@ -20,8 +20,8 @@ android_test {
"ravenwood-junit",
],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
platform_apis: true,
certificate: "platform",
@@ -37,8 +37,8 @@ android_ravenwood_test {
"ravenwood-junit",
],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
srcs: [
"src/**/*.java",
diff --git a/core/tests/timetests/Android.bp b/core/tests/timetests/Android.bp
index c33d5ee5008b..04bbe692e488 100644
--- a/core/tests/timetests/Android.bp
+++ b/core/tests/timetests/Android.bp
@@ -19,7 +19,7 @@ android_test {
"platform-test-annotations",
"truth",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
certificate: "platform",
test_suites: ["device-tests"],
}
diff --git a/core/tests/utillib/Android.bp b/core/tests/utillib/Android.bp
index 1d5c16c7a536..b6f046bd12d5 100644
--- a/core/tests/utillib/Android.bp
+++ b/core/tests/utillib/Android.bp
@@ -28,5 +28,5 @@ java_library {
srcs: ["**/*.java"],
static_libs: ["junit"],
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs"],
}
diff --git a/core/tests/utiltests/Android.bp b/core/tests/utiltests/Android.bp
index f5563a710563..cdc8a9e06d0b 100644
--- a/core/tests/utiltests/Android.bp
+++ b/core/tests/utiltests/Android.bp
@@ -39,9 +39,9 @@ android_test {
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
platform_apis: true,
@@ -55,7 +55,7 @@ android_test {
android_ravenwood_test {
name: "FrameworksUtilTestsRavenwood",
libs: [
- "android.test.mock",
+ "android.test.mock.stubs.system",
],
static_libs: [
"androidx.annotation_annotation",
diff --git a/core/tests/vibrator/Android.bp b/core/tests/vibrator/Android.bp
index 3ebe150acd24..a9d30da6b364 100644
--- a/core/tests/vibrator/Android.bp
+++ b/core/tests/vibrator/Android.bp
@@ -24,9 +24,9 @@ android_test {
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs",
+ "android.test.base.stubs",
+ "android.test.mock.stubs",
"framework",
"framework-res",
],
diff --git a/keystore/tests/Android.bp b/keystore/tests/Android.bp
index 7de45233494b..0dcf597644ee 100644
--- a/keystore/tests/Android.bp
+++ b/keystore/tests/Android.bp
@@ -31,6 +31,6 @@ android_test {
"mockito-target-minus-junit4",
],
platform_apis: true,
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
certificate: "platform",
}
diff --git a/libs/WindowManager/Jetpack/tests/unittest/Android.bp b/libs/WindowManager/Jetpack/tests/unittest/Android.bp
index 61ea51a35f58..9a38301d551c 100644
--- a/libs/WindowManager/Jetpack/tests/unittest/Android.bp
+++ b/libs/WindowManager/Jetpack/tests/unittest/Android.bp
@@ -46,9 +46,9 @@ android_test {
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
// These are not normally accessible from apps so they must be explicitly included.
diff --git a/libs/WindowManager/Shell/multivalentTests/Android.bp b/libs/WindowManager/Shell/multivalentTests/Android.bp
index 1ad19c9f3033..ee0d5bbed324 100644
--- a/libs/WindowManager/Shell/multivalentTests/Android.bp
+++ b/libs/WindowManager/Shell/multivalentTests/Android.bp
@@ -77,8 +77,8 @@ android_test {
"platform-test-rules",
],
libs: [
- "android.test.base",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
jni_libs: [
"libdexmakerjvmtiagent",
diff --git a/libs/WindowManager/Shell/tests/flicker/Android.bp b/libs/WindowManager/Shell/tests/flicker/Android.bp
index 4abaf5bd4a38..4058fa977f1d 100644
--- a/libs/WindowManager/Shell/tests/flicker/Android.bp
+++ b/libs/WindowManager/Shell/tests/flicker/Android.bp
@@ -59,7 +59,7 @@ java_defaults {
enabled: false,
},
test_suites: ["device-tests"],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
static_libs: [
"wm-shell-flicker-utils",
"androidx.test.ext.junit",
diff --git a/libs/WindowManager/Shell/tests/unittest/Android.bp b/libs/WindowManager/Shell/tests/unittest/Android.bp
index 0b5387379090..787c9f332b2d 100644
--- a/libs/WindowManager/Shell/tests/unittest/Android.bp
+++ b/libs/WindowManager/Shell/tests/unittest/Android.bp
@@ -61,9 +61,9 @@ android_test {
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
jni_libs: [
diff --git a/libs/dream/lowlight/tests/Android.bp b/libs/dream/lowlight/tests/Android.bp
index 42547832133b..d3e101681ef2 100644
--- a/libs/dream/lowlight/tests/Android.bp
+++ b/libs/dream/lowlight/tests/Android.bp
@@ -37,9 +37,9 @@ android_test {
"truth",
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
jni_libs: [
"libdexmakerjvmtiagent",
diff --git a/libs/securebox/tests/Android.bp b/libs/securebox/tests/Android.bp
index 80b501da1aa5..8429cf4116c5 100644
--- a/libs/securebox/tests/Android.bp
+++ b/libs/securebox/tests/Android.bp
@@ -35,9 +35,9 @@ android_test {
"truth",
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
jni_libs: [
"libdexmakerjvmtiagent",
diff --git a/media/lib/tvremote/tests/Android.bp b/media/lib/tvremote/tests/Android.bp
index 280c515e9a9e..83061cf14b0f 100644
--- a/media/lib/tvremote/tests/Android.bp
+++ b/media/lib/tvremote/tests/Android.bp
@@ -11,9 +11,9 @@ android_test {
name: "TvRemoteTests",
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
- "com.android.media.tv.remoteprovider",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "com.android.media.tv.remoteprovider.impl",
],
static_libs: [
"mockito-target-minus-junit4",
diff --git a/media/mca/tests/Android.bp b/media/mca/tests/Android.bp
index 04f083dee093..463e131f1dfd 100644
--- a/media/mca/tests/Android.bp
+++ b/media/mca/tests/Android.bp
@@ -10,8 +10,8 @@ package {
android_test {
name: "CameraEffectsTests",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"junit",
diff --git a/media/packages/BluetoothMidiService/tests/unit/Android.bp b/media/packages/BluetoothMidiService/tests/unit/Android.bp
index 67c7e4230f30..54d6dfc658ed 100644
--- a/media/packages/BluetoothMidiService/tests/unit/Android.bp
+++ b/media/packages/BluetoothMidiService/tests/unit/Android.bp
@@ -39,8 +39,8 @@ android_test {
test_suites: ["device-tests"],
libs: [
"framework-res",
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
}
diff --git a/media/tests/MediaFrameworkTest/Android.bp b/media/tests/MediaFrameworkTest/Android.bp
index 1325fc161b77..7ee8777266df 100644
--- a/media/tests/MediaFrameworkTest/Android.bp
+++ b/media/tests/MediaFrameworkTest/Android.bp
@@ -11,9 +11,9 @@ android_test {
name: "mediaframeworktest",
srcs: ["**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
static_libs: [
"mockito-target-inline-minus-junit4",
diff --git a/media/tests/MediaRouter/Android.bp b/media/tests/MediaRouter/Android.bp
index d21cb9319885..e4f88a65ed1a 100644
--- a/media/tests/MediaRouter/Android.bp
+++ b/media/tests/MediaRouter/Android.bp
@@ -14,8 +14,8 @@ android_test {
srcs: ["**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
diff --git a/media/tests/TunerTest/Android.bp b/media/tests/TunerTest/Android.bp
index 8e8816cee876..634438e72b59 100644
--- a/media/tests/TunerTest/Android.bp
+++ b/media/tests/TunerTest/Android.bp
@@ -13,14 +13,14 @@ android_test {
srcs: ["**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"androidx.test.rules",
"compatibility-device-util-axt",
- "testng"
+ "testng",
],
platform_apis: true,
diff --git a/media/tests/projection/Android.bp b/media/tests/projection/Android.bp
index fd5f19535537..94db2c02eb28 100644
--- a/media/tests/projection/Android.bp
+++ b/media/tests/projection/Android.bp
@@ -18,9 +18,9 @@ android_test {
srcs: ["**/*.java"],
libs: [
- "android.test.base",
- "android.test.mock",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
+ "android.test.runner.stubs.system",
],
static_libs: [
diff --git a/nfc/Android.bp b/nfc/Android.bp
index 0282e6f5c246..db3dcb0631dd 100644
--- a/nfc/Android.bp
+++ b/nfc/Android.bp
@@ -38,8 +38,8 @@ java_sdk_library {
name: "framework-nfc",
libs: [
"unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage
- "framework-permission-s",
- "framework-permission",
+ "framework-permission-s.stubs.module_lib",
+ "framework-permission.stubs.module_lib",
],
static_libs: [
"android.nfc.flags-aconfig-java",
diff --git a/nfc/tests/Android.bp b/nfc/tests/Android.bp
index 6ebc03cc6ffc..bfa814d149f0 100644
--- a/nfc/tests/Android.bp
+++ b/nfc/tests/Android.bp
@@ -32,7 +32,7 @@ android_test {
],
libs: [
"framework-nfc.impl",
- "android.test.runner",
+ "android.test.runner.stubs.system",
],
srcs: ["src/**/*.java"],
platform_apis: true,
diff --git a/packages/CarrierDefaultApp/tests/unit/Android.bp b/packages/CarrierDefaultApp/tests/unit/Android.bp
index 0d08ec6ca2b3..bec81ad5f92e 100644
--- a/packages/CarrierDefaultApp/tests/unit/Android.bp
+++ b/packages/CarrierDefaultApp/tests/unit/Android.bp
@@ -25,8 +25,8 @@ android_test {
name: "CarrierDefaultAppUnitTests",
certificate: "platform",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
"SlicePurchaseController",
],
static_libs: [
diff --git a/packages/CredentialManager/tests/robotests/Android.bp b/packages/CredentialManager/tests/robotests/Android.bp
index 75a0dcce0b9e..27afaaa49fdd 100644
--- a/packages/CredentialManager/tests/robotests/Android.bp
+++ b/packages/CredentialManager/tests/robotests/Android.bp
@@ -48,9 +48,9 @@ android_robolectric_test {
"flag-junit-base",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
"truth",
],
upstream: true,
diff --git a/packages/ExternalStorageProvider/tests/Android.bp b/packages/ExternalStorageProvider/tests/Android.bp
index 86c62ef299e4..b5b1186c0db1 100644
--- a/packages/ExternalStorageProvider/tests/Android.bp
+++ b/packages/ExternalStorageProvider/tests/Android.bp
@@ -17,9 +17,9 @@ android_test {
],
libs: [
- "android.test.base",
- "android.test.mock",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
+ "android.test.runner.stubs.system",
],
static_libs: [
diff --git a/packages/FusedLocation/Android.bp b/packages/FusedLocation/Android.bp
index 61a82701d155..719aa28a4e30 100644
--- a/packages/FusedLocation/Android.bp
+++ b/packages/FusedLocation/Android.bp
@@ -35,7 +35,7 @@ android_app {
name: "FusedLocation",
defaults: ["platform_app_defaults"],
srcs: ["src/**/*.java"],
- libs: ["com.android.location.provider"],
+ libs: ["com.android.location.provider.impl"],
platform_apis: true,
certificate: "platform",
privileged: true,
@@ -50,9 +50,9 @@ android_test {
"src/**/*.java", // include real sources because we're forced to test this directly
],
libs: [
- "android.test.base",
- "android.test.runner",
- "com.android.location.provider",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
+ "com.android.location.provider.impl",
],
static_libs: [
"androidx.test.core",
diff --git a/packages/SettingsLib/Spa/screenshot/robotests/Android.bp b/packages/SettingsLib/Spa/screenshot/robotests/Android.bp
index c834c80ad536..f6477e2f052a 100644
--- a/packages/SettingsLib/Spa/screenshot/robotests/Android.bp
+++ b/packages/SettingsLib/Spa/screenshot/robotests/Android.bp
@@ -63,9 +63,9 @@ android_robolectric_test {
"uiautomator-helpers",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
"truth",
],
upstream: true,
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/OWNERS b/packages/SettingsLib/src/com/android/settingslib/media/OWNERS
index 7467ee1c1a7c..d58add4bb5eb 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/OWNERS
+++ b/packages/SettingsLib/src/com/android/settingslib/media/OWNERS
@@ -2,7 +2,6 @@
ethibodeau@google.com
michaelmikhil@google.com
apotapov@google.com
-shaoweishen@google.com
#Android Media - For minor changes and renames only.
aquilescanta@google.com #{LAST_RESORT_SUGGESTION}
diff --git a/packages/SettingsLib/tests/integ/Android.bp b/packages/SettingsLib/tests/integ/Android.bp
index 48a1af6cb0e8..03dd7122660d 100644
--- a/packages/SettingsLib/tests/integ/Android.bp
+++ b/packages/SettingsLib/tests/integ/Android.bp
@@ -37,10 +37,10 @@ android_test {
],
libs: [
- "android.test.runner",
+ "android.test.runner.stubs",
"telephony-common",
- "android.test.base",
- "android.test.mock",
+ "android.test.base.stubs",
+ "android.test.mock.stubs",
"truth",
],
diff --git a/packages/SettingsProvider/Android.bp b/packages/SettingsProvider/Android.bp
index 75f8384321b0..58d6d07b735c 100644
--- a/packages/SettingsProvider/Android.bp
+++ b/packages/SettingsProvider/Android.bp
@@ -75,8 +75,8 @@ android_test {
"Harrier",
],
libs: [
- "android.test.base",
- "android.test.mock",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
"unsupportedappusage",
],
resource_dirs: [],
diff --git a/packages/Shell/tests/Android.bp b/packages/Shell/tests/Android.bp
index 0dc331478997..6399ffdfdf2f 100644
--- a/packages/Shell/tests/Android.bp
+++ b/packages/Shell/tests/Android.bp
@@ -11,9 +11,9 @@ android_test {
name: "ShellTests",
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
static_libs: [
"androidx.test.rules",
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
index fde7c2caca06..1eae218ffed9 100644
--- a/packages/SystemUI/Android.bp
+++ b/packages/SystemUI/Android.bp
@@ -725,9 +725,9 @@ android_library {
"androidx.test.rules",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
"keepanno-annotations",
],
kotlincflags: ["-Xjvm-default=all"],
@@ -820,9 +820,9 @@ android_robolectric_test {
"RoboTestLibraries",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
"truth",
],
@@ -892,9 +892,9 @@ android_ravenwood_test {
"mockito-kotlin-nodeps",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
auto_gen_config: true,
plugins: [
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/tests/Android.bp b/packages/SystemUI/accessibility/accessibilitymenu/tests/Android.bp
index 395354ef8f20..2ef6bbb34987 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/tests/Android.bp
+++ b/packages/SystemUI/accessibility/accessibilitymenu/tests/Android.bp
@@ -24,8 +24,8 @@ android_test {
use_resource_processor: true,
certificate: "platform",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"androidx.test.core",
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MultiPointerDraggableTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MultiPointerDraggableTest.kt
index 1a0740b54892..60237d018b02 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MultiPointerDraggableTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MultiPointerDraggableTest.kt
@@ -346,6 +346,9 @@ class MultiPointerDraggableTest {
continueDraggingDown()
assertThat(stopped).isTrue()
+
+ // Complete the gesture
+ rule.onRoot().performTouchInput { up() }
}
@Test
diff --git a/packages/SystemUI/res-keyguard/values-as/strings.xml b/packages/SystemUI/res-keyguard/values-as/strings.xml
index 8ac43e1955bd..4ed7e27ff732 100644
--- a/packages/SystemUI/res-keyguard/values-as/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-as/strings.xml
@@ -27,7 +27,7 @@
<string name="keyguard_enter_your_password" msgid="7225626204122735501">"আপোনাৰ পাছৱর্ড দিয়ক"</string>
<string name="keyguard_enter_password" msgid="6483623792371009758">"পাছৱৰ্ড দিয়ক"</string>
<string name="keyguard_sim_error_message_short" msgid="633630844240494070">"ব্যৱহাৰৰ অযোগ্য ছিম কাৰ্ড"</string>
- <string name="keyguard_charged" msgid="5478247181205188995">"চাৰ্জ কৰা হ’ল"</string>
+ <string name="keyguard_charged" msgid="5478247181205188995">"চ্চার্জ কৰা হ’ল"</string>
<string name="keyguard_plugged_in_wireless" msgid="2537874724955057383">"<xliff:g id="PERCENTAGE">%s</xliff:g> • বেতাঁৰৰ জৰিয়তে চাৰ্জ কৰি থকা হৈছে"</string>
<string name="keyguard_plugged_in_dock" msgid="2122073051904360987">"<xliff:g id="PERCENTAGE">%s</xliff:g> • চাৰ্জ কৰি থকা হৈছে"</string>
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • চ্চার্জ কৰি থকা হৈছে"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ja/strings.xml b/packages/SystemUI/res-keyguard/values-ja/strings.xml
index 7c91dafb857d..9752eca46a97 100644
--- a/packages/SystemUI/res-keyguard/values-ja/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ja/strings.xml
@@ -34,7 +34,7 @@
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 急速充電中"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 低速充電中"</string>
<string name="keyguard_plugged_in_charging_limited" msgid="5369697538556777542">"<xliff:g id="PERCENTAGE">%s</xliff:g> • バッテリーを保護するため、充電を一時停止しています"</string>
- <string name="keyguard_plugged_in_incompatible_charger" msgid="6384203333154532125">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 充電用アクセサリーを確認してください"</string>
+ <string name="keyguard_plugged_in_incompatible_charger" msgid="6384203333154532125">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 充電用アクセサリを確認してください"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"ネットワークがロックされました"</string>
<string name="keyguard_missing_sim_message_short" msgid="685029586173458728">"SIM がありません"</string>
<string name="keyguard_permanent_disabled_sim_message_short" msgid="3955052454216046100">"SIM が使用できません。"</string>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index c9126161c40f..fa3b09234589 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -62,6 +62,7 @@ import android.view.accessibility.Flags;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
+import com.android.internal.annotations.KeepForWeakReference;
import com.android.internal.os.SomeArgs;
import com.android.internal.statusbar.IAddTileResultCallback;
import com.android.internal.statusbar.IStatusBar;
@@ -191,10 +192,10 @@ public class CommandQueue extends IStatusBar.Stub implements
private static final String SHOW_IME_SWITCHER_KEY = "showImeSwitcherKey";
private final Object mLock = new Object();
- private ArrayList<Callbacks> mCallbacks = new ArrayList<>();
- private Handler mHandler = new H(Looper.getMainLooper());
+ private final ArrayList<Callbacks> mCallbacks = new ArrayList<>();
+ private final Handler mHandler = new H(Looper.getMainLooper());
/** A map of display id - disable flag pair */
- private SparseArray<Pair<Integer, Integer>> mDisplayDisabled = new SparseArray<>();
+ private final SparseArray<Pair<Integer, Integer>> mDisplayDisabled = new SparseArray<>();
/**
* The last ID of the display where IME window for which we received setImeWindowStatus
* event.
@@ -205,6 +206,21 @@ public class CommandQueue extends IStatusBar.Stub implements
private final @Nullable DumpHandler mDumpHandler;
private final @Nullable Lazy<PowerInteractor> mPowerInteractor;
+ @KeepForWeakReference
+ private final DisplayTracker.Callback mDisplayTrackerCallback = new DisplayTracker.Callback() {
+ @Override
+ public void onDisplayRemoved(int displayId) {
+ synchronized (mLock) {
+ mDisplayDisabled.remove(displayId);
+ }
+ // This callback is registered with {@link #mHandler} that already posts to run on
+ // main thread, so it is safe to dispatch directly.
+ for (int i = mCallbacks.size() - 1; i >= 0; i--) {
+ mCallbacks.get(i).onDisplayRemoved(displayId);
+ }
+ }
+ };
+
/**
* These methods are called back on the main thread.
*/
@@ -574,19 +590,8 @@ public class CommandQueue extends IStatusBar.Stub implements
mDisplayTracker = displayTracker;
mRegistry = registry;
mDumpHandler = dumpHandler;
- mDisplayTracker.addDisplayChangeCallback(new DisplayTracker.Callback() {
- @Override
- public void onDisplayRemoved(int displayId) {
- synchronized (mLock) {
- mDisplayDisabled.remove(displayId);
- }
- // This callback is registered with {@link #mHandler} that already posts to run on
- // main thread, so it is safe to dispatch directly.
- for (int i = mCallbacks.size() - 1; i >= 0; i--) {
- mCallbacks.get(i).onDisplayRemoved(displayId);
- }
- }
- }, new HandlerExecutor(mHandler));
+ mDisplayTracker.addDisplayChangeCallback(mDisplayTrackerCallback,
+ new HandlerExecutor(mHandler));
// We always have default display.
setDisabled(mDisplayTracker.getDefaultDisplayId(), DISABLE_NONE, DISABLE2_NONE);
mPowerInteractor = powerInteractor;
diff --git a/packages/SystemUI/tests/Android.bp b/packages/SystemUI/tests/Android.bp
index f601387d0910..3e7596ccabf0 100644
--- a/packages/SystemUI/tests/Android.bp
+++ b/packages/SystemUI/tests/Android.bp
@@ -35,9 +35,9 @@ android_test {
"libstaticjvmtiagent",
],
libs: [
- "android.test.runner",
+ "android.test.runner.stubs.system",
"telephony-common",
- "android.test.base",
+ "android.test.base.stubs.system",
],
aaptflags: [
"--extra-packages com.android.systemui",
diff --git a/packages/VpnDialogs/tests/Android.bp b/packages/VpnDialogs/tests/Android.bp
index 68639bd1c4fe..409282efb714 100644
--- a/packages/VpnDialogs/tests/Android.bp
+++ b/packages/VpnDialogs/tests/Android.bp
@@ -22,8 +22,8 @@ android_test {
// (e.g. VpnManager#prepareVpn()).
certificate: "platform",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"androidx.test.core",
diff --git a/packages/WAPPushManager/tests/Android.bp b/packages/WAPPushManager/tests/Android.bp
index 0a179383fab6..973100248a2b 100644
--- a/packages/WAPPushManager/tests/Android.bp
+++ b/packages/WAPPushManager/tests/Android.bp
@@ -26,9 +26,9 @@ package {
android_test {
name: "WAPPushManagerTests",
libs: [
- "android.test.runner",
+ "android.test.runner.stubs.system",
"telephony-common",
- "android.test.base",
+ "android.test.base.stubs.system",
],
static_libs: ["junit"],
// Include all test java files.
diff --git a/packages/WallpaperBackup/Android.bp b/packages/WallpaperBackup/Android.bp
index 18f783146c72..b8e0d427f3d8 100644
--- a/packages/WallpaperBackup/Android.bp
+++ b/packages/WallpaperBackup/Android.bp
@@ -42,8 +42,8 @@ android_test {
"test/src/**/*.java",
],
libs: [
- "android.test.base",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
static_libs: [
"androidx.test.core",
diff --git a/packages/overlays/tests/Android.bp b/packages/overlays/tests/Android.bp
index 0244c0fe0533..8bbe60059d45 100644
--- a/packages/overlays/tests/Android.bp
+++ b/packages/overlays/tests/Android.bp
@@ -26,8 +26,8 @@ android_test {
certificate: "platform",
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
platform_apis: true,
static_libs: [
diff --git a/ravenwood/Android.bp b/ravenwood/Android.bp
index 4faf03c395f3..ea588b56f3ab 100644
--- a/ravenwood/Android.bp
+++ b/ravenwood/Android.bp
@@ -155,13 +155,12 @@ java_library {
"ravenwood-runtime-common",
],
libs: [
- "android.test.mock",
+ "android.test.mock.impl",
"framework-minus-apex.ravenwood",
"ravenwood-framework",
"services.core.ravenwood",
"junit",
],
- sdk_version: "core_current",
visibility: ["//frameworks/base"],
jarjar_rules: ":ravenwood-services-jarjar-rules",
}
diff --git a/ravenwood/mockito/Android.bp b/ravenwood/mockito/Android.bp
index 95c7394b19f3..d91537bbc334 100644
--- a/ravenwood/mockito/Android.bp
+++ b/ravenwood/mockito/Android.bp
@@ -21,9 +21,9 @@ android_ravenwood_test {
"truth",
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
auto_gen_config: true,
}
@@ -48,9 +48,9 @@ android_test {
"mockito-target-extended-minus-junit4",
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
jni_libs: [
// Required by mockito
diff --git a/sax/tests/saxtests/Android.bp b/sax/tests/saxtests/Android.bp
index 446ee9394179..29c742f47868 100644
--- a/sax/tests/saxtests/Android.bp
+++ b/sax/tests/saxtests/Android.bp
@@ -12,8 +12,8 @@ android_test {
// Include all test java files.
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"junit",
diff --git a/services/foldables/devicestateprovider/tests/Android.bp b/services/foldables/devicestateprovider/tests/Android.bp
index 84a6df38e0a0..4352c15879e1 100644
--- a/services/foldables/devicestateprovider/tests/Android.bp
+++ b/services/foldables/devicestateprovider/tests/Android.bp
@@ -6,9 +6,9 @@ android_test {
name: "foldable-device-state-provider-tests",
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
jni_libs: [
"libdexmakerjvmtiagent",
diff --git a/services/tests/InputMethodSystemServerTests/Android.bp b/services/tests/InputMethodSystemServerTests/Android.bp
index 73ebeba0c436..142e4664c0ee 100644
--- a/services/tests/InputMethodSystemServerTests/Android.bp
+++ b/services/tests/InputMethodSystemServerTests/Android.bp
@@ -50,9 +50,9 @@ android_test {
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
data: [
@@ -79,8 +79,8 @@ android_ravenwood_test {
"services",
],
libs: [
- "android.test.base",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
srcs: [
"src/com/android/server/inputmethod/**/ClientControllerTest.java",
@@ -122,9 +122,9 @@ android_test {
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
data: [
diff --git a/services/tests/PackageManagerServiceTests/host/test-apps/DeviceSide/Android.bp b/services/tests/PackageManagerServiceTests/host/test-apps/DeviceSide/Android.bp
index 73cec6c13d6d..71ada2e973ce 100644
--- a/services/tests/PackageManagerServiceTests/host/test-apps/DeviceSide/Android.bp
+++ b/services/tests/PackageManagerServiceTests/host/test-apps/DeviceSide/Android.bp
@@ -29,7 +29,7 @@ android_test_helper_app {
sdk_version: "test_current",
srcs: ["src/**/*.kt"],
libs: [
- "android.test.base",
+ "android.test.base.stubs.test",
],
static_libs: [
"androidx.annotation_annotation",
diff --git a/services/tests/PackageManagerServiceTests/server/Android.bp b/services/tests/PackageManagerServiceTests/server/Android.bp
index 907d3cdad63f..1da7e1100a43 100644
--- a/services/tests/PackageManagerServiceTests/server/Android.bp
+++ b/services/tests/PackageManagerServiceTests/server/Android.bp
@@ -65,9 +65,9 @@ android_test {
"android.hardware.tv.cec-V1.0-java",
"android.hardware.vibrator-V2-java",
"android.hidl.manager-V1.0-java",
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
platform_apis: true,
diff --git a/services/tests/VpnTests/Android.bp b/services/tests/VpnTests/Android.bp
index a5011a8d8b00..ee20f1a105a4 100644
--- a/services/tests/VpnTests/Android.bp
+++ b/services/tests/VpnTests/Android.bp
@@ -38,8 +38,8 @@ android_test {
"framework-connectivity-t.impl",
"framework",
"framework-res",
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs",
+ "android.test.base.stubs",
+ "android.test.mock.stubs",
],
}
diff --git a/services/tests/displayservicetests/Android.bp b/services/tests/displayservicetests/Android.bp
index 61350bf24868..fe73025e9736 100644
--- a/services/tests/displayservicetests/Android.bp
+++ b/services/tests/displayservicetests/Android.bp
@@ -16,7 +16,7 @@ android_test {
],
libs: [
- "android.test.mock",
+ "android.test.mock.stubs.system",
],
static_libs: [
diff --git a/services/tests/mockingservicestests/Android.bp b/services/tests/mockingservicestests/Android.bp
index 01435ff7f253..6fc80b836521 100644
--- a/services/tests/mockingservicestests/Android.bp
+++ b/services/tests/mockingservicestests/Android.bp
@@ -80,9 +80,9 @@ android_test {
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
"servicestests-core-utils",
],
@@ -118,14 +118,14 @@ java_library {
"mockito-target-extended-minus-junit4",
],
libs: [
- "android.test.runner",
+ "android.test.runner.stubs.system",
],
}
android_ravenwood_test {
name: "FrameworksMockingServicesTestsRavenwood",
libs: [
- "android.test.mock",
+ "android.test.mock.stubs.system",
],
static_libs: [
"androidx.annotation_annotation",
diff --git a/services/tests/mockingservicestests/src/com/android/server/rollback/Android.bp b/services/tests/mockingservicestests/src/com/android/server/rollback/Android.bp
index 6a16d1e14795..677ecf47355d 100644
--- a/services/tests/mockingservicestests/src/com/android/server/rollback/Android.bp
+++ b/services/tests/mockingservicestests/src/com/android/server/rollback/Android.bp
@@ -37,9 +37,9 @@ android_test {
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
jni_libs: [
diff --git a/services/tests/powerservicetests/Android.bp b/services/tests/powerservicetests/Android.bp
index f8cc6d0fedb6..f03043ea0ae0 100644
--- a/services/tests/powerservicetests/Android.bp
+++ b/services/tests/powerservicetests/Android.bp
@@ -23,7 +23,7 @@ android_test {
],
libs: [
- "android.test.mock",
+ "android.test.mock.stubs.system",
],
defaults: [
diff --git a/services/tests/powerstatstests/Android.bp b/services/tests/powerstatstests/Android.bp
index beaafdd84ca3..cedf9dbe734f 100644
--- a/services/tests/powerstatstests/Android.bp
+++ b/services/tests/powerstatstests/Android.bp
@@ -30,7 +30,7 @@ android_test {
],
libs: [
- "android.test.base",
+ "android.test.base.stubs.system",
],
resource_dirs: ["res/"],
diff --git a/services/tests/servicestests/Android.bp b/services/tests/servicestests/Android.bp
index 46c343353a2a..b4ccba6543d3 100644
--- a/services/tests/servicestests/Android.bp
+++ b/services/tests/servicestests/Android.bp
@@ -95,9 +95,9 @@ android_test {
"android.hardware.tv.cec-V1.0-java",
"android.hardware.vibrator-V2-java",
"android.hidl.manager-V1.0-java",
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
platform_apis: true,
@@ -151,7 +151,7 @@ android_test {
android_ravenwood_test {
name: "FrameworksServicesTestsRavenwood",
libs: [
- "android.test.mock",
+ "android.test.mock.stubs.system",
],
static_libs: [
"androidx.annotation_annotation",
@@ -191,8 +191,8 @@ java_library {
"src/com/android/server/devicepolicy/MockUtils.java",
],
libs: [
- "android.test.mock",
- "android.test.base",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
"mockito-target-minus-junit4",
],
static_libs: [
@@ -217,7 +217,7 @@ java_library {
"mockito-target-minus-junit4",
],
libs: [
- "android.test.runner",
+ "android.test.runner.stubs.system",
],
}
@@ -243,7 +243,7 @@ java_library {
"mockito-target-extended-minus-junit4",
],
libs: [
- "android.test.runner",
+ "android.test.runner.stubs.system",
],
}
diff --git a/services/tests/timetests/Android.bp b/services/tests/timetests/Android.bp
index 05a1433c128e..aae6acc7c53a 100644
--- a/services/tests/timetests/Android.bp
+++ b/services/tests/timetests/Android.bp
@@ -20,7 +20,7 @@ android_test {
"services.core",
"truth",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
test_suites: ["device-tests"],
diff --git a/services/tests/uiservicestests/Android.bp b/services/tests/uiservicestests/Android.bp
index e6cf0c38a10c..850d2f7f36a5 100644
--- a/services/tests/uiservicestests/Android.bp
+++ b/services/tests/uiservicestests/Android.bp
@@ -54,9 +54,9 @@ android_test {
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
dxflags: ["--multi-dex"],
diff --git a/services/tests/vibrator/Android.bp b/services/tests/vibrator/Android.bp
index da21cd3cf919..9a727eb7603e 100644
--- a/services/tests/vibrator/Android.bp
+++ b/services/tests/vibrator/Android.bp
@@ -17,9 +17,9 @@ android_test {
libs: [
"android.hardware.vibrator-V2-java",
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
static_libs: [
diff --git a/services/tests/voiceinteractiontests/Android.bp b/services/tests/voiceinteractiontests/Android.bp
index 8c70851f87df..5fbf02cfc984 100644
--- a/services/tests/voiceinteractiontests/Android.bp
+++ b/services/tests/voiceinteractiontests/Android.bp
@@ -49,9 +49,9 @@ android_test {
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
certificate: "platform",
diff --git a/services/tests/wmtests/Android.bp b/services/tests/wmtests/Android.bp
index 4bdd375bd590..76ff23188632 100644
--- a/services/tests/wmtests/Android.bp
+++ b/services/tests/wmtests/Android.bp
@@ -75,9 +75,9 @@ android_test {
libs: [
"android.hardware.power-V1-java",
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
defaults: [
diff --git a/test-runner/Android.bp b/test-runner/Android.bp
index 6b5be3cba204..bb2c4d97c87a 100644
--- a/test-runner/Android.bp
+++ b/test-runner/Android.bp
@@ -32,14 +32,28 @@ java_sdk_library {
javacflags: ["-Xep:DepAnn:ERROR"],
},
- libs: [
- "android.test.base",
- "android.test.mock",
- ],
- stub_only_libs: [
- "android.test.base",
- "android.test.mock",
+ impl_only_libs: [
+ "android.test.base.impl",
+ "android.test.mock.impl",
],
+ public: {
+ libs: [
+ "android.test.base.stubs",
+ "android.test.mock.stubs",
+ ],
+ },
+ system: {
+ libs: [
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
+ ],
+ },
+ test: {
+ libs: [
+ "android.test.base.stubs.test",
+ "android.test.mock.stubs.test",
+ ],
+ },
api_packages: [
"android.test",
"android.test.suitebuilder",
@@ -64,7 +78,7 @@ java_library {
sdk_version: "current",
libs: [
"android.test.base_static",
- "android.test.mock",
+ "android.test.mock.stubs",
"junit",
],
}
diff --git a/test-runner/tests/Android.bp b/test-runner/tests/Android.bp
index 0c0c0805f2d3..39f41ed7f667 100644
--- a/test-runner/tests/Android.bp
+++ b/test-runner/tests/Android.bp
@@ -30,8 +30,8 @@ android_test {
libs: [
"android.test.runner.impl",
- "android.test.base",
- "android.test.mock",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
static_libs: [
"junit",
diff --git a/tests/AppLaunch/Android.bp b/tests/AppLaunch/Android.bp
index f838c5a80c28..90a00fe6083e 100644
--- a/tests/AppLaunch/Android.bp
+++ b/tests/AppLaunch/Android.bp
@@ -14,11 +14,12 @@ android_test {
platform_apis: true,
certificate: "platform",
libs: [
- "android.test.base",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
static_libs: [
"androidx.test.rules",
- "ub-uiautomator"],
+ "ub-uiautomator",
+ ],
test_suites: ["device-tests"],
}
diff --git a/tests/AttestationVerificationTest/Android.bp b/tests/AttestationVerificationTest/Android.bp
index b98f8cb0c21d..5f0908959ed5 100644
--- a/tests/AttestationVerificationTest/Android.bp
+++ b/tests/AttestationVerificationTest/Android.bp
@@ -32,8 +32,8 @@ android_test {
},
test_suites: ["device-tests"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"compatibility-device-util-axt",
diff --git a/tests/BrowserPowerTest/Android.bp b/tests/BrowserPowerTest/Android.bp
index a8a9897c0e86..100e975b4d5e 100644
--- a/tests/BrowserPowerTest/Android.bp
+++ b/tests/BrowserPowerTest/Android.bp
@@ -24,8 +24,8 @@ package {
android_test {
name: "BrowserPowerTests",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: ["junit"],
// Include all test java files.
diff --git a/tests/Camera2Tests/SmartCamera/SimpleCamera/tests/Android.bp b/tests/Camera2Tests/SmartCamera/SimpleCamera/tests/Android.bp
index 5edb1de9586e..4aeca5b04602 100644
--- a/tests/Camera2Tests/SmartCamera/SimpleCamera/tests/Android.bp
+++ b/tests/Camera2Tests/SmartCamera/SimpleCamera/tests/Android.bp
@@ -24,7 +24,7 @@ android_test {
name: "SmartCamera-tests",
platform_apis: true,
srcs: ["src/**/*.java"],
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs.system"],
static_libs: [
"guava",
"junit",
diff --git a/tests/ChoreographerTests/Android.bp b/tests/ChoreographerTests/Android.bp
index 3f48d70d659f..69a9d180bfd3 100644
--- a/tests/ChoreographerTests/Android.bp
+++ b/tests/ChoreographerTests/Android.bp
@@ -26,8 +26,8 @@ android_test {
name: "ChoreographerTests",
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"androidx.test.core",
diff --git a/tests/CompanionDeviceMultiDeviceTests/client/Android.bp b/tests/CompanionDeviceMultiDeviceTests/client/Android.bp
index 9994826d061a..ce63fe89fe2e 100644
--- a/tests/CompanionDeviceMultiDeviceTests/client/Android.bp
+++ b/tests/CompanionDeviceMultiDeviceTests/client/Android.bp
@@ -40,8 +40,8 @@ android_test {
"mobly-snippet-lib",
],
libs: [
- "android.test.base",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
optimize: {
diff --git a/tests/CoreTests/android/Android.bp b/tests/CoreTests/android/Android.bp
index 97a6e5fd4d1b..85e951e099ce 100644
--- a/tests/CoreTests/android/Android.bp
+++ b/tests/CoreTests/android/Android.bp
@@ -12,7 +12,7 @@ android_test {
srcs: ["**/*.java"],
libs: [
"android.test.runner.stubs",
- "org.apache.http.legacy",
+ "org.apache.http.legacy.stubs",
"android.test.base.stubs",
],
sdk_version: "current",
diff --git a/tests/CtsSurfaceControlTestsStaging/Android.bp b/tests/CtsSurfaceControlTestsStaging/Android.bp
index 1038c9e93931..8d93b28b9acb 100644
--- a/tests/CtsSurfaceControlTestsStaging/Android.bp
+++ b/tests/CtsSurfaceControlTestsStaging/Android.bp
@@ -28,8 +28,8 @@ android_test {
name: "CtsSurfaceControlTestsStaging",
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"androidx.test.core",
diff --git a/tests/DataIdleTest/Android.bp b/tests/DataIdleTest/Android.bp
index f9509cc9a4bf..8839df664abf 100644
--- a/tests/DataIdleTest/Android.bp
+++ b/tests/DataIdleTest/Android.bp
@@ -27,8 +27,8 @@ android_test {
name: "DataIdleTest",
platform_apis: true,
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: ["junit"],
srcs: ["src/**/*.java"],
diff --git a/tests/EnforcePermission/perf-app/Android.bp b/tests/EnforcePermission/perf-app/Android.bp
index 6d04fdc821bb..dbafd739c7bc 100644
--- a/tests/EnforcePermission/perf-app/Android.bp
+++ b/tests/EnforcePermission/perf-app/Android.bp
@@ -32,8 +32,8 @@ android_test {
"androidx.test.rules",
],
libs: [
- "android.test.base",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
data: [
":EnforcePermissionTestHelper",
diff --git a/tests/EnforcePermission/test-app/Android.bp b/tests/EnforcePermission/test-app/Android.bp
index 065ab33448e3..64f850b1e147 100644
--- a/tests/EnforcePermission/test-app/Android.bp
+++ b/tests/EnforcePermission/test-app/Android.bp
@@ -27,8 +27,8 @@ android_test {
"androidx.test.rules",
],
libs: [
- "android.test.base",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
data: [
":EnforcePermissionTestHelper",
diff --git a/tests/FlickerTests/Android.bp b/tests/FlickerTests/Android.bp
index d658d5991a57..27e9ffa4cea5 100644
--- a/tests/FlickerTests/Android.bp
+++ b/tests/FlickerTests/Android.bp
@@ -31,7 +31,7 @@ java_defaults {
enabled: false,
},
test_suites: ["device-tests"],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
static_libs: [
"androidx.test.ext.junit",
"flickertestapplib",
diff --git a/tests/FrameworkPerf/Android.bp b/tests/FrameworkPerf/Android.bp
index 9be3ab795b86..4e39fe1c5e4a 100644
--- a/tests/FrameworkPerf/Android.bp
+++ b/tests/FrameworkPerf/Android.bp
@@ -12,8 +12,8 @@ android_test {
srcs: ["**/*.java"],
platform_apis: true,
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: ["junit"],
aaptflags: [
diff --git a/tests/GamePerformance/Android.bp b/tests/GamePerformance/Android.bp
index f250a1bbdaca..964f0b914c65 100644
--- a/tests/GamePerformance/Android.bp
+++ b/tests/GamePerformance/Android.bp
@@ -33,8 +33,8 @@ android_test_helper_app {
srcs: ["src/**/*.java"],
static_libs: ["androidx.test.rules"],
libs: [
- "android.test.base",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
platform_apis: true,
certificate: "platform",
diff --git a/tests/Input/Android.bp b/tests/Input/Android.bp
index f367c38b06e9..084f9bd6d682 100644
--- a/tests/Input/Android.bp
+++ b/tests/Input/Android.bp
@@ -50,8 +50,8 @@ android_test {
"truth",
],
libs: [
- "android.test.mock",
- "android.test.base",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
],
test_suites: ["device-tests"],
}
diff --git a/tests/InputMethodStressTest/Android.bp b/tests/InputMethodStressTest/Android.bp
index 5ed8d8d528c4..2697d32dd622 100644
--- a/tests/InputMethodStressTest/Android.bp
+++ b/tests/InputMethodStressTest/Android.bp
@@ -20,7 +20,7 @@ package {
android_test {
name: "InputMethodStressTest",
srcs: ["src/**/*.java"],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs"],
static_libs: [
"androidx.test.ext.junit",
"androidx.test.uiautomator_uiautomator",
diff --git a/tests/InputScreenshotTest/Android.bp b/tests/InputScreenshotTest/Android.bp
index 927b101012c5..12ab550c2da2 100644
--- a/tests/InputScreenshotTest/Android.bp
+++ b/tests/InputScreenshotTest/Android.bp
@@ -67,8 +67,8 @@ android_test {
"truth",
],
libs: [
- "android.test.mock",
- "android.test.base",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
],
test_suites: ["device-tests"],
compile_multilib: "both",
diff --git a/tests/InputScreenshotTest/robotests/Android.bp b/tests/InputScreenshotTest/robotests/Android.bp
index d63fd69ae4d9..b2414a85c095 100644
--- a/tests/InputScreenshotTest/robotests/Android.bp
+++ b/tests/InputScreenshotTest/robotests/Android.bp
@@ -61,9 +61,9 @@ android_robolectric_test {
"uiautomator-helpers",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
"truth",
],
upstream: true,
diff --git a/tests/Internal/Android.bp b/tests/Internal/Android.bp
index 827ff4fbd989..bb4e1ec9b6f2 100644
--- a/tests/Internal/Android.bp
+++ b/tests/Internal/Android.bp
@@ -14,7 +14,7 @@ android_test {
},
// Include some source files directly to be able to access package members
srcs: ["src/**/*.java"],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
static_libs: [
"junit",
"androidx.test.rules",
diff --git a/tests/LocalizationTest/Android.bp b/tests/LocalizationTest/Android.bp
index 909ca5972552..5d9901bb4d0d 100644
--- a/tests/LocalizationTest/Android.bp
+++ b/tests/LocalizationTest/Android.bp
@@ -25,9 +25,9 @@ android_test {
name: "LocalizationTest",
srcs: ["java/**/*.kt"],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
static_libs: [
"androidx.test.core",
diff --git a/tests/MemoryUsage/Android.bp b/tests/MemoryUsage/Android.bp
index e30a0a7cd8b5..deb46636e5b2 100644
--- a/tests/MemoryUsage/Android.bp
+++ b/tests/MemoryUsage/Android.bp
@@ -14,8 +14,8 @@ android_test {
platform_apis: true,
certificate: "platform",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: ["junit"],
}
diff --git a/tests/MultiUser/Android.bp b/tests/MultiUser/Android.bp
index bde309fe3015..e4d9f02b3d02 100644
--- a/tests/MultiUser/Android.bp
+++ b/tests/MultiUser/Android.bp
@@ -18,9 +18,9 @@ android_test {
"services.core",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
certificate: "platform",
test_suites: ["device-tests"],
diff --git a/tests/NetworkSecurityConfigTest/Android.bp b/tests/NetworkSecurityConfigTest/Android.bp
index 473eadbcad73..4c48eaa4622e 100644
--- a/tests/NetworkSecurityConfigTest/Android.bp
+++ b/tests/NetworkSecurityConfigTest/Android.bp
@@ -11,8 +11,8 @@ android_test {
name: "NetworkSecurityConfigTests",
certificate: "platform",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: ["junit"],
// Include all test java files.
diff --git a/tests/OneMedia/Android.bp b/tests/OneMedia/Android.bp
index a43cd39f0dcb..a1817ccb662a 100644
--- a/tests/OneMedia/Android.bp
+++ b/tests/OneMedia/Android.bp
@@ -15,7 +15,7 @@ android_app {
],
platform_apis: true,
certificate: "platform",
- libs: ["org.apache.http.legacy"],
+ libs: ["org.apache.http.legacy.stubs.system"],
optional_uses_libs: ["org.apache.http.legacy"],
optimize: {
enabled: false,
diff --git a/tests/PackageWatchdog/Android.bp b/tests/PackageWatchdog/Android.bp
index 2c5fdd3228ed..096555eb3056 100644
--- a/tests/PackageWatchdog/Android.bp
+++ b/tests/PackageWatchdog/Android.bp
@@ -36,7 +36,7 @@ android_test {
"services.net",
"truth",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
jni_libs: [
// mockito-target-extended dependencies
"libdexmakerjvmtiagent",
diff --git a/tests/ProtoInputStreamTests/Android.bp b/tests/ProtoInputStreamTests/Android.bp
index 0029080b5a89..40ab257fef37 100644
--- a/tests/ProtoInputStreamTests/Android.bp
+++ b/tests/ProtoInputStreamTests/Android.bp
@@ -33,7 +33,7 @@ android_test {
platform_apis: true,
certificate: "platform",
test_suites: ["device-tests"],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
static_libs: [
"androidx.test.rules",
"frameworks-base-testutils",
diff --git a/tests/RemoteDisplayProvider/Android.bp b/tests/RemoteDisplayProvider/Android.bp
index 55732d14af46..468bdda75713 100644
--- a/tests/RemoteDisplayProvider/Android.bp
+++ b/tests/RemoteDisplayProvider/Android.bp
@@ -27,6 +27,6 @@ android_test {
sdk_version: "system_current",
srcs: ["src/**/*.java"],
resource_dirs: ["res"],
- libs: ["com.android.media.remotedisplay"],
+ libs: ["com.android.media.remotedisplay.stubs.system"],
certificate: "platform",
}
diff --git a/tests/ServiceCrashTest/Android.bp b/tests/ServiceCrashTest/Android.bp
index fb98b7631b7e..82f397ffe259 100644
--- a/tests/ServiceCrashTest/Android.bp
+++ b/tests/ServiceCrashTest/Android.bp
@@ -13,7 +13,7 @@ android_test {
srcs: ["src/**/*.java"],
platform_apis: true,
certificate: "platform",
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs.system"],
static_libs: [
"compatibility-device-util-axt",
"androidx.test.rules",
diff --git a/tests/SharedLibraryLoadingTest/test-apps/SharedLibraryClientTests/Android.bp b/tests/SharedLibraryLoadingTest/test-apps/SharedLibraryClientTests/Android.bp
index 0d204979cb92..c0ac50c962f2 100644
--- a/tests/SharedLibraryLoadingTest/test-apps/SharedLibraryClientTests/Android.bp
+++ b/tests/SharedLibraryLoadingTest/test-apps/SharedLibraryClientTests/Android.bp
@@ -23,7 +23,7 @@ android_test_helper_app {
libs: [
"SharedLibraryLoadingTests_StandardSharedLibrary",
"SharedLibraryLoadingTests_SharedLibraryLoadedAfter",
- "android.test.base",
+ "android.test.base.stubs.system",
],
static_libs: [
"androidx.test.ext.junit",
diff --git a/tests/TelephonyCommonTests/Android.bp b/tests/TelephonyCommonTests/Android.bp
index b968e5d81148..b1af6aed27a0 100644
--- a/tests/TelephonyCommonTests/Android.bp
+++ b/tests/TelephonyCommonTests/Android.bp
@@ -50,9 +50,9 @@ android_test {
platform_apis: true,
libs: [
- "android.test.runner",
- "android.test.mock",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
"unsupportedappusage",
],
}
diff --git a/tests/TrustTests/Android.bp b/tests/TrustTests/Android.bp
index 8888b32d2c69..f22feb3f88fa 100644
--- a/tests/TrustTests/Android.bp
+++ b/tests/TrustTests/Android.bp
@@ -31,8 +31,8 @@ android_test {
"truth",
],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
test_suites: [
"device-tests",
diff --git a/tests/TtsTests/Android.bp b/tests/TtsTests/Android.bp
index b7aa5d4a38aa..e28f69b78141 100644
--- a/tests/TtsTests/Android.bp
+++ b/tests/TtsTests/Android.bp
@@ -28,8 +28,8 @@ android_test {
srcs: ["**/*.java"],
static_libs: ["mockito-target"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
platform_apis: true,
}
diff --git a/tests/UpdatableSystemFontTest/Android.bp b/tests/UpdatableSystemFontTest/Android.bp
index 12d43383a6e2..34eff4f4579b 100644
--- a/tests/UpdatableSystemFontTest/Android.bp
+++ b/tests/UpdatableSystemFontTest/Android.bp
@@ -25,7 +25,7 @@ package {
android_test {
name: "UpdatableSystemFontTest",
srcs: ["src/**/*.java"],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.test"],
static_libs: [
"androidx.test.ext.junit",
"androidx.test.uiautomator_uiautomator",
diff --git a/tests/UsbManagerTests/lib/Android.bp b/tests/UsbManagerTests/lib/Android.bp
index 4e5a70fef0ca..506de5c26e3b 100644
--- a/tests/UsbManagerTests/lib/Android.bp
+++ b/tests/UsbManagerTests/lib/Android.bp
@@ -38,6 +38,6 @@ android_library {
"androidx.core_core",
],
libs: [
- "android.test.mock",
+ "android.test.mock.stubs.system",
],
}
diff --git a/tests/inputmethod/ConcurrentMultiSessionImeTest/Android.bp b/tests/inputmethod/ConcurrentMultiSessionImeTest/Android.bp
index 4c531b8f9ee0..b68937f268e2 100644
--- a/tests/inputmethod/ConcurrentMultiSessionImeTest/Android.bp
+++ b/tests/inputmethod/ConcurrentMultiSessionImeTest/Android.bp
@@ -21,7 +21,7 @@ android_test {
name: "ConcurrentMultiSessionImeTest",
srcs: ["src/**/*.java"],
resource_dirs: ["res"],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs"],
static_libs: [
"androidx.test.ext.junit",
"androidx.test.rules",
diff --git a/tests/permission/Android.bp b/tests/permission/Android.bp
index b02f410c733e..d80eaeb32c1e 100644
--- a/tests/permission/Android.bp
+++ b/tests/permission/Android.bp
@@ -12,8 +12,8 @@ android_test {
// Include all test java files.
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
"telephony-common",
],
static_libs: [
diff --git a/tests/testables/Android.bp b/tests/testables/Android.bp
index c0e3d630d1ab..7596ee722d01 100644
--- a/tests/testables/Android.bp
+++ b/tests/testables/Android.bp
@@ -27,8 +27,8 @@ java_library {
name: "testables",
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.mock.stubs.system",
"androidx.test.rules",
"mockito-target-inline-minus-junit4",
],
diff --git a/tests/testables/tests/Android.bp b/tests/testables/tests/Android.bp
index 06449e0ce574..2a3e4ae0c039 100644
--- a/tests/testables/tests/Android.bp
+++ b/tests/testables/tests/Android.bp
@@ -41,9 +41,9 @@ android_test {
"libmultiplejvmtiagentsinterferenceagent",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
certificate: "platform",
test_suites: [
diff --git a/tests/utils/testutils/Android.bp b/tests/utils/testutils/Android.bp
index deff42a27f47..35fd5b1e6ed0 100644
--- a/tests/utils/testutils/Android.bp
+++ b/tests/utils/testutils/Android.bp
@@ -35,9 +35,9 @@ java_library {
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
"mockito-target-extended-minus-junit4",
],
}
diff --git a/tests/utils/testutils/tests/Android.bp b/tests/utils/testutils/tests/Android.bp
index 8104280cdd5e..3bb02e42ca3b 100644
--- a/tests/utils/testutils/tests/Android.bp
+++ b/tests/utils/testutils/tests/Android.bp
@@ -35,9 +35,9 @@ android_test {
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
certificate: "platform",
diff --git a/tests/vcn/Android.bp b/tests/vcn/Android.bp
index ee2e7cfcd480..b16ba15a6867 100644
--- a/tests/vcn/Android.bp
+++ b/tests/vcn/Android.bp
@@ -34,8 +34,8 @@ android_test {
"flag-junit",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs",
+ "android.test.base.stubs",
+ "android.test.mock.stubs",
],
}
diff --git a/wifi/tests/Android.bp b/wifi/tests/Android.bp
index 1d3e4bd531b4..74a6be9baa56 100644
--- a/wifi/tests/Android.bp
+++ b/wifi/tests/Android.bp
@@ -44,8 +44,8 @@ android_test {
],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs",
+ "android.test.base.stubs",
],
// Required by Extended Mockito