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