android: Remove benchmark module
This commit is contained in:
parent
78d22d8003
commit
57b33e9142
|
@ -1 +0,0 @@
|
||||||
/build
|
|
|
@ -1,71 +0,0 @@
|
||||||
import com.android.build.api.dsl.ManagedVirtualDevice
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id 'com.android.test'
|
|
||||||
id 'org.jetbrains.kotlin.android'
|
|
||||||
}
|
|
||||||
|
|
||||||
android {
|
|
||||||
namespace 'com.dolphin.benchmark'
|
|
||||||
compileSdk 33
|
|
||||||
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility = "11"
|
|
||||||
targetCompatibility = "11"
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = "11"
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
minSdk 23
|
|
||||||
targetSdk 33
|
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
||||||
}
|
|
||||||
|
|
||||||
testOptions {
|
|
||||||
managedDevices {
|
|
||||||
devices {
|
|
||||||
pixel6Api31 (ManagedVirtualDevice) {
|
|
||||||
device = "Pixel 6"
|
|
||||||
apiLevel = 31
|
|
||||||
systemImageSource = "aosp"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
// This benchmark buildType is used for benchmarking, and should function like your
|
|
||||||
// release build (for example, with minification on). It's signed with a debug key
|
|
||||||
// for easy local/CI testing.
|
|
||||||
benchmark {
|
|
||||||
signingConfig signingConfigs.debug
|
|
||||||
matchingFallbacks = ['release']
|
|
||||||
debuggable true
|
|
||||||
proguardFiles getDefaultProguardFile(
|
|
||||||
'proguard-android-optimize.txt'),
|
|
||||||
'proguard-rules.pro'
|
|
||||||
minifyEnabled true
|
|
||||||
shrinkResources true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
targetProjectPath = ":app"
|
|
||||||
experimentalProperties["android.experimental.self-instrumenting"] = true
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation 'androidx.test.ext:junit:1.1.5'
|
|
||||||
implementation 'androidx.test.espresso:espresso-core:3.5.1'
|
|
||||||
implementation 'androidx.test.uiautomator:uiautomator:2.2.0'
|
|
||||||
implementation 'androidx.benchmark:benchmark-macro-junit4:1.1.1'
|
|
||||||
}
|
|
||||||
|
|
||||||
androidComponents {
|
|
||||||
beforeVariants(selector().all()) {
|
|
||||||
enabled = buildType == "benchmark"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<queries>
|
|
||||||
<package android:name="org.dolphinemu.dolphinemu.debug" />
|
|
||||||
</queries>
|
|
||||||
</manifest>
|
|
|
@ -1,43 +0,0 @@
|
||||||
package com.dolphin.benchmark
|
|
||||||
|
|
||||||
import androidx.benchmark.macro.ExperimentalBaselineProfilesApi
|
|
||||||
import androidx.benchmark.macro.junit4.BaselineProfileRule
|
|
||||||
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
|
|
||||||
import androidx.test.uiautomator.UiSelector
|
|
||||||
import org.junit.Rule
|
|
||||||
import org.junit.Test
|
|
||||||
import org.junit.runner.RunWith
|
|
||||||
|
|
||||||
@OptIn(ExperimentalBaselineProfilesApi::class)
|
|
||||||
@RunWith(AndroidJUnit4ClassRunner::class)
|
|
||||||
class BaselineProfileGenerator {
|
|
||||||
|
|
||||||
@get:Rule
|
|
||||||
val rule = BaselineProfileRule()
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun generate() = rule.collectBaselineProfile(
|
|
||||||
packageName = "org.dolphinemu.dolphinemu.benchmark",
|
|
||||||
profileBlock = {
|
|
||||||
pressHome()
|
|
||||||
startActivityAndWait()
|
|
||||||
|
|
||||||
// Dismiss analytics dialog due to issue with finding button
|
|
||||||
device.pressBack()
|
|
||||||
|
|
||||||
// Navigate through activities that don't require games
|
|
||||||
// TODO: Make all activities testable without having games available
|
|
||||||
// TODO: Use resource strings to support more languages
|
|
||||||
|
|
||||||
// Navigate to the Settings Activity
|
|
||||||
val settings = device.findObject(UiSelector().description("Settings"))
|
|
||||||
settings.clickAndWaitForNewWindow(30_000)
|
|
||||||
|
|
||||||
// Go through settings and to the User Data Activity
|
|
||||||
val config = device.findObject(UiSelector().textContains("Config"))
|
|
||||||
config.click()
|
|
||||||
val userData = device.findObject(UiSelector().textContains("User Data"))
|
|
||||||
userData.clickAndWaitForNewWindow(30_000)
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
package com.dolphin.benchmark
|
|
||||||
|
|
||||||
import androidx.benchmark.macro.BaselineProfileMode
|
|
||||||
import androidx.benchmark.macro.CompilationMode
|
|
||||||
import androidx.benchmark.macro.StartupMode
|
|
||||||
import androidx.benchmark.macro.StartupTimingMetric
|
|
||||||
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
|
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
|
||||||
import org.junit.Rule
|
|
||||||
import org.junit.Test
|
|
||||||
import org.junit.runner.RunWith
|
|
||||||
|
|
||||||
@RunWith(AndroidJUnit4::class)
|
|
||||||
class StartupBenchmark {
|
|
||||||
@get:Rule
|
|
||||||
val benchmarkRule = MacrobenchmarkRule()
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun startupBaselineProfileDisabled() = startup(
|
|
||||||
CompilationMode.Partial(baselineProfileMode = BaselineProfileMode.Disable, warmupIterations = 1)
|
|
||||||
)
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun startupBaselineProfile() = startup(
|
|
||||||
CompilationMode.Partial(baselineProfileMode = BaselineProfileMode.Require, warmupIterations = 1)
|
|
||||||
)
|
|
||||||
|
|
||||||
private fun startup(compilationMode: CompilationMode) = benchmarkRule.measureRepeated(
|
|
||||||
packageName = "org.dolphinemu.dolphinemu.benchmark",
|
|
||||||
metrics = listOf(StartupTimingMetric()),
|
|
||||||
iterations = 10,
|
|
||||||
compilationMode = compilationMode,
|
|
||||||
startupMode = StartupMode.COLD,
|
|
||||||
setupBlock = {
|
|
||||||
pressHome()
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
startActivityAndWait()
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue