diff options
author | Cody Northrop <cnorthrop@google.com> | 2016-07-13 17:24:59 -0600 |
---|---|---|
committer | Cody Northrop <cnorthrop@google.com> | 2016-07-28 10:44:55 -0600 |
commit | 275c946e25a995cbca5a044fbe8f897e9882e9ae (patch) | |
tree | 6f2ceff6fb649a2583b2350a129517b020a35d5a /build-android | |
parent | 755151776f6b9a0ab34095b980819e4318a86529 (diff) |
tests: Create APK version of layer validation tests
Diffstat (limited to 'build-android')
-rw-r--r-- | build-android/AndroidManifest.xml | 25 | ||||
-rw-r--r-- | build-android/jni/Android.mk | 23 | ||||
-rw-r--r-- | build-android/jni/Application.mk | 2 | ||||
-rw-r--r-- | build-android/res/values/strings.xml | 24 |
4 files changed, 73 insertions, 1 deletions
diff --git a/build-android/AndroidManifest.xml b/build-android/AndroidManifest.xml new file mode 100644 index 00000000..45a26b63 --- /dev/null +++ b/build-android/AndroidManifest.xml @@ -0,0 +1,25 @@ +<?xml version="1.0"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.VulkanLayerValidationTests" android:versionCode="1" android:versionName="1.0">
+
+ <!-- This is the platform API where NativeActivity was introduced. -->
+ <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="23"/>
+
+ <!-- This .apk has no Java code itself, so set hasCode to false. -->
+ <application android:label="@string/app_name" android:hasCode="false" android:debuggable='false'>
+
+ <!-- This allows writing log files to sdcard -->
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+
+ <!-- Our activity is the built-in NativeActivity framework class.
+ This will take care of integrating with our NDK code. -->
+ <activity android:name="android.app.NativeActivity" android:label="@string/app_name" android:exported="true">
+ <!-- Tell NativeActivity the name of or .so -->
+ <meta-data android:name="android.app.lib_name" android:value="VulkanLayerValidationTests"/>
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+ </application>
+
+</manifest>
diff --git a/build-android/jni/Android.mk b/build-android/jni/Android.mk index a9b49d32..d88fe55f 100644 --- a/build-android/jni/Android.mk +++ b/build-android/jni/Android.mk @@ -185,4 +185,27 @@ LOCAL_CPPFLAGS += -DVK_USE_PLATFORM_ANDROID_KHR --include=$(SRC_DIR)/common/vulk LOCAL_LDLIBS := -llog include $(BUILD_EXECUTABLE) +# Note: The following module is similar in name to the executable, but differs so that loader won't enumerate the resulting .so +include $(CLEAR_VARS) +LOCAL_MODULE := VulkanLayerValidationTests +LOCAL_SRC_FILES += $(SRC_DIR)/tests/layer_validation_tests.cpp \ + $(SRC_DIR)/tests/vktestbinding.cpp \ + $(SRC_DIR)/tests/vktestframeworkandroid.cpp \ + $(SRC_DIR)/tests/vkrenderframework.cpp \ + $(SRC_DIR)/common/vulkan_wrapper.cpp +LOCAL_C_INCLUDES += $(SRC_DIR)/include \ + $(SRC_DIR)/layers \ + $(SRC_DIR)/libs \ + $(SRC_DIR)/common \ + $(SRC_DIR)/icd/common \ + $(SRC_DIR)/external/shaderc/libshaderc/include + +LOCAL_STATIC_LIBRARIES := googletest_main layer_utils +LOCAL_SHARED_LIBRARIES += shaderc-prebuilt glslang-prebuilt OGLCompiler-prebuilt OSDependent-prebuilt HLSL-prebuilt shaderc_util-prebuilt SPIRV-prebuilt SPIRV-Tools-prebuilt +LOCAL_CPPFLAGS += -DVK_USE_PLATFORM_ANDROID_KHR -DVALIDATION_APK --include=$(SRC_DIR)/common/vulkan_wrapper.h +LOCAL_WHOLE_STATIC_LIBRARIES += android_native_app_glue +LOCAL_LDLIBS := -llog -landroid +include $(BUILD_SHARED_LIBRARY) + +$(call import-module,android/native_app_glue) $(call import-module,third_party/googletest) diff --git a/build-android/jni/Application.mk b/build-android/jni/Application.mk index 486548f8..8b4fb09e 100644 --- a/build-android/jni/Application.mk +++ b/build-android/jni/Application.mk @@ -16,6 +16,6 @@ APP_ABI := armeabi-v7a arm64-v8a x86 x86_64 mips mips64
APP_PLATFORM := android-22
APP_STL := gnustl_static
-APP_MODULES := layer_utils VkLayer_core_validation VkLayer_image VkLayer_parameter_validation VkLayer_object_tracker VkLayer_threading VkLayer_swapchain VkLayer_unique_objects VkLayerValidationTests
+APP_MODULES := layer_utils VkLayer_core_validation VkLayer_image VkLayer_parameter_validation VkLayer_object_tracker VkLayer_threading VkLayer_swapchain VkLayer_unique_objects VkLayerValidationTests VulkanLayerValidationTests
APP_CPPFLAGS += -std=c++11 -DVK_PROTOTYPES -Wall -Werror -Wno-unused-function -Wno-unused-const-variable -mxgot
NDK_TOOLCHAIN_VERSION := clang
diff --git a/build-android/res/values/strings.xml b/build-android/res/values/strings.xml new file mode 100644 index 00000000..8ff71b05 --- /dev/null +++ b/build-android/res/values/strings.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2016 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- This file contains resource definitions for displayed strings, allowing + them to be changed based on the locale and options. --> + +<resources> + <!-- Simple strings. --> + <string name="app_name">VulkanLayerValidationTests</string> + +</resources> |