xref: /aosp_15_r20/tools/asuite/asuite.sh (revision c2e18aaa1096c836b086f94603d04f4eb9cf37f5)
1*c2e18aaaSAndroid Build Coastguard Worker# Copyright 2019, The Android Open Source Project
2*c2e18aaaSAndroid Build Coastguard Worker#
3*c2e18aaaSAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License");
4*c2e18aaaSAndroid Build Coastguard Worker# you may not use this file except in compliance with the License.
5*c2e18aaaSAndroid Build Coastguard Worker# You may obtain a copy of the License at
6*c2e18aaaSAndroid Build Coastguard Worker#
7*c2e18aaaSAndroid Build Coastguard Worker#     http://www.apache.org/licenses/LICENSE-2.0
8*c2e18aaaSAndroid Build Coastguard Worker#
9*c2e18aaaSAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software
10*c2e18aaaSAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS,
11*c2e18aaaSAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*c2e18aaaSAndroid Build Coastguard Worker# See the License for the specific language governing permissions and
13*c2e18aaaSAndroid Build Coastguard Worker# limitations under the License.
14*c2e18aaaSAndroid Build Coastguard Worker
15*c2e18aaaSAndroid Build Coastguard Worker# Main function.
16*c2e18aaaSAndroid Build Coastguard Workerfunction _asuite_main() {
17*c2e18aaaSAndroid Build Coastguard Worker    local T="$(gettop)/tools"
18*c2e18aaaSAndroid Build Coastguard Worker    src_atest="$T/asuite/atest/atest_completion.sh"
19*c2e18aaaSAndroid Build Coastguard Worker    src_acloud="$T/acloud/acloud_completion.sh"
20*c2e18aaaSAndroid Build Coastguard Worker    src_aidegen="$T/asuite/aidegen/aidegen_completion.sh"
21*c2e18aaaSAndroid Build Coastguard Worker    declare -a asuite_srcs=($src_atest $src_acloud $src_aidegen)
22*c2e18aaaSAndroid Build Coastguard Worker    for src in ${asuite_srcs[@]}; do
23*c2e18aaaSAndroid Build Coastguard Worker        # should_add_completion selectively allows disabling tab completion.
24*c2e18aaaSAndroid Build Coastguard Worker        # ENVSETUP_NO_COMPLETION=acloud # -> disable acloud completion.
25*c2e18aaaSAndroid Build Coastguard Worker        # ENVSETUP_NO_COMPLETION=acloud:atest # -> disable acloud and atest.
26*c2e18aaaSAndroid Build Coastguard Worker        if [[ -f $src ]] && should_add_completion $src ; then
27*c2e18aaaSAndroid Build Coastguard Worker            source $src || true
28*c2e18aaaSAndroid Build Coastguard Worker        fi
29*c2e18aaaSAndroid Build Coastguard Worker    done
30*c2e18aaaSAndroid Build Coastguard Worker}
31*c2e18aaaSAndroid Build Coastguard Worker
32*c2e18aaaSAndroid Build Coastguard Worker_asuite_main
33