1#!/bin/bash
2
3function run() {
4    local FAILED_TESTS=()
5
6    local COMPILE_TIME_TESTS=(\
7        hidl_error_test \
8        hidl_export_test \
9        hidl_hash_test \
10        hidl_impl_test \
11        android.hardware.tests.foo@1.0-vts.driver \
12        android.hardware.tests.foo@1.0-vts.profiler)
13
14    local RUN_TIME_TESTS=(\
15        libhidl-gen-utils_test \
16        hidl-gen-host_test \
17    )
18
19    $ANDROID_BUILD_TOP/build/soong/soong_ui.bash --make-mode -j \
20        ${COMPILE_TIME_TESTS[*]} ${RUN_TIME_TESTS[*]} || return
21
22    local BITNESS=("nativetest" "nativetest64")
23
24    for bits in ${BITNESS[@]}; do
25        for test in ${RUN_TIME_TESTS[@]}; do
26            echo $bits $test
27            $ANDROID_BUILD_TOP/out/host/linux-x86/$bits/$test/$test ||
28                FAILED_TESTS+=("$bits:$test")
29        done
30    done
31
32    echo
33    echo ===== ALL HOST TESTS SUMMARY =====
34    echo
35    if [ ${#FAILED_TESTS[@]} -gt 0 ]; then
36        for failed in ${FAILED_TESTS[@]}; do
37            echo "FAILED TEST: $failed"
38        done
39    else
40        echo "SUCCESS"
41    fi
42}
43
44run