1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-04-17 00:00:56 +01:00
Luis Machado b38e64a2a8 [workloads] Add JetNews jank tests workload
This patch adds the JetNews jank-testing workload. This is accomplished
through the uiauto helper library and the jank test classes.

This workload requires a JetNews app APK to be available. We plan to
make it available through the workload-automation-assets repo.

At the end of the run, users should end up with a json file containing all
the frame/jank metrics.

There are 3 parameters for this workload:

- tests: Specifies which of the 3 available tests to run (default is to run
         all of them)

- flingspeed: The speed of the fling interactions.

- repeat: How many times each of the selected tests is to be executed in a
          single measuring session.
2024-07-16 14:38:24 +01:00

56 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
# Copyright 2013-2024 ARM Limited
#
# 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.
#
set -e
# CD into build dir if possible - allows building from any directory
script_path='.'
if `readlink -f $0 &>/dev/null`; then
script_path=`readlink -f $0 2>/dev/null`
fi
script_dir=`dirname $script_path`
cd $script_dir
# Ensure gradelw exists before starting
if [[ ! -f gradlew ]]; then
echo 'gradlew file not found! Check that you are in the right directory.'
exit 9
fi
# Copy base class library from wa dist
libs_dir=app/libs
base_class=`python3 -c "import os, wa; print(os.path.join(os.path.dirname(wa.__file__), 'framework', 'uiauto-androidx', 'uiauto.aar'))"`
mkdir -p $libs_dir
cp $base_class $libs_dir
# Build and return appropriate exit code if failed
# gradle build
./gradlew clean :app:assembleDebug
exit_code=$?
if [[ $exit_code -ne 0 ]]; then
echo "ERROR: 'gradle build' exited with code $exit_code"
exit $exit_code
fi
# If successful move APK file to workload folder (overwrite previous)
package=com.arm.wa.uiauto.jetnews
rm -f ../$package
if [[ -f app/build/outputs/apk/debug/$package.apk ]]; then
cp app/build/outputs/apk/debug/$package.apk ../$package.apk
else
echo 'ERROR: UiAutomator apk could not be found!'
exit 9
fi