This is a little helper component to make it easier to debug issues with crash reporting, by letting you deliberately crash a consuming app.
The Crash Testing Helper APIs let you deliberately crash your application in a variety of ways:
- By triggering a hard abort inside the Rust code of the component, which should surface as a crash of the application.
- 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.
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.
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!
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
To effectively work on the Crash Testing Helper APIs, you will need to be familiar with:
- Our general guidelines for contributors.
- The way we use uniffi-rs to generate API wrappers for multiple languages, such as Kotlin and Swift.
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
.
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