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

Commit 2ccc0b0a authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Add a basic unit test to ravenhelper

So that at least run-ravenwood-tests.sh would catch build errors.

Flag: EXEMPT host test change only
Bug: 292141694
Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh -s
Change-Id: I2bffb945db0d7b2f69df59d88460de55f126e577
parent 54de11bc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  "presubmit": [
    { "name": "tiny-framework-dump-test" },
    { "name": "hoststubgentest" },
    { "name": "ravenhelpertest" },
    { "name": "hoststubgen-test-tiny-test" },
    { "name": "hoststubgen-invoke-test" },
    { "name": "RavenwoodMockitoTest_device" },
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ esac
done
shift $(($OPTIND - 1))

all_tests=(hoststubgentest tiny-framework-dump-test hoststubgen-invoke-test ravenwood-stats-checker)
all_tests=(hoststubgentest tiny-framework-dump-test hoststubgen-invoke-test ravenwood-stats-checker ravenhelpertest)
all_tests+=( $(${0%/*}/list-ravenwood-tests.sh) )

filter() {
+11 −0
Original line number Diff line number Diff line
@@ -24,3 +24,14 @@ java_binary_host {
    ],
    visibility: ["//visibility:public"],
}

java_test_host {
    name: "ravenhelpertest",
    srcs: ["test/**/*.kt"],
    static_libs: [
        "ravenhelper",
        "truth",
    ],
    test_suites: ["general-tests"],
    visibility: ["//visibility:private"],
}
+27 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 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 com.android.platform.test.ravenwood.ravenhelper

import com.android.platform.test.ravenwood.ravenhelper.psi.createUastEnvironment
import org.junit.Test

class RavenhelperTest {
    @Test
    fun testPsiInitialization() {
        val env = createUastEnvironment()
        env.dispose()
    }
}
 No newline at end of file