Add tests to confirm that genjarjar keeps excluded Tests.
This adds tests for aosp/2498795. Test: atest jarjar-rules-generator-test Change-Id: I8077f0e74190bb4f6a35cb6c0d866c7453ca0ca0
This commit is contained in:
parent
fb94c31fc0
commit
aa44ef3b2f
3 changed files with 34 additions and 0 deletions
|
|
@ -79,6 +79,8 @@ python_test_host {
|
|||
],
|
||||
data: [
|
||||
"testdata/test-jarjar-excludes.txt",
|
||||
// txt with Test classes to test they aren't included when added to jarjar excludes
|
||||
"testdata/test-jarjar-excludes-testclass.txt",
|
||||
// two unsupportedappusage lists with different classes to test using multiple lists
|
||||
"testdata/test-unsupportedappusage.txt",
|
||||
"testdata/test-other-unsupportedappusage.txt",
|
||||
|
|
|
|||
|
|
@ -84,6 +84,31 @@ class TestGenJarjar(unittest.TestCase):
|
|||
'rule test.utils.TestUtilClass$TestInnerClassTest jarjar.prefix.@0\n',
|
||||
'rule test.utils.TestUtilClass$TestInnerClassTest$* jarjar.prefix.@0\n'], lines)
|
||||
|
||||
def test_gen_rules_repeated_testclass_excluded(self):
|
||||
args = gen_jarjar.parse_arguments([
|
||||
"jarjar-rules-generator-testjavalib.jar",
|
||||
"--prefix", "jarjar.prefix",
|
||||
"--output", "test-output-rules.txt",
|
||||
"--apistubs", "framework-connectivity.stubs.module_lib.jar",
|
||||
"--unsupportedapi", ":testdata/test-unsupportedappusage.txt",
|
||||
"--excludes", "testdata/test-jarjar-excludes-testclass.txt",
|
||||
])
|
||||
gen_jarjar.make_jarjar_rules(args)
|
||||
|
||||
with open(args.output) as out:
|
||||
lines = out.readlines()
|
||||
|
||||
self.maxDiff = None
|
||||
self.assertListEqual([
|
||||
'rule android.net.IpSecTransform jarjar.prefix.@0\n',
|
||||
'rule test.unsupportedappusage.OtherUnsupportedUsageClass jarjar.prefix.@0\n',
|
||||
'rule test.unsupportedappusage.OtherUnsupportedUsageClassTest jarjar.prefix.@0\n',
|
||||
'rule test.unsupportedappusage.OtherUnsupportedUsageClassTest$* jarjar.prefix.@0\n',
|
||||
'rule test.utils.TestUtilClass jarjar.prefix.@0\n',
|
||||
'rule test.utils.TestUtilClass$TestInnerClass jarjar.prefix.@0\n',
|
||||
'rule test.utils.TestUtilClass$TestInnerClassTest jarjar.prefix.@0\n',
|
||||
'rule test.utils.TestUtilClass$TestInnerClassTest$* jarjar.prefix.@0\n'], lines)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Need verbosity=2 for the test results parser to find results
|
||||
|
|
|
|||
7
tools/testdata/test-jarjar-excludes-testclass.txt
vendored
Normal file
7
tools/testdata/test-jarjar-excludes-testclass.txt
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Test file for excluded classes
|
||||
test\.jarj.rexcluded\.JarjarExcludedCla.s
|
||||
test\.jarjarexcluded\.JarjarExcludedClass\$TestInnerCl.ss
|
||||
|
||||
# Exclude actual test files
|
||||
test\.utils\.TestUtilClassTest
|
||||
android\.net\.IpSecTransformTest
|
||||
Loading…
Reference in a new issue