diff --git a/.circleci/config.yml b/.circleci/config.yml index bc9e22614ae..9b4f0dd6b5e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -70,42 +70,43 @@ workflows: ignore: /.*/ default: jobs: - - prepare-and-assemble - - changelog-verification: - filters: - branches: - ignore: /^(main|release-.*)/ - - static-analysis: - requires: - - prepare-and-assemble - - unit-tests-core: - requires: - - prepare-and-assemble - - unit-tests-ui: - requires: - - prepare-and-assemble - - unit-tests-androidauto: - requires: - - prepare-and-assemble - - ui-robo-tests: - requires: - - prepare-and-assemble - - internal-instrumentation-tests: - requires: - - prepare-and-assemble - - instrumentation-tests: - requires: - - prepare-and-assemble - - androidauto-test - - mobile-metrics-dry-run: - type: approval - - mobile-metrics-benchmarks: - requires: - - mobile-metrics-dry-run - - codecov-upload: - requires: - - unit-tests-ui - - unit-tests-core + - run-pitest-core +# - prepare-and-assemble +# - changelog-verification: +# filters: +# branches: +# ignore: /^(main|release-.*)/ +# - static-analysis: +# requires: +# - prepare-and-assemble +# - unit-tests-core: +# requires: +# - prepare-and-assemble +# - unit-tests-ui: +# requires: +# - prepare-and-assemble +# - unit-tests-androidauto: +# requires: +# - prepare-and-assemble +# - ui-robo-tests: +# requires: +# - prepare-and-assemble +# - internal-instrumentation-tests: +# requires: +# - prepare-and-assemble +# - instrumentation-tests: +# requires: +# - prepare-and-assemble +# - androidauto-test +# - mobile-metrics-dry-run: +# type: approval +# - mobile-metrics-benchmarks: +# requires: +# - mobile-metrics-dry-run +# - codecov-upload: +# requires: +# - unit-tests-ui +# - unit-tests-core #------------------------------ #---------- COMMANDS ---------- @@ -522,6 +523,17 @@ commands: #---------- JOBS ---------- #-------------------------- jobs: + run-pitest-core: + executor: ndk-r22-latest-executor + resource_class: 2xlarge + steps: + - checkout + - run: + name: Run pitests + command: make pitest-core + - store_artifacts: + path: libnavigation-core/build/reports/pitest + prepare-and-assemble: executor: ndk-r22-latest-executor steps: diff --git a/Makefile b/Makefile index 8520de11e97..d945d233672 100644 --- a/Makefile +++ b/Makefile @@ -239,3 +239,17 @@ update-metalava: car: adb forward tcp:5277 tcp:5277 cd $(ANDROID_HOME)/extras/google/auto/ && ./desktop-head-unit + +.PHONY: pitest +pitest: + $(call run-gradle-tasks,$(CORE_MODULES),pitestDebug) \ + && $(call run-gradle-tasks,$(UI_MODULES),pitestDebug) \ + && $(call run-gradle-tasks,$(ANDROIDAUTO_MODULES),pitestDebug) \ + +.PHONY: pitest-libnavigation-core +pitest-core: + ./gradlew :libnavigation-core:pitestDebug + +.PHONY: pitest-libnavui-dropin +pitest-libnavui-dropin: + ./gradlew :libnavui-dropin:pitestDebug diff --git a/android-auto-app/build.gradle b/android-auto-app/build.gradle index d4761344b65..1e1fc6590ff 100644 --- a/android-auto-app/build.gradle +++ b/android-auto-app/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'com.mapbox.maps.token' diff --git a/build.gradle b/build.gradle index e959361d65c..a11dd6ae6e6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ buildscript { apply from: "${rootDir}/gradle/dependencies.gradle" repositories { - google() mavenCentral() + google() maven { url 'https://api.mapbox.com/downloads/v2/releases/maven' authentication { @@ -15,10 +15,12 @@ buildscript { } gradlePluginPortal() } + dependencies { classpath pluginDependencies.gradle classpath pluginDependencies.kotlin classpath pluginDependencies.dependencyUpdates + classpath pluginDependencies.pitest classpath pluginDependencies.jacoco classpath pluginDependencies.googleServices classpath pluginDependencies.license diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 3cd0b874ca7..e8136fe710e 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -41,13 +41,13 @@ ext { materialDesignVersion : '1.1.0', autoValue : '1.5.4', autoValueParcel : '0.2.5', - junit : '4.12', + junit : '4.13.2', constraintLayout : '1.1.3', mockito : '2.23.4', - mockkVersion : '1.12.1', + mockkVersion : '1.12.3', leakCanaryVersion : '2.9.1', commonsIO : '2.6', - robolectric : '4.7.3', + robolectric : '4.8.1', mockwebserver : '4.9.0', gmsLocation : '17.0.0', ktlint : '0.47.1', @@ -154,6 +154,8 @@ ext { junit : "junit:junit:${version.junit}", mockito : "org.mockito:mockito-core:${version.mockito}", mockk : "io.mockk:mockk:${version.mockkVersion}", + mockkAgentApi : "io.mockk:mockk-agent-api:${version.mockkVersion}", + mockkAgentJvm : "io.mockk:mockk-agent-jvm:${version.mockkVersion}", mockkAndroid : "io.mockk:mockk-android:${version.mockkVersion}", commonsIO : "commons-io:commons-io:${version.commonsIO}", robolectric : "org.robolectric:robolectric:${version.robolectric}", @@ -191,7 +193,8 @@ ext { mapboxSdkRegistry : '0.7.0', mapboxAccessToken : '0.2.1', mapboxNativeDownload : '0.2.2', - firebaseCrashlytics : '2.5.1' + firebaseCrashlytics : '2.5.1', + pitest : '0.2.9' ] pluginDependencies = [ @@ -208,6 +211,7 @@ ext { mapboxSdkRegistry : "com.mapbox.gradle.plugins:sdk-registry:${pluginVersion.mapboxSdkRegistry}", mapboxAccessToken : "com.mapbox.gradle.plugins:access-token:${pluginVersion.mapboxAccessToken}", mapboxNativeDownload : "com.mapbox.gradle.plugins:native-download:${pluginVersion.mapboxNativeDownload}", - firebaseCrashlytics : "com.google.firebase:firebase-crashlytics-gradle:${pluginVersion.firebaseCrashlytics}" + firebaseCrashlytics : "com.google.firebase:firebase-crashlytics-gradle:${pluginVersion.firebaseCrashlytics}", + pitest : "pl.droidsonroids.gradle:gradle-pitest-plugin:${pluginVersion.pitest}" ] } diff --git a/gradle/pitest.gradle b/gradle/pitest.gradle new file mode 100644 index 00000000000..5f5ee71595e --- /dev/null +++ b/gradle/pitest.gradle @@ -0,0 +1,268 @@ +apply plugin: 'pl.droidsonroids.pitest' + +pitest { + targetClasses = ['com.mapbox.navigation.**'] + targetTests = ['com.mapbox.navigation.**Test**'] + pitestVersion = '1.11.1' + avoidCallsTo = ['kotlin.jvm.internal'] + threads = Runtime.getRuntime().availableProcessors() + outputFormats = ['XML', 'HTML'] + timestampedReports = false + verbose = true + exportLineCoverage = true + failWhenNoMutations = false + +// mutators = ['EMPTY_RETURNS'] + mutators = ['DEFAULTS'] + // https://pitest.org/quickstart/mutators/ +// mutators = ['DEFAULTS', 'CONSTRUCTOR_CALLS', 'EMPTY_RETURNS', 'FALSE_RETURNS', +// 'NULL_RETURNS', 'REMOVE_CONDITIONALS', 'REMOVE_INCREMENTS', 'EXPERIMENTAL_SWITCH'] + + excludedTestClasses = + [ + // libnavigation-base + 'com.mapbox.navigation.base.utils.route.RouteProgressExTest**', + 'com.mapbox.navigation.base.route.RouteExclusionsTest**', + 'com.mapbox.navigation.base.route.NavigationRouteTest**', + 'com.mapbox.navigation.base.internal.extensions.LocaleExTest**', + 'com.mapbox.navigation.base.internal.route.RouteCompatibilityCacheTest', + 'com.mapbox.navigation.base.internal.route.RouteProgressExTest**', + 'com.mapbox.navigation.base.internal.utils.DirectionsRouteExTest**', + 'com.mapbox.navigation.base.internal.utils.DirectionsRouteMissingConditionsCheckTest**', + 'com.mapbox.navigation.base.route.RouteExclusionsJavaTest**', + 'com.mapbox.navigation.base.formatter.DistanceFormatterOptionsTest', + 'com.mapbox.navigation.base.options.NavigationOptionsTest', + 'com.mapbox.navigation.base.internal.extensions.ContextExTest', + // libnavigation-core + 'com.mapbox.navigation.core.routerefresh.RouteRefreshControllerTest', + 'com.mapbox.navigation.core.formatter.MapboxDistanceFormatterTest', + 'com.mapbox.navigation.core.formatter.MapboxDistanceUtilTest', +// 'com.mapbox.navigation.core.trip.session.MapboxTripSessionTest', +// 'com.mapbox.navigation.core.trip.session.TripSessionLocationEngineTest', +// 'com.mapbox.navigation.core.trip.session.NavigationSessionTest', +// 'com.mapbox.navigation.core.history.MapboxHistoryRecorderTest', +// 'com.mapbox.navigation.core.RoutesCacheClearerTest', +// 'com.mapbox.navigation.core.trip.session.MapboxTripSessionNoSetupTest', +// 'com.mapbox.navigation.core.accounts.BillingControllerTest', +// 'com.mapbox.navigation.core.accounts.BillingControllerWaypointsComparisonTest', +// 'com.mapbox.navigation.core.arrival.ArrivalProgressObserverTest', +// 'com.mapbox.navigation.core.arrival.AutoArrivalControllerTest', +// 'com.mapbox.navigation.core.arrival.RouteStateObserverParametrizedTest', +// 'com.mapbox.navigation.core.directions.session.MapboxDirectionsSessionTest', +// 'com.mapbox.navigation.core.internal.HistoryRecordingStateHandlerCopilotTest', +// 'com.mapbox.navigation.core.internal.HistoryRecordingStateHandlerObserverRegisterTest', +// 'com.mapbox.navigation.core.internal.HistoryRecordingStateHandlerTest', +// 'com.mapbox.navigation.core.preview.RoutesPreviewControllerTest', +// 'com.mapbox.navigation.core.replay.history.MapboxReplayerTest', +// 'com.mapbox.navigation.core.replay.history.ReplayHistoryMapperTest', +// 'com.mapbox.navigation.core.replay.history.ReplayHistorySessionOptionsTest', +// 'com.mapbox.navigation.core.replay.history.ReplayHistorySessionTest', +// 'com.mapbox.navigation.core.replay.route.ReplayProgressObserverTest', +// 'com.mapbox.navigation.core.replay.route.ReplayRouteMapperTest', +// 'com.mapbox.navigation.core.replay.route.ReplayRouteInterpolatorTest', +// 'com.mapbox.navigation.core.reroute.MapboxRerouteControllerTest', +// 'com.mapbox.navigation.core.routealternatives.AlternativeRouteProgressDataProviderTest', +// 'com.mapbox.navigation.core.routeoptions.RouteOptionsUpdaterParameterizedTest', +// 'com.mapbox.navigation.core.routeoptions.RouteOptionsUpdaterTest**', +// 'com.mapbox.navigation.core.routerefresh.DirectionsRouteDiffProviderTest', +// 'com.mapbox.navigation.core.routerefresh.RouteRefreshStubTest', +// 'com.mapbox.navigation.core.telemetry.LocationsCollectorTes', +// 'com.mapbox.navigation.core.telemetry.NavigationFeedbackEventTest', +// 'com.mapbox.navigation.core.telemetry.events.FeedbackMetadataTest', +// 'com.mapbox.navigation.core.telemetry.events.FeedbackMetadataWrapperTest', +// 'com.mapbox.navigation.core.trip.MapboxTripStarterTest', +// 'com.mapbox.navigation.core.trip.session.BannerInstructionEventTest', +// 'com.mapbox.navigation.core.trip.session.MapboxTripSessionNoSetupTest', +// 'com.mapbox.navigation.core.trip.session.NavigationSessionUtilsGetNewHistoryRecordingSessionStateTest', +// 'com.mapbox.navigation.core.trip.session.NavigationSessionUtilsGetNewNavigationSessionStateTest', +// 'com.mapbox.navigation.core.telemetry.LocationsCollectorTest', +// 'com.mapbox.navigation.core.telemetry.events.NavigationCustomEventTest', +// 'com.mapbox.navigation.core.telemetry.events.NavigationArriveEventTest', +// 'com.mapbox.navigation.core.telemetry.events.NavigationCancelEventTest', +// 'com.mapbox.navigation.core.telemetry.events.NavigationDepartEventTest', +// 'com.mapbox.navigation.core.telemetry.events.NavigationFeedbackEventTest', +// 'com.mapbox.navigation.core.telemetry.events.NavigationRerouteEventTest', +// '**MapboxNavigation**Test**', + // libnavigation-copilot + 'com.mapbox.navigation.copilot.MapboxCopilotTest', + 'com.mapbox.navigation.copilot.HistoryAttachmentsUtilsTest', + 'com.mapbox.navigation.copilot.HistoryUploadWorkerTest', + 'com.mapbox.navigation.copilot.MapboxCopilotImplTest', + // libtrip-notification + + 'com.mapbox.navigation.trip.notification.internal.TimeFormatterTest', + // libnavui-base + 'com.mapbox.navigation.ui.base.view.MapboxExtendableButtonTest', + 'com.mapbox.navigation.ui.base.lifecycle.UICoordinatorTest', + // libnavui-maps + 'com.mapbox.navigation.ui.maps.view.MapboxCameraModeButtonTest', + 'com.mapbox.navigation.ui.maps.route.arrow.RouteArrowUtilsRoboTest', + 'com.mapbox.navigation.ui.maps.route.line.api.MapboxRouteLineApiTest', + 'com.mapbox.navigation.ui.maps.route.line.api.MapboxRouteLineApiRoboTest', + 'com.mapbox.navigation.ui.maps.roadname.view.MapboxRoadNameLabelViewTest', + 'com.mapbox.navigation.ui.maps.internal.ui.RouteLineComponentTest', + 'com.mapbox.navigation.ui.maps.internal.ui.RouteArrowComponentTest', + 'com.mapbox.navigation.ui.maps.internal.ui.RouteAlternativeComponentTest', + 'com.mapbox.navigation.ui.maps.internal.ui.NavigationCameraComponentTest', + 'com.mapbox.navigation.ui.maps.internal.ui.MapboxRecenterButtonComponentContractTest', + 'com.mapbox.navigation.ui.maps.internal.ui.RoadNameComponentTest', + 'com.mapbox.navigation.ui.maps.internal.ui.RecenterButtonComponentTest', + 'com.mapbox.navigation.ui.maps.internal.ui.LocationPuckComponentTest', + 'com.mapbox.navigation.ui.maps.internal.ui.LocationComponentTest', + 'com.mapbox.navigation.ui.maps.internal.ui.CameraModeButtonComponentTest', + 'com.mapbox.navigation.ui.maps.internal.route.line.MapboxRouteLineUtilsTest', + 'com.mapbox.navigation.ui.maps.PredictiveCacheControllerTest', + 'com.mapbox.navigation.ui.maps.internal.ui.BuildingHighlightComponentTest', + 'com.mapbox.navigation.ui.maps.internal.route.line.MapboxRouteLineUtilsRoboTest', + 'com.mapbox.navigation.ui.maps.guidance.signboard.api.MapboxExternalFileResolverTest', + 'com.mapbox.navigation.ui.maps.camera.view.MapboxRouteOverviewButtonTest', + 'com.mapbox.navigation.ui.maps.camera.view.MapboxRecenterButtonTest', + 'com.mapbox.navigation.ui.maps.guidance.signboard.view.MapboxSignboardViewTest', + 'com.mapbox.navigation.ui.maps.guidance.signboard.api.MapboxExternalFileResolverTest', + 'com.mapbox.navigation.ui.maps.guidance.junction.view.MapboxJunctionViewTest', + 'com.mapbox.navigation.ui.maps.guidance.restarea.view.MapboxRestAreaGuideMapViewTest', + 'com.mapbox.navigation.ui.maps.internal.ui.CameraModeButtonComponentTest', + 'com.mapbox.navigation.ui.maps.internal.ui.RoadNameComponentTest', + 'com.mapbox.navigation.ui.maps.roadname.view.MapboxRoadNameViewTest', + 'com.mapbox.navigation.ui.maps.route.line.model.RouteLineResourcesTest', + 'com.mapbox.navigation.ui.maps.route.line.model.RouteLineColorResourcesTest', + 'com.mapbox.navigation.ui.maps.internal.ui.MapboxCameraModeButtonComponentContractTest', + 'com.mapbox.navigation.ui.maps.building.BuildingProcessorTest', + 'com.mapbox.navigation.ui.maps.building.api.MapboxBuildingsApiTest', + 'com.mapbox.navigation.ui.maps.building.model.BuildingHighlightOptionsTest', + 'com.mapbox.navigation.ui.maps.building.view.MapboxBuildingViewTest', + 'com.mapbox.navigation.ui.maps.camera.data.ViewportDataSourceProcessorTest', + 'com.mapbox.navigation.ui.maps.camera.lifecycle.BasicNavigationCameraLifecycleControllerTest', + 'com.mapbox.navigation.ui.maps.camera.lifecycle.NavigationScaleGestureHandlerOptionsTest', + 'com.mapbox.navigation.ui.maps.guidance.junction.JunctionProcessorTest', + 'com.mapbox.navigation.ui.maps.guidance.junction.api.MapboxRasterToBitmapParserTest', + 'com.mapbox.navigation.ui.maps.guidance.restarea.RestAreaProcessorTest', + 'com.mapbox.navigation.ui.maps.guidance.signboard.SignboardProcessorTest', + 'com.mapbox.navigation.ui.maps.internal.extensions.MapboxStyleExtensionsKtTest', + 'com.mapbox.navigation.ui.maps.location.NavigationLocationProviderTest', + 'com.mapbox.navigation.ui.maps.internal.extensions.NavigationCameraFlowableTest', + '', + // libnavui-tripprogress + 'com.mapbox.navigation.ui.tripprogress.view.MapboxTripProgressViewTest', + 'com.mapbox.navigation.ui.tripprogress.model.TripProgressUpdateFormatterTest', + 'com.mapbox.navigation.ui.tripprogress.model.TimeRemainingFormatterTest', + 'com.mapbox.navigation.ui.tripprogress.model.DistanceRemainingFormatterTest', + 'com.mapbox.navigation.ui.tripprogress.internal.ui.TripProgressComponentTest', + 'com.mapbox.navigation.ui.tripprogress.api.MapboxTripProgressApiTest', + 'com.mapbox.navigation.ui.tripprogress.TripProgressProcessorTest', + 'com.mapbox.navigation.ui.tripprogress.model.EstimatedTimeToArrivalFormatterTest', + 'com.mapbox.navigation.ui.tripprogress.model.TripProgressViewOptionsTest', + // libnavui-maneuver + 'com.mapbox.navigation.ui.maneuver.api.MapboxManeuverApiTest', + 'com.mapbox.navigation.ui.maneuver.internal.ManeuverComponentTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxExitTextTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxLaneGuidanceTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxPrimaryManeuverTest', + 'com.mapbox.navigation.ui.maneuver.ManeuverProcessorTest', + 'com.mapbox.navigation.ui.maneuver.model.ManeuverInstructionGeneratorTest', + 'com.mapbox.navigation.ui.maneuver.model.RoadShieldGeneratorTest', + 'com.mapbox.navigation.ui.maneuver.model.ExitStyleGeneratorTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxPrimaryManeuverTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxTurnIconManeuverTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxStepDistanceTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxLaneGuidanceAdapterTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxSecondaryManeuverTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxSubManeuverTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxManeuverViewTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxUpcomingManeuverAdapterTest', + // libnavui-voice + 'com.mapbox.navigation.ui.voice.view.MapboxSoundButtonTest', + 'com.mapbox.navigation.ui.voice.model.SpeechAnnouncementTest', + 'com.mapbox.navigation.ui.voice.internal.ui.AudioGuidanceButtonComponentTest', + 'com.mapbox.navigation.ui.voice.internal.impl.MapboxVoiceInstructionsTest', + 'com.mapbox.navigation.ui.voice.api.VoiceInstructionsPrefetcherTest', + 'com.mapbox.navigation.ui.voice.api.MapboxAudioGuidanceTest', + 'com.mapbox.navigation.ui.voice.internal.impl.MapboxAudioGuidanceServicesTest', + 'com.mapbox.navigation.ui.voice.api.MapboxSpeechApiTest', + 'com.mapbox.navigation.ui.voice.api.PreOreoAudioFocusDelegateTest', + 'com.mapbox.navigation.ui.voice.api.VoiceInstructionsPlayerAttributesTest', + 'com.mapbox.navigation.ui.voice.internal.impl.MapboxAudioGuidanceVoiceTest', + // libnavui-speedlimit + 'com.mapbox.navigation.ui.speedlimit.view.MapboxSpeedLimitViewTest', + 'com.mapbox.navigation.ui.speedlimit.internal.SpeedInfoComponentTest', + 'com.mapbox.navigation.ui.speedlimit.internal.SpeedLimitComponentTest', + 'com.mapbox.navigation.ui.speedlimit.model.MapboxSpeedInfoOptionsTest', + 'com.mapbox.navigation.ui.speedlimit.model.SpeedLimitFormatterTest', + 'com.mapbox.navigation.ui.speedlimit.view.MapboxSpeedInfoViewTest', + 'com.mapbox.navigation.ui.speedlimit.SpeedLimitProcessorTest', + 'com.mapbox.navigation.ui.speedlimit.api.MapboxSpeedInfoApiTest', + '', + // libnavui-status + 'com.mapbox.navigation.ui.status.view.MapboxStatusViewTest', + // libnavui-dropin +// 'com.mapbox.navigation.dropin.analytics.AnalyticsComponentTest', +// 'com.mapbox.navigation.dropin.camera.CameraComponentTest', +// 'com.mapbox.navigation.dropin.camera.CameraModeButtonComponentContractImplTest', +// 'com.mapbox.navigation.dropin.map.geocoding.GeocodingComponentTest', +// 'com.mapbox.navigation.dropin.map.longpress.FreeDriveLongPressMapComponentTest', +// 'com.mapbox.navigation.dropin.map.longpress.RoutePreviewLongPressMapComponentTest', +// 'com.mapbox.navigation.dropin.navigationview.MapboxNavigationViewApiTest', +// 'com.mapbox.navigation.dropin.arrival.ArrivalTextComponentTest', +// 'com.mapbox.navigation.dropin.camera.CameraLayoutObserverTest', +// 'com.mapbox.navigation.dropin.actionbutton.CameraModeButtonBinderTest', +// 'com.mapbox.navigation.dropin.actionbutton.CompassButtonBinderTest', +// 'com.mapbox.navigation.dropin.EmptyBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelEndNavigationButtonBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderActiveGuidanceBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderArrivalBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderDestinationPreviewBinderTest', +// 'com.mapbox.navigation.dropin.actionbutton.AudioGuidanceButtonBinderTest', +// 'com.mapbox.navigation.dropin.actionbutton.ActionButtonsCoordinatorTest', +// 'com.mapbox.navigation.dropin.actionbutton.ActionButtonsBinderTest', +// 'com.mapbox.navigation.dropin.actionbutton.RecenterButtonBinderTest', +// 'com.mapbox.navigation.dropin.navigationview.NavigationViewStylesTest', +// 'com.mapbox.navigation.dropin.navigationview.NavigationViewOptionsTest', +// 'com.mapbox.navigation.dropin.tripprogress.TripProgressBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderRoutesPreviewBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.MapboxInfoPanelBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelStartNavigationButtonBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelPoiNameBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelRoutePreviewButtonBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelArrivalTextBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelCoordinatorTest', +// 'com.mapbox.navigation.dropin.maneuver.ManeuverCoordinatorTest', +// 'com.mapbox.navigation.dropin.maneuver.ManeuverViewBinderTest', +// 'com.mapbox.navigation.dropin.map.scalebar.ScalebarPlaceholderBinderTest', +// 'com.mapbox.navigation.dropin.map.scalebar.ScalebarComponentTest', +// 'com.mapbox.navigation.dropin.map.geocoding.POINameComponentTest', +// 'com.mapbox.navigation.dropin.map.MapLayoutCoordinatorTest', +// 'com.mapbox.navigation.dropin.map.MapViewBinderTest', +// 'com.mapbox.navigation.dropin.map.marker.MapMarkerFactoryTest', +// 'com.mapbox.navigation.dropin.speedlimit.SpeedInfoViewBinderTest', +// 'com.mapbox.navigation.dropin.speedlimit.SpeedLimitCoordinatorTest', +// 'com.mapbox.navigation.dropin.speedlimit.SpeedLimitViewBinderTest', +// 'com.mapbox.navigation.dropin.roadname.RoadNameCoordinatorTest', +// 'com.mapbox.navigation.dropin.roadname.RoadNameViewBinderTest', + // libnavui-app + 'com.mapbox.navigation.ui.app.internal.routefetch.RouteOptionsProviderTest', + 'com.mapbox.navigation.ui.app.internal.controller.CameraStateControllerTest', + 'com.mapbox.navigation.ui.app.internal.controller.LocationStateControllerTest', + 'com.mapbox.navigation.ui.app.internal.controller.NavigationStateControllerTest', + 'com.mapbox.navigation.ui.app.internal.controller.RouteAlternativeComponentImplTest', + 'com.mapbox.navigation.ui.app.internal.controller.RoutePreviewStateControllerTest', + 'com.mapbox.navigation.ui.app.internal.controller.RouteStateControllerTest', + // libnavui-androidauto + 'com.mapbox.androidauto.settings.CarSettingsScreenTest', + 'com.mapbox.androidauto.navigation.maneuver.CarManeuverIconOptionsTest', + 'com.mapbox.androidauto.placeslistonmap.PlacesListOnMapLayerUtilTest', + // libnavui-shield + + 'com.mapbox.navigation.ui.shield.model.RouteShieldTest', + 'com.mapbox.navigation.ui.shield.RoadShieldContentManagerImplTest', + 'com.mapbox.navigation.ui.shield.ShieldSpritesCacheTest', + '', + '', + // libnavigation-router + + 'com.mapbox.navigation.route.internal.RouterWrapperTests', + // libnavui-util + 'com.mapbox.navigation.ui.utils.internal.lifecycle.ViewLifecycleRegistryTest', + ] + + // Use feature EXPORT for debug + // features = ["+EXPORT"] +} diff --git a/libnavigation-android/build.gradle b/libnavigation-android/build.gradle index 22795f76ce2..a397b84aea8 100644 --- a/libnavigation-android/build.gradle +++ b/libnavigation-android/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavigation-base/build.gradle b/libnavigation-base/build.gradle index 60b0c36ebcb..72e74ab83a3 100644 --- a/libnavigation-base/build.gradle +++ b/libnavigation-base/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'org.jetbrains.dokka' diff --git a/libnavigation-copilot/build.gradle b/libnavigation-copilot/build.gradle index a7468d87c02..6f3b5a8347c 100644 --- a/libnavigation-copilot/build.gradle +++ b/libnavigation-copilot/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'org.jetbrains.dokka' @@ -33,6 +37,7 @@ dependencies { testImplementation project(':libtesting-navigation-util') testImplementation project(':libtesting-utils') + implementation dependenciesList.androidXAppCompat apply from: "../gradle/unit-testing-dependencies.gradle" } @@ -53,4 +58,8 @@ dokkaHtmlPartial { apply from: "../gradle/track-public-apis.gradle" apply from: "../gradle/publish.gradle" -apply from: "../gradle/jacoco.gradle" \ No newline at end of file +apply from: "../gradle/jacoco.gradle" + +task pitestRun(type: Exec, dependsOn: ':libnavigation-copilot:pitestDebug') { + +} \ No newline at end of file diff --git a/libnavigation-core/build.gradle b/libnavigation-core/build.gradle index 45df7ab9071..bdfed3fef2e 100644 --- a/libnavigation-core/build.gradle +++ b/libnavigation-core/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavigation-metrics/build.gradle b/libnavigation-metrics/build.gradle index 6dfb149daea..571f248934a 100644 --- a/libnavigation-metrics/build.gradle +++ b/libnavigation-metrics/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'org.jetbrains.dokka' diff --git a/libnavigation-router/build.gradle b/libnavigation-router/build.gradle index 5cd5c85613d..de0d206db67 100644 --- a/libnavigation-router/build.gradle +++ b/libnavigation-router/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavigation-util/build.gradle b/libnavigation-util/build.gradle index dbadaa79c7a..323aa785d94 100644 --- a/libnavigation-util/build.gradle +++ b/libnavigation-util/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-parcelize' @@ -40,4 +44,8 @@ dependencies { apply from: "../gradle/track-public-apis.gradle" apply from: "../gradle/publish.gradle" -apply from: "../gradle/jacoco.gradle" \ No newline at end of file +apply from: "../gradle/jacoco.gradle" + +task pitestRunUtils(type: Copy, dependsOn: ':libnavigation-util:pitestDebug') { + +} \ No newline at end of file diff --git a/libnavigator/build.gradle b/libnavigator/build.gradle index 15f9d08a4bc..b52b49a4a4a 100644 --- a/libnavigator/build.gradle +++ b/libnavigator/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'com.jaredsburrows.license' diff --git a/libnavui-androidauto/build.gradle b/libnavui-androidauto/build.gradle index f8ec05eae61..aec9452a65a 100644 --- a/libnavui-androidauto/build.gradle +++ b/libnavui-androidauto/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-app/build.gradle b/libnavui-app/build.gradle index 61c2ff0d412..345261d094e 100644 --- a/libnavui-app/build.gradle +++ b/libnavui-app/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-base/build.gradle b/libnavui-base/build.gradle index c5227d511a4..ee7cd890ee1 100644 --- a/libnavui-base/build.gradle +++ b/libnavui-base/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-dropin/build.gradle b/libnavui-dropin/build.gradle index 93bc336a334..2f2a1eef188 100644 --- a/libnavui-dropin/build.gradle +++ b/libnavui-dropin/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-maneuver/build.gradle b/libnavui-maneuver/build.gradle index 6fde9bdafe7..bcdfdec1a93 100644 --- a/libnavui-maneuver/build.gradle +++ b/libnavui-maneuver/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-maps/build.gradle b/libnavui-maps/build.gradle index ba22359421b..edb982cb5a9 100644 --- a/libnavui-maps/build.gradle +++ b/libnavui-maps/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-resources/build.gradle b/libnavui-resources/build.gradle index 5986e8dce95..3b3df9a20ee 100644 --- a/libnavui-resources/build.gradle +++ b/libnavui-resources/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-shield/build.gradle b/libnavui-shield/build.gradle index 79ffbcb505a..6ed2df8e66b 100644 --- a/libnavui-shield/build.gradle +++ b/libnavui-shield/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-speedlimit/build.gradle b/libnavui-speedlimit/build.gradle index 9f4cadf6eb7..d40dd03543d 100644 --- a/libnavui-speedlimit/build.gradle +++ b/libnavui-speedlimit/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-status/build.gradle b/libnavui-status/build.gradle index 877c0769f56..498715b20b0 100644 --- a/libnavui-status/build.gradle +++ b/libnavui-status/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-tripprogress/build.gradle b/libnavui-tripprogress/build.gradle index 05222ce61c1..9b7eb3e5530 100644 --- a/libnavui-tripprogress/build.gradle +++ b/libnavui-tripprogress/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-util/build.gradle b/libnavui-util/build.gradle index e1271b074f7..a88622c5988 100644 --- a/libnavui-util/build.gradle +++ b/libnavui-util/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-voice/build.gradle b/libnavui-voice/build.gradle index 22bcbe8bbc3..3c309a7bf7d 100644 --- a/libnavui-voice/build.gradle +++ b/libnavui-voice/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libtesting-utils/build.gradle b/libtesting-utils/build.gradle index ba4e6179d90..3097d9306b2 100644 --- a/libtesting-utils/build.gradle +++ b/libtesting-utils/build.gradle @@ -22,8 +22,13 @@ dependencies { implementation dependenciesList.junit implementation dependenciesList.androidXAnnotation implementation dependenciesList.coroutinesTestAndroid - implementation dependenciesList.kotlinReflect implementation dependenciesList.mapboxCommonNative + api dependenciesList.kotlinReflect implementation dependenciesList.mockk + api dependenciesList.mockkAgentJvm + api dependenciesList.mockkAgentApi implementation 'org.json:json:20210307' + + // need for pitest + api "com.mapbox.mapboxsdk:auto-value-gson:0.0.1" } \ No newline at end of file diff --git a/libtrip-notification/build.gradle b/libtrip-notification/build.gradle index ada649bc4d4..bf7740f5cdb 100644 --- a/libtrip-notification/build.gradle +++ b/libtrip-notification/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' @@ -39,6 +43,7 @@ dependencies { implementation dependenciesList.coroutinesAndroid apply from: "../gradle/unit-testing-dependencies.gradle" + testImplementation(project(':libtesting-utils')) } apply from: "../gradle/track-public-apis.gradle"