From d6c5099209c45e11e04e7eaa78a74b2afb45fd08 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Thu, 15 Sep 2022 22:37:36 +0100 Subject: [PATCH 1/5] Make testing a default feature --- agb/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agb/Cargo.toml b/agb/Cargo.toml index f57b4df3..83afc851 100644 --- a/agb/Cargo.toml +++ b/agb/Cargo.toml @@ -16,7 +16,7 @@ lto = true debug = true [features] -default = [] +default = ["testing"] freq18157 = ["agb_sound_converter/freq18157"] freq32768 = ["agb_sound_converter/freq32768"] testing = [] From 39d3b5f6e823d5d49c3059786638f7c54d3f4bf1 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Thu, 15 Sep 2022 22:38:42 +0100 Subject: [PATCH 2/5] Add template to the workspace --- .vscode/agb.code-workspace | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.vscode/agb.code-workspace b/.vscode/agb.code-workspace index 171f1142..22a891d8 100644 --- a/.vscode/agb.code-workspace +++ b/.vscode/agb.code-workspace @@ -23,6 +23,9 @@ }, { "path": "../examples/hyperspace-roll" + }, + { + "path": "../template" } ] } \ No newline at end of file From 68fb9c7e020763fa0790bcac8163941aa8574e07 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Thu, 15 Sep 2022 22:39:44 +0100 Subject: [PATCH 3/5] Remove reference to the testing feature --- agb/src/lib.rs | 6 ------ examples/the-hat-chooses-the-wizard/Cargo.toml | 3 --- template/Cargo.toml | 3 --- 3 files changed, 12 deletions(-) diff --git a/agb/src/lib.rs b/agb/src/lib.rs index b3cd8b4a..6aea3136 100644 --- a/agb/src/lib.rs +++ b/agb/src/lib.rs @@ -253,12 +253,6 @@ impl Gba { /// #![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 = "", 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]`. /// diff --git a/examples/the-hat-chooses-the-wizard/Cargo.toml b/examples/the-hat-chooses-the-wizard/Cargo.toml index b8b3178b..510a14e8 100644 --- a/examples/the-hat-chooses-the-wizard/Cargo.toml +++ b/examples/the-hat-chooses-the-wizard/Cargo.toml @@ -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" diff --git a/template/Cargo.toml b/template/Cargo.toml index 645adb04..5f5bfafa 100644 --- a/template/Cargo.toml +++ b/template/Cargo.toml @@ -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 From 08360b5245519900474aaeacbadc18172a30ac1b Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Thu, 15 Sep 2022 22:41:10 +0100 Subject: [PATCH 4/5] Add a changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a36559d2..d90f2110 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. From 654bff0cb71d9a2e56a63a5595bc4441ab568734 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Thu, 15 Sep 2022 22:47:08 +0100 Subject: [PATCH 5/5] Mark ignore on test runner docs --- agb/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agb/src/lib.rs b/agb/src/lib.rs index 6aea3136..957e5950 100644 --- a/agb/src/lib.rs +++ b/agb/src/lib.rs @@ -247,7 +247,7 @@ 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))] @@ -256,7 +256,7 @@ impl Gba { /// 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);