diff options
author | 2024-12-10 11:54:39 -0500 | |
---|---|---|
committer | 2025-01-11 14:15:56 -0500 | |
commit | fb3b9360d70596d7e921de8bf7d3ca99564a077e (patch) | |
tree | 07ded064b8374f44c6d7b88ea1c39bce09a6cdf3 /tests | |
parent | 41fd35c1412b6b3b52acdd30027c6d7ac54cd17f (diff) | |
download | latinime-fb3b9360d70596d7e921de8bf7d3ca99564a077e.tar.gz latinime-fb3b9360d70596d7e921de8bf7d3ca99564a077e.tar.xz latinime-fb3b9360d70596d7e921de8bf7d3ca99564a077e.zip |
Initial successful standalone build
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Android.mk | 50 | ||||
-rw-r--r-- | tests/AndroidManifest.xml | 1 | ||||
-rw-r--r-- | tests/AndroidManifest_SdkVersion.xml | 20 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/keyboard/internal/MoreKeySpecStringReferenceTests.java | 7 |
4 files changed, 74 insertions, 4 deletions
diff --git a/tests/Android.mk b/tests/Android.mk new file mode 100644 index 000000000..23b0a9311 --- /dev/null +++ b/tests/Android.mk @@ -0,0 +1,50 @@ +# Copyright (C) 2011 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. + +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +# We only want this apk build for tests. +LOCAL_MODULE_TAGS := tests +LOCAL_CERTIFICATE := shared + +LOCAL_FULL_LIBS_MANIFEST_FILES := \ + $(LOCAL_PATH)/AndroidManifest.xml \ + $(LOCAL_PATH)/AndroidManifest_SdkVersion.xml + +# Do not compress dictionary files to mmap dict data runtime +LOCAL_AAPT_FLAGS += -0 .dict +# Do not compress test data file +LOCAL_AAPT_FLAGS += -0 .txt + +LOCAL_STATIC_JAVA_LIBRARIES := \ + android-support-test \ + mockito-target-minus-junit4 + +LOCAL_JAVA_LIBRARIES := \ + android.test.mock.stubs \ + android.test.runner.stubs \ + android.test.base.stubs \ + + +# Include all test java files. +LOCAL_SRC_FILES := $(call all-java-files-under, src) + +LOCAL_PACKAGE_NAME := LatinIMETests + +LOCAL_INSTRUMENTATION_FOR := LatinIME + +LOCAL_SDK_VERSION := current + +include $(BUILD_PACKAGE) diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml index 95ddb0a2a..47d961166 100644 --- a/tests/AndroidManifest.xml +++ b/tests/AndroidManifest.xml @@ -15,7 +15,6 @@ --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.inputmethod.latin.tests" android:versionCode="30"> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" /> diff --git a/tests/AndroidManifest_SdkVersion.xml b/tests/AndroidManifest_SdkVersion.xml new file mode 100644 index 000000000..7bd3212a8 --- /dev/null +++ b/tests/AndroidManifest_SdkVersion.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2018 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. +--> + +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.android.inputmethod.latin.tests"> + <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" /> +</manifest> diff --git a/tests/src/com/android/inputmethod/keyboard/internal/MoreKeySpecStringReferenceTests.java b/tests/src/com/android/inputmethod/keyboard/internal/MoreKeySpecStringReferenceTests.java index 3655abbd5..e31efe427 100644 --- a/tests/src/com/android/inputmethod/keyboard/internal/MoreKeySpecStringReferenceTests.java +++ b/tests/src/com/android/inputmethod/keyboard/internal/MoreKeySpecStringReferenceTests.java @@ -27,7 +27,7 @@ import androidx.test.InstrumentationRegistry; import androidx.test.filters.SmallTest; import androidx.test.runner.AndroidJUnit4; -import com.android.inputmethod.latin.tests.R; +//import com.android.inputmethod.latin.tests.R; import org.junit.Before; import org.junit.Test; @@ -46,8 +46,9 @@ public class MoreKeySpecStringReferenceTests { final Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation(); final Context testContext = instrumentation.getContext(); final Resources testRes = testContext.getResources(); - final String testPackageName = testRes.getResourcePackageName(R.string.empty_string); - mTextsSet.setLocale(TEST_LOCALE, testRes, testPackageName); + // final String testPackageName = testRes.getResourcePackageName(R.string.empty_string); + // mTextsSet.setLocale(TEST_LOCALE, testRes, testPackageName); + mTextsSet.setLocale(TEST_LOCALE, testRes, ""); } private void assertTextArray(final String message, final String value, |