Prevent runtime module paths being used in include_dirs

am: 2ac2befc9a

Change-Id: Ia7683cb3400013a78bd62b4f7c002c7f0e352903
This commit is contained in:
Paul Duffin
2019-07-21 04:14:26 -07:00
committed by android-build-merger
2 changed files with 91 additions and 2 deletions

View File

@@ -23,6 +23,29 @@ var neverallowTests = []struct {
fs map[string][]byte
expectedError string
}{
// include_dir rule tests
{
name: "include_dir not allowed to reference art",
fs: map[string][]byte{
"other/Blueprints": []byte(`
cc_library {
name: "libother",
include_dirs: ["art/libdexfile/include"],
}`),
},
expectedError: "all usages of 'art' have been migrated",
},
{
name: "include_dir can reference another location",
fs: map[string][]byte{
"other/Blueprints": []byte(`
cc_library {
name: "libother",
include_dirs: ["another/include"],
}`),
},
},
// Treble rule tests
{
name: "no vndk.enabled under vendor directory",
fs: map[string][]byte{
@@ -213,6 +236,7 @@ func testNeverallow(t *testing.T, config Config, fs map[string][]byte) (*TestCon
}
type mockCcLibraryProperties struct {
Include_dirs []string
Vendor_available *bool
Vndk struct {