blob: 9805a6a9067e2ce444b484c9eab9c9b43cffbf50 [file] [log] [blame]
Paul Duffinf7f65da2021-03-10 15:00:46 +00001// 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
15package sdk
16
17import "testing"
18
19func 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
Paul Duffin36474d32021-03-12 12:19:43 +000032 CheckSnapshot(t, result, "mysdk", "",
Paul Duffinf7f65da2021-03-10 15:00:46 +000033 checkUnversionedAndroidBpContents(`
34// This is auto-generated. DO NOT EDIT.
35
36prebuilt_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
47prebuilt_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
55sdk_snapshot {
56 name: "mysdk@current",
57 visibility: ["//visibility:public"],
58 boot_images: ["mysdk_mybootimage@current"],
59}
60`),
Paul Duffin36474d32021-03-12 12:19:43 +000061 checkAllCopyRules(""))
Paul Duffinf7f65da2021-03-10 15:00:46 +000062}