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

Commit f5834294 authored by GuangHui Liu's avatar GuangHui Liu
Browse files

Create command to run adb tests and output results

This is necessary for deploying adb tests to TreeHugger presubmit check

Test: run run_all_adb_tests.sh from source tree root

Change-Id: Ie6a25111fa4f7ed6835dde5821f283732b7e77b2
parent 6048d9db
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
#!/bin/bash

# Copyright 2017, 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.

# Execute ADB test scripts and output zipped logs
# output to $1/adb_tests/ where $1 is DIST_DIR
# The command exits with code 0 only if all test scripts exit with code 0 and
# zip file successfuly created
# All test scripts are expected to exit with code 0, even if the test fails

set -e
LOG_DIR="$1"/adb_tests/
mkdir -p $LOG_DIR
# 2> because TextTestRunner() outputs to std.stderr
/usr/bin/python system/core/adb/test_adb.py 2> $LOG_DIR/test_adb_out.txt
/usr/bin/python system/core/adb/test_device.py 2> $LOG_DIR/test_device_out.txt
zip -j $LOG_DIR/test_all_adb_out.zip $LOG_DIR/*.txt
rm $LOG_DIR/*.txt