blob: fbf6fa2899cd6400e0bde56118c24389404be64e [file] [log] [blame]
Rupert Shuttlewortha9d76dd2021-07-02 07:17:16 -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/apex"
20 "testing"
21)
22
23func runApexTestCase(t *testing.T, tc bp2buildTestCase) {
24 t.Helper()
25 runBp2BuildTestCase(t, registerApexModuleTypes, tc)
26}
27
28func registerApexModuleTypes(ctx android.RegistrationContext) {
29}
30
31func TestApexBundleSimple(t *testing.T) {
32 runApexTestCase(t, bp2buildTestCase{
33 description: "apex - simple example",
34 moduleTypeUnderTest: "apex",
35 moduleTypeUnderTestFactory: apex.BundleFactory,
36 moduleTypeUnderTestBp2BuildMutator: apex.ApexBundleBp2Build,
37 filesystem: map[string]string{},
38 blueprint: `
39apex {
40 name: "apogee",
41 manifest: "manifest.json",
42}
43`,
44 expectedBazelTargets: []string{`apex(
45 name = "apogee",
46 manifest = "manifest.json",
47)`}})
48}