Enhance "enablement" mechanism
- Now we have a dedicated policy file for each test module.
RavenwoodEnablementChecker can load multiple policy files and
it'll only use the one matching the current test. Policy files now
start with the test module name.
- Policy files now support wildcards: "**" for "any string" and "*" for
"any string without periods".
- Policy lines now match from the top of the file. A default policy
needs to be put at the end as "** false" (to disable all tests).
But method-level policies can still override it because of the following
rule, so you can put method-level polices after this.
- There are now 3 states: "enable" ("true"), "disable" ("false")
and "never".
- $RAVENWOOD_RUN_DISABLED_TESTS now runs enabled tests too, in addition
to disabled tests. But it will still not run "never" tests.
This makes the test stats files to be always "correct", even after
a RAVENWOOD_RUN_DISABLED_TESTS=1 run.
- Now, if a policy file has a method as "enabled", the enclosing class
will also be executed, even if the class's policy is "disable".
And the rest of the methods in the same class will still default to the
classes policy. So if you have the following lines:
TestClass false
TestClass#test1 true
Then TestClass#test1 will be executed, but the other methods in
TestClass still won't be executed.
- A new script update-enablement-policies.sh updates all the policy
files using the "latest" stats files. This will add method level
"true" / "false" according to the latest result. So if you run it after
a RAVENWOOD_RUN_DISABLED_TESTS=1, you'll potentially get more tests to
be enabled.
Bug: 292141694
Fix: 435711089
Flag: TEST_ONLY
Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh -s
Test: Manual test running update-enablement-policies.sh
Change-Id: I22d5650877bec633ecf4a05dc60c2747b092481c
Loading
Please register or sign in to comment