Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5ee7051 authored by Tony Mak's avatar Tony Mak
Browse files

Move TextClassifierPerfTest to a separate package

So, other tests in other package no longer affect us.
Currently, TextClassifierPerfTest is not run continuously because of
failures in other packages.

BUG: 129695635

Test: Run run.sh

Change-Id: I2253360d98404608193b53c8b34611c2ff1b231e
parent ee10d8bc
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
// Copyright (C) 2019 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.

android_test {
    name: "TextClassifierPerfTests",
    srcs: ["src/**/*.java"],
    static_libs: [
        "androidx.test.rules",
        "androidx.annotation_annotation",
        "apct-perftests-utils",
    ],
    platform_apis: true,
    test_suites: ["device-tests"],
}
+25 −0
Original line number Diff line number Diff line
<?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.perftests.textclassifier">

    <application>
        <uses-library android:name="android.test.runner" />
    </application>

    <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
        android:targetPackage="com.android.perftests.textclassifier"/>
</manifest>
+28 −0
Original line number Diff line number Diff line
<?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.
-->
<configuration description="Runs AutofillPerfTests metric instrumentation.">
    <option name="test-suite-tag" value="apct" />
    <option name="test-suite-tag" value="apct-metric-instrumentation" />
    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
        <option name="cleanup-apks" value="true" />
        <option name="test-file-name" value="AutofillPerfTests.apk" />
    </target_preparer>

    <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
        <option name="package" value="com.android.perftests.autofill" />
        <option name="hidden-api-checks" value="false"/>
    </test>
</configuration>
+4 −0
Original line number Diff line number Diff line
set -e
make TextClassifierPerfTests
adb shell cmd package compile -m speed -f com.android.perftests.textclassifier
adb shell am instrument -w -e class android.view.textclassifier.TextClassifierPerfTest com.android.perftests.textclassifier/androidx.test.runner.AndroidJUnitRunner
+1 −5
Original line number Diff line number Diff line
@@ -13,15 +13,11 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.textclassifier;
package android.view.textclassifier;

import android.content.Context;
import android.perftests.utils.BenchmarkState;
import android.perftests.utils.PerfStatusReporter;
import android.view.textclassifier.ConversationActions;
import android.view.textclassifier.TextClassificationManager;
import android.view.textclassifier.TextClassifier;
import android.view.textclassifier.TextLanguage;

import androidx.test.InstrumentationRegistry;
import androidx.test.filters.LargeTest;