Sam Delmerico | 4ee8508 | 2022-09-09 17:21:25 -0400 | [diff] [blame] | 1 | # Copyright (C) 2022 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | # These commands are expected to always return successfully |
| 16 | |
| 17 | trap 'exit 1' ERR |
| 18 | |
| 19 | source $(dirname $0)/../envsetup.sh |
| 20 | |
Jingwen Chen | 6db4d4f | 2022-10-27 12:52:17 +0000 | [diff] [blame] | 21 | # lunch required to set up PATH to use b |
| 22 | lunch aosp_arm64 |
| 23 | |
Sam Delmerico | 4ee8508 | 2022-09-09 17:21:25 -0400 | [diff] [blame] | 24 | test_target=//build/bazel/scripts/difftool:difftool |
| 25 | |
Cole Faust | a497402 | 2023-07-05 12:26:55 -0700 | [diff] [blame] | 26 | if b build //build/bazel:nonexistent_module &>/dev/null ; then |
| 27 | echo "b did not fail when building a nonexistent module" >&2 |
| 28 | exit 1 |
| 29 | fi |
Sam Delmerico | 4ee8508 | 2022-09-09 17:21:25 -0400 | [diff] [blame] | 30 | b build "$test_target" |
Cole Faust | 7018428 | 2023-03-22 16:27:30 -0700 | [diff] [blame] | 31 | b build -- "$test_target" |
Sam Delmerico | 4ee8508 | 2022-09-09 17:21:25 -0400 | [diff] [blame] | 32 | b build "$test_target" --run-soong-tests |
| 33 | b build --run-soong-tests "$test_target" |
| 34 | b --run-soong-tests build "$test_target" |
Cole Faust | f2b0c73 | 2022-12-02 10:48:24 -0800 | [diff] [blame] | 35 | # Test that the bazel server can be restarted once shut down. If run in a |
| 36 | # docker container, you need to run the docker container with --init or |
| 37 | # have some other process as PID 1 that can reap zombies. |
| 38 | b shutdown |
Sam Delmerico | 4f6ca1a | 2022-09-21 15:29:16 -0400 | [diff] [blame] | 39 | b cquery 'kind(test, //build/bazel/examples/android_app/...)' --config=android |
Sam Delmerico | d0c8cf0 | 2022-09-22 14:10:40 -0400 | [diff] [blame] | 40 | b run $test_target -- --help >/dev/null |
Jingwen Chen | 83eeebb | 2022-10-05 02:27:07 +0000 | [diff] [blame] | 41 | |
| 42 | # Workflow tests for bmod |
| 43 | bmod libm |
| 44 | b run $(bmod fastboot) -- help |
| 45 | b build $(bmod libm) $(bmod libcutils) --config=android |