summaryrefslogtreecommitdiff
path: root/ravenwood/junit-stub-src
AgeCommit message (Collapse)Author
2024-11-27Change ravenwood default log level to verbose Makoto Onuki
- Otherwise, it'll be hard to debug issues from the log from the CI server. - Also change all ravenwood related log to a "Ravenwood" tag, to make it easy to filter out ravenwood log. Bug: 380949304 Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh -s Test: ANDROID_LOG_TAGS='Ravenwood:s' atest -t RavenwoodBivalentTest Flag: EXEMPT host test change only Change-Id: Ia114d094256b365beea55c905766a4602852c742
2024-11-21[Ravenwood] Decouple environment setup from RavenwoodConfig John Wu
- Also deprecate RavenwoodRule.setServicesRequired so that RavenwoodRule is only used for setting system properties. Flag: EXEMPT host test change only Bug: 377765941 Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh Change-Id: Id7ca551bd797e786f2d71777eb9f972fb5fb6c88
2024-10-25[Ravenwood] Cleanup RATR implementation and project structure John Wu
- Create a dedicated RATR implementation specifically for device-side tests in junit-stub-src so we won't need to worry about device-side compatibility when updating RATR. - Enable Ravenizer on RavenwoodBivalentTest to ensure the "stub" RATR is working as intended - Because the real RATR is now in junit-impl-src, a lot of classes no longer need to be in junit-stub-src, as junit-src is now a lot cleaner - Remove all Ravenwood checks in RATR since the real one will always only run on Ravenwood tests - Remove RATRHook and move the hook callback methods directly in RATR Flag: EXEMPT host test change only Bug: 356918135 Test: atest RavenwoodBivalentTest_device_ravenizer Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh Change-Id: I18577373833d8f6390bc685c23b857be65b904dc
2024-09-26Cherry-pick Ravenwood "core" code John Wu
- Copied f/b/r and f/b/t/h - Ported files under f/b/core, only what needed to for run-ravenwood-tests.sh to pass - Local changes because of missing resoucres support - Added @DisabledOnRavenwood(reason="AOSP is missing resources support") to tests under f/b/r that depends on resources bivalentinst and servicestest - Added try-catch around ResourcesManager.setInstance() Flag: EXEMPT host test change only Bug: 292141694 Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh Merged-in: I8a9b8374be3ae052ba4f152eb43af20d0871597f Change-Id: Iefd574dbded8c4ab2e244c4918c26641364a3432
2024-05-23[Ravenwood] Internal clean up, more PFD APIs, OsConstants, etc Makoto Onuki
- Support a few more ParcelFileDescriptor APIs. - Support OsConstants and a couple of Os APIs. - Also clean up f/b/ravenwood. Now we have "runtime-common" library that can be used from different components of Ravenwood infra, with native code support. Bug: 292141694 Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh Test: CtsOsTestCases (on tree hugger) Flag: EXEMPT hostside test change only Change-Id: I259a04201e05e615e17da0529cb500a102887ec9
2024-05-20Revert "[Ravenwood] Internal clean up, more PFD APIs, OsConstant..." Makoto Onuki
Revert submission 27402077-2024-05-17-PFD Reason for revert: Broke tests Reverted changes: /q/submissionid:27402077-2024-05-17-PFD Change-Id: If2b50329dbcaccb5f13f7631f1fa4df532bfcc60
2024-05-20[Ravenwood] Internal clean up, more PFD APIs, OsConstants, etc Makoto Onuki
- Support a few more ParcelFileDescriptor APIs. - Support OsConstants and a couple of Os APIs. - Also clean up f/b/ravenwood. Now we have "runtime-common" library that can be used from different components of Ravenwood infra, with native code support. Bug: 292141694 Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh Test: CtsOsTestCases (on tree hugger) Change-Id: Ia06873114e80e9dd309d2cf077b208aaa7396542
2024-05-01[Ravenwood] Support NativeAllocationRegistry Makoto Onuki
We don't track native allocation size, but we still need to release native allocations. Bug: 337110712 Test: atest RavenwoodBivalentTest Test: atest RavenwoodBivalentTest_device Test: ./ravenwood/scripts/run-ravenwood-tests.sh Change-Id: Ia50c963731a26fc951a8040cbf353a5c56505b6a
2024-02-01Preparing to switch away from the deprecated test runner Makoto Onuki
A lot of ravenwood tests (and other tests too) use the deprecated test runner androidx.test.runner.AndroidJUnit4, but it actually has problems. We should switch them to androidx.test.ext.junit.runners.AndroidJUnit4. However, simply updating all tests could be problematic because: - we need to update the build rules and add "androidx.test.ext.junit" as a static dependency, which is probably safe but it could cause class conflicts.(?) - More importantly, the subtle difference between the test runner could make the device side test fail. So I'm going to do it in two steps: - Step 1 -- this CL: Add an optional validator to RavenwoodTest, which can be enabled with RAVENWOOD_OPTIONAL_VALIDATION=1. This makes a test fail if it's using the deprecated one. - Added a test for this - Added a script to replace the test runner. Test: run-ravenwood-tests Test: RAVENWOOD_OPTIONAL_VALIDATION=1 atest RavenwoodCoreTest Bug: 317131861 Change-Id: I5762bd097c3a529ae6e14460d9e326ed5c6086b4
2024-01-30Improve Ravenwood logging/messages. Jeff Sharkey
Emit "TestRunner" log messages around each test method, so that our local debugging logs match what developers experience with tests run on a physical device. Refine `onThrowMethodCalled()` message to be more descriptive about Ravenwood and link to docs. Bug: 322817109, 322526754 Test: atest FrameworksCoreTestsRavenwood Change-Id: Id9f6a936145dd2024295c2eb14666fc43a5c7e34
2024-01-26Offer `RavenwoodClassRule`. Jeff Sharkey
Some tests interact with yet-unsupported APIs under Ravenwood in their test class constructors, and `RavenwoodRule` arrives too late to effectively apply annotations like `@IgnoreUnderRavenwood`. This change adds `RavenwoodClassRule` which can be marked as an `@ClassRule` so that it runs in a static context before each test class is constructed, giving it a chance to respect annotations. We also adjust our annotation naming to match the naming style in JUnit Jupiter, which has annotations like `DisabledOnJre` and `EnabledOnOs`. Bug: 319647875 Test: atest SystemUiRoboTests Test: atest SystemUiRavenTests Change-Id: I7d834b8e74e961bb3d4befcad6204d99f8fe80e9
2023-12-12Support "probing" ignored tests; more Parcel impl. Jeff Sharkey
As test authors onboard their bivalent tests, they'll be using the `@IgnoreUnderRavenwood` annotation to quietly ignore tests that don't currently have enough Ravenwood support to run. However, over time the Ravenwood environment will continue to gain new functionality, and we'd like an easy way to "probe" those previously-ignored tests to see if any of them started passing. This change implements this using a locally-configured flag that unconditionally runs all tests under Ravenwood, and reports failures for any tests marked as `@IgnoreUnderRavenwood` that are now passing. (As these "failures" might be confusing for normal test authors, we leave it disabled by default in the build, and leave it for internal Ravenwood maintainers.) To confirm this works, implement two new methods on Parcel, and detect the relevant tests that started passing. Bug: 292141694 Test: atest CtsUtilTestCasesRavenwood CtsUtilTestCases Change-Id: Ied2a5e3d1781c76a4f3506192d015309f2f424b2
2023-11-21Support Handler/Looper for Ravenwood, with CTS. Jeff Sharkey
Now that we have a solid foundation of classes available, one of the tricker pieces is supporting Handler/Looper under Ravenwood. At its core, the native implementation of MessageQueue can be emulated using core JVM primitives, which is enough to reliably pass CTS. Advanced features like FileDescriptor events will need to wait until we eventually have real JNI support. Fix obscure bug with SystemClock; must be positive number. Always start our "fake" pointers from 1 to prevent `nullptr` oddness. Bug: 292141694 Test: atest-dev CtsOsTestCasesRavenwood CtsOsTestCases Change-Id: I0f82b659973443968ef2609a7e3151f381abff29
2023-11-16Build `ravenwood-junit` against `test_current`. Jeff Sharkey
Some CTS tests desire to link against `test_current` to prove to themselves that they're not touching hidden APIs. This means if they also want to use our `ravenwood-junit` rules, that dependency also needs to link against `test_current`. Since we're reaching down into plenty of hidden details when we're actually running on a Ravenwood runtime, we split into a `stub` and an `impl` library, so that we give a cleanly compiling library to to clients, which is then replaced under the Ravenwood runtime. Bug: 292141694 Test: atest-dev CtsTextTestCasesRavenwood CtsTextTestCases Change-Id: I96dbc9643324a7853a992e97b51a88f70eb721f3