blob: 022c6871ec1114c257c51a37fb62e2c3a9127745 [file] [log] [blame]
Rupert Shuttleworth5c4881c2021-07-28 06:21:31 -04001// Copyright 2021 Google Inc. All rights reserved.
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 bp2build
16
17import (
18 "android/soong/android"
19 "android/soong/java"
20
21 "testing"
22)
23
24func runAndroidAppCertificateTestCase(t *testing.T, tc bp2buildTestCase) {
25 t.Helper()
26 runBp2BuildTestCase(t, registerAndroidAppCertificateModuleTypes, tc)
27}
28
29func registerAndroidAppCertificateModuleTypes(ctx android.RegistrationContext) {
30}
31
32func TestAndroidAppCertificateSimple(t *testing.T) {
33 runAndroidAppCertificateTestCase(t, bp2buildTestCase{
34 description: "Android app certificate - simple example",
35 moduleTypeUnderTest: "android_app_certificate",
36 moduleTypeUnderTestFactory: java.AndroidAppCertificateFactory,
37 moduleTypeUnderTestBp2BuildMutator: java.AndroidAppCertificateBp2Build,
38 filesystem: map[string]string{},
39 blueprint: `
40android_app_certificate {
41 name: "com.android.apogee.cert",
42 certificate: "chamber_of_secrets_dir",
43}
44`,
45 expectedBazelTargets: []string{`android_app_certificate(
46 name = "com.android.apogee.cert",
47 certificate = "chamber_of_secrets_dir",
48)`}})
49}