Paul Duffin | f7f65da | 2021-03-10 15:00:46 +0000 | [diff] [blame^] | 1 | // Copyright (C) 2021 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 | package sdk |
| 16 | |
| 17 | import "testing" |
| 18 | |
| 19 | func TestSnapshotWithBootImage(t *testing.T) { |
| 20 | result := testSdkWithJava(t, ` |
| 21 | sdk { |
| 22 | name: "mysdk", |
| 23 | boot_images: ["mybootimage"], |
| 24 | } |
| 25 | |
| 26 | boot_image { |
| 27 | name: "mybootimage", |
| 28 | image_name: "art", |
| 29 | } |
| 30 | `) |
| 31 | |
| 32 | result.CheckSnapshot("mysdk", "", |
| 33 | checkUnversionedAndroidBpContents(` |
| 34 | // This is auto-generated. DO NOT EDIT. |
| 35 | |
| 36 | prebuilt_boot_image { |
| 37 | name: "mybootimage", |
| 38 | prefer: false, |
| 39 | visibility: ["//visibility:public"], |
| 40 | apex_available: ["//apex_available:platform"], |
| 41 | image_name: "art", |
| 42 | } |
| 43 | `), |
| 44 | checkVersionedAndroidBpContents(` |
| 45 | // This is auto-generated. DO NOT EDIT. |
| 46 | |
| 47 | prebuilt_boot_image { |
| 48 | name: "mysdk_mybootimage@current", |
| 49 | sdk_member_name: "mybootimage", |
| 50 | visibility: ["//visibility:public"], |
| 51 | apex_available: ["//apex_available:platform"], |
| 52 | image_name: "art", |
| 53 | } |
| 54 | |
| 55 | sdk_snapshot { |
| 56 | name: "mysdk@current", |
| 57 | visibility: ["//visibility:public"], |
| 58 | boot_images: ["mysdk_mybootimage@current"], |
| 59 | } |
| 60 | `), |
| 61 | checkAllCopyRules(""), |
| 62 | ) |
| 63 | } |