Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89fac794 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Introduce RavenwoodConfig

- Now RavenwoodRule is deprecated, and we use RavenwoodConfig
instead.

- If a test has a @RavenwoodConfig.Config field,
we automatically extract the configuration from it.
```
    @RavenwoodConfig.Config
    public static RavenwoodConfig sConfig =
            new RavenwoodConfig.Builder()
                    .build();
```

- RC doesn't provide getContext() / getInstrumentation(). Tests
will now use InstrumentationRegistry.

- Previously, with RavenwoodRule, the environment was initialized
and reset for each test method, but now we do so at the class level,
before the inner runner starts.

This makes each test less hermetic, but it's closer to how the real
test works.

- We can introduce a hermetic mode later, if needed, which would be
a RavenwoodConfig parameter.

- So far, "bad config tests" can't be done automatically. I'll work
on the tests as a follow-up.

Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh
Flag: EXEMPT host test change only
Bug: 356918135

Change-Id: I6727ef814e8b8c643e6c79f6d9fc8c7f749e6fea
parent 00f16abc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment