diff options
author | 2025-02-18 10:40:33 -0800 | |
---|---|---|
committer | 2025-02-18 10:40:33 -0800 | |
commit | e16b65da6b54f34e8f6053d57fcc942f2cca1c25 (patch) | |
tree | b263997e297f1aff2d0c0559e35710abaaa6e19f | |
parent | 755f3741f4e5950e81d140f9613cb64e8d64c054 (diff) | |
parent | 2ccc0b0ad0c2ba6089bc8d271f656f7748ae9ae6 (diff) |
Merge "Add a basic unit test to ravenhelper" into main
4 files changed, 40 insertions, 1 deletions
diff --git a/ravenwood/TEST_MAPPING b/ravenwood/TEST_MAPPING index cb54e9f56c0c..df63cb9dfc50 100644 --- a/ravenwood/TEST_MAPPING +++ b/ravenwood/TEST_MAPPING @@ -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" }, diff --git a/ravenwood/scripts/run-ravenwood-tests.sh b/ravenwood/scripts/run-ravenwood-tests.sh index 27c5ea1bd0d7..67ebb1fc9473 100755 --- a/ravenwood/scripts/run-ravenwood-tests.sh +++ b/ravenwood/scripts/run-ravenwood-tests.sh @@ -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() { diff --git a/ravenwood/tools/ravenhelper/Android.bp b/ravenwood/tools/ravenhelper/Android.bp index a7ee4684506e..3da6dd824c37 100644 --- a/ravenwood/tools/ravenhelper/Android.bp +++ b/ravenwood/tools/ravenhelper/Android.bp @@ -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"], +} diff --git a/ravenwood/tools/ravenhelper/test/com/android/platform/test/ravenwood/ravenhelper/RavenhelperTest.kt b/ravenwood/tools/ravenhelper/test/com/android/platform/test/ravenwood/ravenhelper/RavenhelperTest.kt new file mode 100644 index 000000000000..203fab1544c9 --- /dev/null +++ b/ravenwood/tools/ravenhelper/test/com/android/platform/test/ravenwood/ravenhelper/RavenhelperTest.kt @@ -0,0 +1,27 @@ +/* + * 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 |