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

Commit 348b8b74 authored by Chris Poultney's avatar Chris Poultney
Browse files

Configure existing ThemePicker Robolectric tests to run with atest.

For now, broken tests are marked @Ignore.

Also moves Robolectric tests into directory under tests/ for similar
structure to other test code in the wider codebase.

Bug: 260777356
Bug: 260925899
Test: this is the test
Change-Id: I25c4efdb73dc5eb88611efac669de13fa2be0c3d
Merged-In: I25c4efdb73dc5eb88611efac669de13fa2be0c3d
parent 491b50af
Loading
Loading
Loading
Loading

robolectric_tests/Android.mk

deleted100644 → 0
+0 −60
Original line number Diff line number Diff line
# Copyright (C) 2019 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.

#############################################
# ThenePicker Robolectric test target.      #
#############################################
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := ThemePickerRoboTests
LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
LOCAL_LICENSE_CONDITIONS := notice
LOCAL_SDK_VERSION := system_current
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_STATIC_JAVA_LIBRARIES := \
    androidx.test.core \
    androidx.test.runner \
    androidx.test.rules \
    mockito-robolectric-prebuilt \
    truth-prebuilt
LOCAL_JAVA_LIBRARIES := \
    platform-robolectric-4.8.2-prebuilt

LOCAL_JAVA_RESOURCE_DIRS := config

LOCAL_INSTRUMENTATION_FOR := ThemePicker
LOCAL_MODULE_TAGS := optional

include $(BUILD_STATIC_JAVA_LIBRARY)

############################################
# Target to run the previous target.       #
############################################
include $(CLEAR_VARS)

LOCAL_MODULE := RunThemePickerRoboTests
LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
LOCAL_LICENSE_CONDITIONS := notice
LOCAL_SDK_VERSION := system_current
LOCAL_JAVA_LIBRARIES := \
    ThemePickerRoboTests

LOCAL_TEST_PACKAGE := ThemePicker

LOCAL_INSTRUMENT_SOURCE_DIRS := packages/apps/ThemePicker/src \

LOCAL_ROBOTEST_TIMEOUT := 36000

include prebuilts/misc/common/robolectric/4.8.2/run_robotests.mk
+0 −2
Original line number Diff line number Diff line
manifest=packages/apps/ThemePicker/AndroidManifest.xml
sdk=31
+17 −0
Original line number Diff line number Diff line

package {
    default_applicable_licenses: ["Android-Apache-2.0"],
}
android_robolectric_test {
    name: "ThemePickerRoboTests",
    srcs: [
        "src/**/*.java",
        "src/**/*.kt",
    ],
    java_resource_dirs: ["config"],
    libs: [
        "androidx.test.core",
        "androidx.test.runner",
    ],
    instrumentation_for: "ThemePicker",
}
+20 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2022 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.
  -->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.customization">
    <application/>
</manifest>
+1 −0
Original line number Diff line number Diff line
sdk=NEWEST_SDK
Loading