xref: /aosp_15_r20/build/soong/android/build_prop_test.go (revision 333d2b3687b3a337dbcca9d65000bca186795e39)
1// Copyright 2024 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 android
16
17import (
18	"testing"
19)
20
21func TestPropFileInputs(t *testing.T) {
22	bp := `
23build_prop {
24    name: "vendor-build.prop",
25    stem: "build.prop",
26    vendor: true,
27    android_info: ":board-info",
28    //product_config: ":product_config",
29}
30android_info {
31    name: "board-info",
32    stem: "android-info.txt",
33}
34`
35
36	res := GroupFixturePreparers(
37		FixtureRegisterWithContext(registerBuildPropComponents),
38	).RunTestWithBp(t, bp)
39	buildPropCmd := res.ModuleForTests("vendor-build.prop", "").Rule("vendor-build.prop_.vendor-build.prop").RuleParams.Command
40	AssertStringDoesContain(t, "Could not find android-info in prop files of vendor build.prop", buildPropCmd, "--prop-files=out/soong/.intermediates/board-info/android-info.prop")
41}
42