Merge pull request #306 from gwilymk/make-testing-a-default-feature

Make testing a default feature
This commit is contained in:
Gwilym Kuiper 2022-09-15 22:55:08 +01:00 committed by GitHub
commit 1875465922
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 15 deletions

View file

@ -23,6 +23,9 @@
},
{
"path": "../examples/hyperspace-roll"
},
{
"path": "../template"
}
]
}

View file

@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed the fast magnitude function in agb_fixnum. This is also used in fast_normalise. Previously only worked for positive (x, y).
- Fixed formatting of fixed point numbers in the range (-1, 0), which previously appeared positive.
## Changed
- `testing` is now a default feature, so you no longer need to add a separate `dev-dependencies` line for `agb` in order to enable unit tests for your project.
## [0.11.1] - 2022/08/02
Version 0.11.1 brings documentation for fixed point numbers. We recommend all users upgrade to this version since it also includes fixes to a few functions in fixnum. See changed section for breaking changes.

View file

@ -16,7 +16,7 @@ lto = true
debug = true
[features]
default = []
default = ["testing"]
freq18157 = ["agb_sound_converter/freq18157"]
freq32768 = ["agb_sound_converter/freq32768"]
testing = []

View file

@ -247,22 +247,16 @@ impl Gba {
/// In order to use this, you need to enable the unstable `custom_test_framework` feature and copy-paste
/// the following into the top of your application:
///
/// ```
/// ```rust,ignore
/// #![cfg_attr(test, feature(custom_test_frameworks))]
/// #![cfg_attr(test, reexport_test_harness_main = "test_main")]
/// #![cfg_attr(test, test_runner(agb::test_runner::test_runner))]
/// ```
///
/// And ensure you add agb with the `testing` feature to your `dev-dependencies`
/// ```toml
/// [dev-dependencies]
/// agb = { version = "<same as in dependencies>", features = ["testing"] }
/// ```
///
/// With this support, you will be able to write tests which you can run using `mgba-test-runner`.
/// Tests are written using `#[test_case]` rather than `#[test]`.
///
/// ```
/// ```rust,ignore
/// #[test_case]
/// fn test_ping_pong(_gba: &mut Gba) {
/// assert_eq!(1, 1);

View file

@ -9,9 +9,6 @@ edition = "2018"
[dependencies]
agb = { version = "0.11.1", path = "../../agb" }
[dev-dependencies]
agb = { version = "0.11.1", path = "../../agb", features = ["testing"] }
[build-dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

View file

@ -9,9 +9,6 @@ edition = "2018"
[dependencies]
agb = "0.11.1"
[dev-dependencies]
agb = { version = "0.11.1", features = ["testing"] }
[profile.dev]
opt-level = 2
debug = true