diff options
Diffstat (limited to 'benchmark/android/app')
-rw-r--r-- | benchmark/android/app/build.gradle | 52 | ||||
-rw-r--r-- | benchmark/android/app/src/androidTest/java/android/app/NativeActivityTest.java | 32 | ||||
-rw-r--r-- | benchmark/android/app/src/androidTest/java/android/app/TestState.java | 6 | ||||
-rw-r--r-- | benchmark/android/app/src/main/AndroidManifest.xml | 28 | ||||
-rw-r--r-- | benchmark/android/app/src/main/assets/to_zip.txt | 3 | ||||
-rw-r--r-- | benchmark/android/app/src/main/res/mipmap-hdpi/ic_launcher.png | bin | 0 -> 3418 bytes | |||
-rw-r--r-- | benchmark/android/app/src/main/res/mipmap-mdpi/ic_launcher.png | bin | 0 -> 2206 bytes | |||
-rw-r--r-- | benchmark/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png | bin | 0 -> 4842 bytes | |||
-rw-r--r-- | benchmark/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png | bin | 0 -> 7718 bytes | |||
-rw-r--r-- | benchmark/android/app/src/main/res/values/strings.xml | 4 |
10 files changed, 125 insertions, 0 deletions
diff --git a/benchmark/android/app/build.gradle b/benchmark/android/app/build.gradle new file mode 100644 index 0000000000..d355286585 --- /dev/null +++ b/benchmark/android/app/build.gradle @@ -0,0 +1,52 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 28 + + defaultConfig { + applicationId = 'com.mapbox.mapboxsdk.maps.benchmark_runner' + minSdkVersion 14 + targetSdkVersion 28 + def abi = 'all' + if (project.hasProperty('mapbox.abis')) { + abi = project.getProperty('mapbox.abis') + } + ndk { + if (abi != 'all') { + abiFilters abi.split(' ') + } else { + abiFilters 'armeabi-v7a', 'x86', 'arm64-v8a', 'x86_64' + } + } + externalNativeBuild { + cmake { + arguments '-DANDROID_CCACHE=ccache' + arguments '-DANDROID_STL=c++_static' + targets 'mbgl-benchmark-runner' + } + } + android { + testBuildType 'release' + } + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' + } + externalNativeBuild { + cmake { + version '3.10.2' + path '../../../next/CMakeLists.txt' + } + } + buildTypes { + release { + signingConfig signingConfigs.debug + } + } +} + +dependencies { + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + androidTestImplementation 'androidx.test:rules:1.2.0' +} diff --git a/benchmark/android/app/src/androidTest/java/android/app/NativeActivityTest.java b/benchmark/android/app/src/androidTest/java/android/app/NativeActivityTest.java new file mode 100644 index 0000000000..795ca4973a --- /dev/null +++ b/benchmark/android/app/src/androidTest/java/android/app/NativeActivityTest.java @@ -0,0 +1,32 @@ +package android.app; + +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.filters.LargeTest; +import androidx.test.rule.ActivityTestRule; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.Assert; +import org.junit.runner.RunWith; +import android.util.Log; + +@LargeTest +@RunWith(AndroidJUnit4.class) +public class NativeActivityTest { + + @Rule + public ActivityTestRule<NativeActivity> mActivityTestRule = new ActivityTestRule<>(NativeActivity.class, false, false); + + @Test(timeout = 1200000L) + public void runBenchmark() throws Exception { + Log.v("Benchmark", "Start the benchmark"); + mActivityTestRule.launchActivity(null); + while (TestState.running) { + Log.v("Benchmark", "Benchmark is running..."); + Thread.sleep(1000L); + } + Log.v("Benchmark", "All benchmarks are finished!"); + mActivityTestRule.finishActivity(); + Assert.assertTrue("Benchmark was successfully finished", TestState.testResult); + } +} diff --git a/benchmark/android/app/src/androidTest/java/android/app/TestState.java b/benchmark/android/app/src/androidTest/java/android/app/TestState.java new file mode 100644 index 0000000000..b7d4b73543 --- /dev/null +++ b/benchmark/android/app/src/androidTest/java/android/app/TestState.java @@ -0,0 +1,6 @@ +package android.app; + +public class TestState { + static boolean running = true; + static boolean testResult = true; +} diff --git a/benchmark/android/app/src/main/AndroidManifest.xml b/benchmark/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..33cfade1e1 --- /dev/null +++ b/benchmark/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.mapbox.mapboxsdk.maps.benchmark_runner" + android:versionCode="1" + android:versionName="1.0"> + <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> + <application + android:allowBackup="false" + android:fullBackupContent="false" + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name" + android:hasCode="true"> + + <activity android:name="android.app.NativeActivity" + android:label="@string/app_name" + android:configChanges="orientation|keyboardHidden" + android:screenOrientation="portrait"> + <meta-data android:name="android.app.lib_name" + android:value="mbgl-benchmark-runner" /> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> diff --git a/benchmark/android/app/src/main/assets/to_zip.txt b/benchmark/android/app/src/main/assets/to_zip.txt new file mode 100644 index 0000000000..2fa7604f6d --- /dev/null +++ b/benchmark/android/app/src/main/assets/to_zip.txt @@ -0,0 +1,3 @@ +benchmark/results/ +benchmark/fixtures/ +test/fixtures/api/assets/streets/ diff --git a/benchmark/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/benchmark/android/app/src/main/res/mipmap-hdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000000..cde69bccce --- /dev/null +++ b/benchmark/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/benchmark/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/benchmark/android/app/src/main/res/mipmap-mdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000000..c133a0cbd3 --- /dev/null +++ b/benchmark/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/benchmark/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/benchmark/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000000..bfa42f0e7b --- /dev/null +++ b/benchmark/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/benchmark/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/benchmark/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000000..324e72cdd7 --- /dev/null +++ b/benchmark/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/benchmark/android/app/src/main/res/values/strings.xml b/benchmark/android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000000..39be3fc37e --- /dev/null +++ b/benchmark/android/app/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="app_name">BenchmarkRunner</string> +</resources> |