Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for custom test attributes #82

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 11 additions & 29 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,18 @@ This is the changelog for [parameterized](https://github.com/foresterre/paramete
which provides an attribute macro, to be used for parameterized testing.

If you found an issue, have a suggestion or want to provide feedback or insights, please feel free to open an issue on
the [issue tracker](https://github.com/foresterre/parameterized/issues), or open a topic in the [discussions section](https://github.com/foresterre/parameterized/discussions).
the [issue tracker](https://github.com/foresterre/parameterized/issues), or open a topic in
the [discussions section](https://github.com/foresterre/parameterized/discussions).

## [1.1.0] - 2023-10-13
## [2.0.0] - 2024-03-05

### Added
# Added

* `parameterized-macro` now supports test signatures with any return type supported by the test macro, not just the unit type
* Added support for custom test macros (e.g., `#[tokio::test]` instead of the default `#[test]`) by specifying the
`#[parameterized_macro(...)]` attribute.

**Example**

```rust
use parameterized::parameterized;

#[parameterized(v = { Ok(1), Err("Oh noes".to_string()) })]
fn my_test(v: Result<u32, String>) -> Result<(), String> {
let value = v?; // Can use the question mark operator here, since return type is Result, which implements the Termination trait

assert_eq!(value, 1);

Ok(())
}
```

### Changed

* Updated MSRV to Rust `1.56`
* Updated parameterized-macro to `1.1.0`

[1.1.0]: https://github.com/foresterre/parameterized/releases/tag/v1.1.0
* `#[parameterized]` macro now parses and regenerates optional `const`, `async`, `unsafe` and return type items for `fn`
definitions.

## [1.0.1] - 2022-11-09

Expand All @@ -55,17 +38,16 @@ fn my_test(v: Result<u32, String>) -> Result<(), String> {

### Fixed

* Fix issue where parameterized-macro used the public API of the syn::export module which the docs described as
a non-public implementation details module, not covered by semver

* Fix issue where parameterized-macro used the public API of the syn::export module which the docs described as
a non-public implementation details module, not covered by semver

[0.3.1]: https://github.com/foresterre/parameterized/releases/tag/v0.3.1

## [0.3.0] - 2020-12-30

This release consists of internal changes. There are no changes for users.
An alternative syntax which was added after 0.2.0, but was never released,
has been moved into its own project named [Yare](https://github.com/foresterre/yare).
has been moved into its own project named [Yare](https://github.com/foresterre/yare).

[0.3.0]: https://github.com/foresterre/parameterized/releases/tag/v0.3.0

Expand Down
91 changes: 39 additions & 52 deletions Cargo.lock.msrv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
[package]
name = "parameterized"
version = "1.1.0"
version = "1.0.1"
authors = ["Martijn Gribnau <garm@ilumeo.com>"]
edition = "2021"
edition = "2018"
license = "MIT OR Apache-2.0"
description = "Procedural macro which brings a compact parameterized testing implementation to Rust (inspired by JUnit @ParameterizedTest)"
documentation = "https://docs.rs/crate/parameterized"
repository = "https://github.com/foresterre/parameterized"
readme = "README.md"
keywords = ["parameterized", "parametrized", "test", "unit-test", "junit"]
categories = ["development-tools", "development-tools::testing"]
rust-version = "1.56"

[package.metadata]
msrv = "1.56.0"

[dependencies]
parameterized-macro = { path = "parameterized-macro", version = "1" }
[features]
# not semver protected
square-brackets-old-error-message = ["parameterized-macro/square-brackets-old-error-message"]

[workspace]
members = ["parameterized-macro"]

[features]
# not semver protected
square-brackets-old-error-message = ["parameterized-macro/square-brackets-old-error-message"]
[dependencies]
parameterized-macro = { path = "parameterized-macro", version = "1" }

[dev-dependencies]
tokio = { version = "1", features = ["full"] }
Loading
Loading