xref: /aosp_15_r20/external/ruy/cmake/run_android_test.sh (revision bb86c7ed5fb1b98a7eac808e443a46cc8b90dfc0)
1*bb86c7edSAndroid Build Coastguard Worker#!/bin/bash
2*bb86c7edSAndroid Build Coastguard Worker
3*bb86c7edSAndroid Build Coastguard Worker# Minimal script pushing and running a file on device!
4*bb86c7edSAndroid Build Coastguard Worker# Contemporary versions of ADB properly propagate exit codes so nothing more
5*bb86c7edSAndroid Build Coastguard Worker# is needed to let CTest report test success/failure.
6*bb86c7edSAndroid Build Coastguard Worker
7*bb86c7edSAndroid Build Coastguard Worker# TODO: consider clearing temporary files after testing, although that will
8*bb86c7edSAndroid Build Coastguard Worker# get in the way of debugging and will make code more complex... also,
9*bb86c7edSAndroid Build Coastguard Worker# Ruy's test files aren't huge and people running these probably have
10*bb86c7edSAndroid Build Coastguard Worker# bigger clutter issues in their /data/local/tmp anyway. Anyway, if we want
11*bb86c7edSAndroid Build Coastguard Worker# to do this, we could copy IREE's code.
12*bb86c7edSAndroid Build Coastguard Worker
13*bb86c7edSAndroid Build Coastguard Workerdevice_tmpdir=/data/local/tmp
14*bb86c7edSAndroid Build Coastguard Worker
15*bb86c7edSAndroid Build Coastguard Workeradb push "$1" "${device_tmpdir}"
16*bb86c7edSAndroid Build Coastguard Workeradb shell "${device_tmpdir}/$(basename "$1")"
17