gba_test_macros

Crates.iogba_test_macros
lib.rsgba_test_macros
version0.1.1
sourcesrc
created_at2024-06-06 20:29:37.48076
updated_at2024-06-06 21:05:22.373038
description#[test] attribute for writing tests to be run on the Game Boy Advance.
homepage
repositoryhttps://github.com/Anders429/gba_test
max_upload_size
id1264057
size21,954
Anders Evensen (Anders429)

documentation

README

gba_test_macros

GitHub Workflow Status crates.io docs.rs License

Provides the #[test] attribute for annotating tests that should be run on the Game Boy Advance.

Installation

This crate is meant to be used with the gba_test crate. In most cases, it is easiest to simply use gba_test with the macros feature enabled by specifying the following in your Cargo.toml:

[dependencies]
gba_test = {version = "0.1.0", features = ["macros"]}

gba_test's macros feature is enabled by default.

Usage

You can use the provided #[test] attribute to write tests in the same way you would normally write tests in Rust:

#![feature(custom_test_frameworks)]

#[cfg(test)]
mod tests {
    use gba_test_runner::test;

    #[test]
    fn it_works() {
        let result = 2 + 2;
        assert_eq!(result, 4);
    }
}

Note that you should use the #[test] attribute provided by this crate, not the default #[test] attribute.

Also note that use of this macro currently depends on the custom_test_frameworks unstable Rust feature. As such, you will need to enable it in any crate that writes tests using this crate.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 197

cargo fmt