Steven Moreland | 9e87d90 | 2021-08-09 15:00:57 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | set -ex |
| 4 | |
| 5 | if [ $# -eq 0 ]; then |
| 6 | : |
| 7 | elif [ $# -eq 1 ] && [[ "$1" =~ ^host|device$ ]]; then |
| 8 | : |
| 9 | else |
| 10 | echo "usage: $0 [device|host]" |
| 11 | false |
| 12 | fi |
| 13 | |
| 14 | # Script maintained for RPC development, while it is active, to quickly run |
| 15 | # tests. Generally, to match VTS/presubmit behavior, 'atest' should be used. |
| 16 | |
| 17 | function dtest () { adb shell /data/nativetest64/$1/$@; } |
| 18 | function hbench () { $AT/out/host/linux-x86/benchmarktest/$1/$@; } |
| 19 | function hfuzz () { time $ANDROID_HOST_OUT/fuzz/x86_64/$1/$@; } |
| 20 | function htest () { time $ANDROID_BUILD_TOP/out/host/linux-x86/nativetest/$1/$@; } |
| 21 | function pdtest () { adb wait-for-device && adb shell mkdir -p /data/nativetest64/$1 && adb push $OUT/data/nativetest64/$1/$1 /data/nativetest64/$1/$1 && dtest $@; } |
| 22 | function dbench () { adb shell /data/benchmarktest64/$1/$@; } |
| 23 | function pdbench () { adb wait-for-device && adb shell mkdir -p /data/benchmarktest64/$1 && adb push $OUT/data/benchmarktest64/$1/$1 /data/benchmarktest64/$1/$1 && dbench $@; } |
| 24 | |
| 25 | $ANDROID_BUILD_TOP/build/soong/soong_ui.bash --make-mode \ |
| 26 | binderRpcTest \ |
| 27 | binder_rpc_fuzzer \ |
| 28 | binder_parcel_fuzzer \ |
| 29 | binderLibTest \ |
| 30 | binderRpcBenchmark |
| 31 | |
| 32 | if ! [ "$1" = "device" ]; then |
| 33 | htest binderRpcTest |
| 34 | hbench binderRpcBenchmark |
| 35 | hfuzz binder_rpc_fuzzer -max_total_time=30 |
| 36 | hfuzz binder_parcel_fuzzer -max_total_time=30 |
| 37 | fi |
| 38 | |
| 39 | if ! [ "$1" = "host" ]; then |
| 40 | pdtest binderRpcTest |
| 41 | pdtest binderLibTest |
| 42 | pdbench binderRpcBenchmark |
| 43 | fi |
| 44 | |