From 41cfbb3f010ca14bc952615e9b79a91bd0ddf921 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Thu, 16 Nov 2023 09:26:28 -0700 Subject: Build `ravenwood-junit` against `test_current`. 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 --- .../platform/test/ravenwood/RavenwoodRuleImpl.java | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 ravenwood/junit-stub-src/android/platform/test/ravenwood/RavenwoodRuleImpl.java (limited to 'ravenwood/junit-stub-src') diff --git a/ravenwood/junit-stub-src/android/platform/test/ravenwood/RavenwoodRuleImpl.java b/ravenwood/junit-stub-src/android/platform/test/ravenwood/RavenwoodRuleImpl.java new file mode 100644 index 000000000000..ecaff8084888 --- /dev/null +++ b/ravenwood/junit-stub-src/android/platform/test/ravenwood/RavenwoodRuleImpl.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.platform.test.ravenwood; + +public class RavenwoodRuleImpl { + public static void init(RavenwoodRule rule) { + // Must be provided by impl to reference runtime internals + throw new UnsupportedOperationException(); + } + + public static void reset(RavenwoodRule rule) { + // Must be provided by impl to reference runtime internals + throw new UnsupportedOperationException(); + } +} -- cgit v1.2.3-59-g8ed1b