diff options
author | 2024-09-26 18:38:11 +0000 | |
---|---|---|
committer | 2024-09-26 18:38:11 +0000 | |
commit | 26a7d34e6d17b99bc9e66d32c2199123a7dd0f99 (patch) | |
tree | 9a69a8d0d5bf2b44fd931e1cbf9227c0aae9b16c /apex/apex_test.go | |
parent | 4649b1fb6542ffb51c10c5f4ba2534d19a67253a (diff) | |
parent | 18cb570c4c7676fc47fca26bc1e4c494da29c8bf (diff) |
Merge "Only propgate strict updatability linting to modules that are in the apex" into main
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r-- | apex/apex_test.go | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go index ad0bb177d..8cb8a9132 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -9749,67 +9749,6 @@ func TestApexStrictUpdtabilityLint(t *testing.T) { } } -func TestUpdatabilityLintSkipLibcore(t *testing.T) { - bp := ` - apex { - name: "myapex", - key: "myapex.key", - java_libs: ["myjavalib"], - updatable: true, - min_sdk_version: "29", - } - apex_key { - name: "myapex.key", - } - java_library { - name: "myjavalib", - srcs: ["MyClass.java"], - apex_available: [ "myapex" ], - sdk_version: "current", - min_sdk_version: "29", - lint: { - baseline_filename: "lint-baseline.xml", - } - } - ` - - testCases := []struct { - testCaseName string - moduleDirectory string - disallowedFlagExpected bool - }{ - { - testCaseName: "lintable module defined outside libcore", - moduleDirectory: "", - disallowedFlagExpected: true, - }, - { - testCaseName: "lintable module defined in libcore root directory", - moduleDirectory: "libcore/", - disallowedFlagExpected: false, - }, - { - testCaseName: "lintable module defined in libcore child directory", - moduleDirectory: "libcore/childdir/", - disallowedFlagExpected: true, - }, - } - - for _, testCase := range testCases { - lintFileCreator := android.FixtureAddTextFile(testCase.moduleDirectory+"lint-baseline.xml", "") - bpFileCreator := android.FixtureAddTextFile(testCase.moduleDirectory+"Android.bp", bp) - result := testApex(t, "", lintFileCreator, bpFileCreator) - myjavalib := result.ModuleForTests("myjavalib", "android_common_apex29") - sboxProto := android.RuleBuilderSboxProtoForTests(t, result, myjavalib.Output("lint.sbox.textproto")) - cmdFlags := fmt.Sprintf("--baseline %vlint-baseline.xml --disallowed_issues NewApi", testCase.moduleDirectory) - disallowedFlagActual := strings.Contains(*sboxProto.Commands[0].Command, cmdFlags) - - if disallowedFlagActual != testCase.disallowedFlagExpected { - t.Errorf("Failed testcase: %v \nActual lint cmd: %v", testCase.testCaseName, *sboxProto.Commands[0].Command) - } - } -} - // checks transtive deps of an apex coming from bootclasspath_fragment func TestApexStrictUpdtabilityLintBcpFragmentDeps(t *testing.T) { bp := ` |