Skip to content

Latest commit

 

History

History

crashtest

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Crash Testing Helper APIs

This is a little helper component to make it easier to debug issues with crash reporting, by letting you deliberately crash a consuming app.

Features

The Crash Testing Helper APIs let you deliberately crash your application in a variety of ways:

  1. By triggering a hard abort inside the Rust code of the component, which should surface as a crash of the application.
  2. By triggering a panic inside the Rust code of the component, which should surface as an "internal error" exception to the calling code.

The component does not offer any support for crash reporting, debugging etc itself, it's just designed to let you more easily test those things in your application.

Using the Crash Testing Helper APIs

Before using this component

This component does not currently integrate with the Glean SDK and does not submit any telemetry, so you do not need to request a data-review before using this component.

Prerequisites

To use this component, you should be familiar with how to integrate application-services components into an application on your target platform:

  • Android: Add the mozilla.appservices.crashtest package as a gradle dependency, but make sure you're using the same version of application-services as used by Android Components.
  • iOS: start with the guide to consuming rust components on iOS.
  • Other Platforms: we don't know yet; please reach out on slack to discuss!

Component API

For details on how to use this component, consult the public interface definition or view the generated Rust API documentation by running:

cargo doc --no-deps --open

Working on the Crash Testing Helper APIs

Prerequisites

To effectively work on the Crash Testing Helper APIs, you will need to be familiar with:

Overview

This component uses uniffi-rs to create its public API surface in Rust, and then generate bindings for Kotlin and Swift. The code is organized as follows:

  • The public API surface is implemented in ./src/lib.rs, with matching declarations in ./src/crashtest.udl to define how it gets exposed to other languages.
  • The ./android/ directory contains android-specific build scripts that generate Kotlin wrappers and publish them as an AAR, and some Android tests.
  • The ./ios/ directory is a placeholder for generated Swift code. There are a couple of Swift tests in /megazords/ios-rust/MozillaTestServicesTests/CrashTestTests.swift.

Detailed Docs

We use rustdoc to document both the public API of this component and its various internal implementation details. View the docs by running:

cargo doc --no-deps --document-private-items --open