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

Commit 774e9b42 authored by Nolan Scobie's avatar Nolan Scobie
Browse files

Detangle shared AndroidTest.xml for hwui_unit_tests/hwuimicro/hwuimacro

This change prevents multiple binaries from being pushed / executed when
only one of them was requested, which is currently causing `atest
hwui_unit_tests` to fail if hwuimacro or hwuimicro weren't manually
built first.

AFAICT, other projects don't tend to share AndroidTest.xml files for
multiple binaries.

Could this break something? Who knows. :) However, various tools seem to
get confused with the current ambiguity, and seem to often run multiple
binaries when only one of them was requested, or just break entirely. My
belief / hope is that anything expecting e.g. hwuimicro to run will
actually be running e.g. `atest hwuimicro` instead of running e.g.
`atest hwui_unit_tests` and expecting hwuimicro to also run as a side
effect.

Test: atest hwui_unit_tests, atest hwuimicro, atest hwuimacro
Bug: b/338077634
Flag: TEST_ONLY
Change-Id: I0b3f1b82abec09a6444293023901c1f4887270eb
parent ba46cae3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -736,6 +736,7 @@ cc_defaults {

cc_test {
    name: "hwui_unit_tests",
    test_config: "tests/unit/AndroidTest.xml",
    defaults: [
        "hwui_test_defaults",
        "android_graphics_apex",
@@ -803,6 +804,7 @@ cc_test {

cc_benchmark {
    name: "hwuimacro",
    test_config: "tests/macrobench/AndroidTest.xml",
    defaults: ["hwui_test_defaults"],

    static_libs: ["libhwui"],
@@ -822,6 +824,7 @@ cc_benchmark {

cc_benchmark {
    name: "hwuimicro",
    test_config: "tests/microbench/AndroidTest.xml",
    defaults: ["hwui_test_defaults"],

    static_libs: ["libhwui_static"],
+28 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2024 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="Config for hwuimacro">
    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
        <option name="cleanup" value="true" />
        <option name="push" value="hwuimacro->/data/local/tmp/benchmarktest/hwuimacro" />
    </target_preparer>
    <option name="test-suite-tag" value="apct" />
    <option name="not-shardable" value="true" />
    <test class="com.android.tradefed.testtype.GoogleBenchmarkTest" >
        <option name="native-benchmark-device-path" value="/data/local/tmp/benchmarktest" />
        <option name="benchmark-module-name" value="hwuimacro" />
        <option name="file-exclusion-filter-regex" value=".*\.config$" />
    </test>
</configuration>
+4 −0
Original line number Diff line number Diff line
@@ -3,3 +3,7 @@ adb push $OUT/data/benchmarktest/hwuimacro/hwuimacro /data/benchmarktest/hwuimac
adb shell /data/benchmarktest/hwuimacro/hwuimacro shadowgrid2 --onscreen

Pass --help to get help

OR (if you don't need to pass arguments)

atest hwuimacro
+1 −12
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project
<!-- Copyright 2024 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.
@@ -16,24 +16,13 @@
<configuration description="Config for hwuimicro">
    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
        <option name="cleanup" value="true" />
        <option name="push" value="hwui_unit_tests->/data/local/tmp/nativetest/hwui_unit_tests" />
        <option name="push" value="hwuimicro->/data/local/tmp/benchmarktest/hwuimicro" />
        <option name="push" value="hwuimacro->/data/local/tmp/benchmarktest/hwuimacro" />
    </target_preparer>
    <option name="test-suite-tag" value="apct" />
    <option name="not-shardable" value="true" />
    <test class="com.android.tradefed.testtype.GTest" >
        <option name="native-test-device-path" value="/data/local/tmp/nativetest" />
        <option name="module-name" value="hwui_unit_tests" />
    </test>
    <test class="com.android.tradefed.testtype.GoogleBenchmarkTest" >
        <option name="native-benchmark-device-path" value="/data/local/tmp/benchmarktest" />
        <option name="benchmark-module-name" value="hwuimicro" />
        <option name="file-exclusion-filter-regex" value=".*\.config$" />
    </test>
    <test class="com.android.tradefed.testtype.GoogleBenchmarkTest" >
        <option name="native-benchmark-device-path" value="/data/local/tmp/benchmarktest" />
        <option name="benchmark-module-name" value="hwuimacro" />
        <option name="file-exclusion-filter-regex" value=".*\.config$" />
    </test>
</configuration>
+4 −0
Original line number Diff line number Diff line
mmm -j8 frameworks/base/libs/hwui &&
adb push $OUT/data/benchmarktest/hwuimicro/hwuimicro /data/benchmarktest/hwuimicro/hwuimicro &&
adb shell /data/benchmarktest/hwuimicro/hwuimicro

OR

atest hwuimicro
Loading