Commit graph

99 commits

Author SHA1 Message Date
Victor Martinez Montané
af490931f2 chore: release-plz update (#6)
This is an automated PR generated by [release-plz](https://github.com/MarcoIeni/release-plz) via Woodpecker CI.

Co-authored-by: release-plz-bot <bot@codeberg.org>
Reviewed-on: https://codeberg.org/JasterV/test-context/pulls/6
2026-04-24 14:32:50 +02:00
JasterV
a76038297a chore: update deps 2026-04-23 01:34:39 +02:00
Victor Martinez Montané
a44b045c8f chore: release-plz update (#5)
This is an automated PR generated by [release-plz](https://github.com/MarcoIeni/release-plz) via Woodpecker CI.

Co-authored-by: release-plz-bot <bot@codeberg.org>
Co-authored-by: JasterV <49537445+JasterV@users.noreply.github.com>
Reviewed-on: https://codeberg.org/JasterV/test-context/pulls/5
2026-04-22 17:30:49 +02:00
Victor Martinez Montané
dc77d78608 fix/pattern-matching-breaks-compilation (#4)
This PR solves the issue identified at https://codeberg.org/JasterV/test-context/issues/2.

Previously, when defining the function argument that implements the `TestContext` trait, only "Ident" patterns were accepted (That is, only names).

So, the following was valid:

```rust
#[test]
fn my_test(context: MyContext) {}
```

But the following would throw an error:

```rust
#[test]
fn my_test(MyContext { n }: MyContext {}
```

With this PR, we are now able to accept any kind of "pattern" such as struct pattern matching, enum pattern matching... etc.

We only really care about the "type", and not the "pattern", so this PR makes sure that the "pattern" part of the binding is left untouched.

Tests have been added to ensure that destructuring a struct compiles

Co-authored-by: JasterV <49537445+JasterV@users.noreply.github.com>
Reviewed-on: https://codeberg.org/JasterV/test-context/pulls/4
2026-04-22 17:26:08 +02:00
JasterV
bfe19a44c6 release: 0.5.6 2026-04-22 17:07:29 +02:00
JasterV
79d62a78ca Trigger CI 2026-04-22 16:57:31 +02:00
Victor Martinez Montané
4b027e01af chore: release-plz update (#1)
This is an automated PR generated by [release-plz](https://github.com/MarcoIeni/release-plz) via Woodpecker CI.

Co-authored-by: release-plz-bot <bot@codeberg.org>
Reviewed-on: https://codeberg.org/JasterV/test-context/pulls/1
2026-03-07 01:55:41 +01:00
JasterV
e7c70bee39 Update README.md 2026-03-07 01:22:27 +01:00
JasterV
b48df33def chore: update Cargo.toml 2026-03-07 01:15:08 +01:00
JasterV
3dc7b689a8 feat: migrate github actions to woodpecker 2026-03-07 01:13:53 +01:00
dependabot[bot]
aed02daabb
chore(deps): bump rust-toolchain from 1.91 to 1.93 (#69)
* chore(deps): bump rust-toolchain from 1.91 to 1.93

Bumps [rust-toolchain](https://github.com/rust-lang/rust) from 1.91 to 1.93.
- [Release notes](https://github.com/rust-lang/rust/releases)
- [Changelog](https://github.com/rust-lang/rust/blob/main/RELEASES.md)
- [Commits](https://github.com/rust-lang/rust/compare/1.91.0...1.93.0)

---
updated-dependencies:
- dependency-name: rust-toolchain
  dependency-version: '1.93'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* allow unused assignments

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: JasterV <49537445+JasterV@users.noreply.github.com>
2026-03-01 19:57:13 +01:00
dependabot[bot]
7a55dfe239
chore(deps): bump actions/checkout from 5 to 6 (#67)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-24 17:52:43 +01:00
github-actions[bot]
213a8533e2
chore: release v0.5.4 (#66)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-11-10 11:15:00 +01:00
JasterV
09366c58d5 chore: rollback to 0.5.3 2025-11-10 11:13:37 +01:00
github-actions[bot]
45c72c9b71 chore: release v0.5.4 (#65)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-11-10 11:11:36 +01:00
Víctor Martínez
63cb4631a3
chore: internal refactor & update docs (#64) 2025-11-10 11:04:42 +01:00
JasterV
b37885d27c refactor: make arg parsing code more readable 2025-11-06 16:15:31 +01:00
github-actions[bot]
aef2e05dcb
chore: release v0.5.3 (#61)
* chore: release v0.5.3

* Update CHANGELOG.md

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Víctor Martínez <49537445+JasterV@users.noreply.github.com>
2025-11-06 14:22:24 +01:00
Víctor Martínez
bfe1703448
fix: mut ownership doesn't work (#60) 2025-11-06 14:18:27 +01:00
github-actions[bot]
1025d20b40
chore: release v0.5.2 (#59)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-11-06 13:59:24 +01:00
Víctor Martínez
39756352a8
feat: make it so immutable references & full ownership can be taken depending on context (#58)
This pull requests introduces changes that make the use of the `test_context` macro more flexible.

Now, if the teardown is not skipped (default behavior), either an `immutable` or a `mutable` reference can be used for the context.

If the teardown is skipped with the `skip_teardown` option, an `immutable`, a `mutable` reference or full ownership can be taken.

So now the following is possible:

```rust
#[test_context(TeardownPanicContext, skip_teardown)]
#[tokio::test]
async fn test_async_skip_teardown(_ctx: &mut TeardownPanicContext) {}

#[test_context(TeardownPanicContext, skip_teardown)]
#[tokio::test]
async fn test_async_skip_teardown_with_immutable_ref(_ctx: &TeardownPanicContext) {}

#[test_context(TeardownPanicContext, skip_teardown)]
#[tokio::test]
async fn test_async_skip_teardown_with_full_ownership(_ctx: TeardownPanicContext) {}

#[test_context(TeardownPanicContext, skip_teardown)]
#[test]
fn test_sync_skip_teardown(_ctx: &mut TeardownPanicContext) {}

#[test_context(TeardownPanicContext, skip_teardown)]
#[test]
fn test_sync_skip_teardown_with_immutable_ref(_ctx: &TeardownPanicContext) {}

#[test_context(TeardownPanicContext, skip_teardown)]
#[test]
fn test_sync_skip_teardown_with_full_ownership(_ctx: TeardownPanicContext) {}
```
2025-11-06 13:52:20 +01:00
JasterV
5e407cdfa2 chore: update CHANGELOGS 2025-11-04 17:38:55 +01:00
github-actions[bot]
e192646827
chore: release v0.5.1 (#56)
* chore: release v0.5.1

* chore: update CHANGELOG

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: JasterV <49537445+JasterV@users.noreply.github.com>
2025-11-04 17:31:13 +01:00
Víctor Martínez
ef4bdb28a9
fix: Regression in version 0.5.0 (#55)
An attempt to fix the issue defined in https://github.com/JasterV/test-context/issues/53 & some refactors
2025-11-04 17:27:53 +01:00
dependabot[bot]
90f0f92b66
chore(deps): bump actions/checkout from 2 to 5 (#52)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Víctor Martínez <49537445+JasterV@users.noreply.github.com>
2025-10-29 11:08:13 +01:00
JasterV
3aaaa2541d Update release-plz config & CHANGELOG 2025-10-29 11:07:19 +01:00
JasterV
1d50da304a chore: add a CHANGELOG 2025-10-29 10:46:36 +01:00
JasterV
0c17e65982 chore: add a rust-toolchain.toml 2025-10-29 10:43:11 +01:00
JasterV
29b67b0a6a chore: update dependabot & add release-plz workflow 2025-10-29 10:34:24 +01:00
JasterV
4dfe4c8919 fix: manual drop on tests 2025-10-29 10:23:08 +01:00
Vyacheslav
9227f3e693
Added the ability to work with rstest (#51)
* [FIX-CONFLICT-WITH-RSTEST-V2]: semi-stable version, fix test_context function, remove unnecessary field, remove wrapper function, add  ability to work with rstest and same

* [FIX-CONFLICT-WITH-RSTEST-V2]: stable version, fix bugs with AssertUnwindSafe in sync_wrapper_body, remove redundant code, fix two tests, add notes for this tests

* [FIX-CONFLICT-WITH-RSTEST-V2]: stable version, fix context name extraction function, fix readme, fix docs, increase version of crate

---------

Co-authored-by: Vyacheslav Volkov <v.volkov@st-falcon.ru>
2025-10-29 10:19:40 +01:00
Andreas Vilinski
5ce361bc24
docs: explain why #[test_context] must come before #[tokio::test]; clarify attribute expansion order (#49)
Co-authored-by: Andreas Vilinski <andreas.vilinski@ifm.com>
2025-09-23 17:10:59 +02:00
Víctor Martínez
64a4e1ba7f
Update README.md (#47) 2025-01-27 13:58:33 +01:00
Víctor Martínez
5c8a0a1d51
chore: upgrade to 0.4.0 (#46) 2025-01-27 13:51:33 +01:00
Víctor Martínez
9bfe21fa4c
refactor: Support generic types in test_context macro (#45)
* refactor: Support generic types in test_context macro
2025-01-27 12:49:28 +01:00
Changju Lee
a58e13ecf5
feat: Support generic types in test_context macro (#44)
- Allow using test_context with generic contexts like MyContext<T>
2025-01-27 11:53:39 +01:00
Víctor Martínez
7cab7279b4
chore: upgrade to 0.3.0 (#41) 2024-02-27 23:29:48 +01:00
Víctor Martínez
dc2992cbff
feat: add support for the skip_teardown keyword (#40)
* feat: add support for the skip_teardown keyword
2024-02-27 23:26:40 +01:00
Víctor Martínez
8fd7841baa
Merge pull request #39 from JasterV/refactor/test-context-macro
refactor: clean up the macro implementation
2024-02-26 16:05:17 +01:00
Victor Martinez
0fed446341 refactor: clean up the macro implementation 2024-02-26 16:03:47 +01:00
Víctor Martínez
890a3232e9
Merge pull request #38 from JasterV/chore/upgrade-to-0.2.0-version
chore: upgrade to 0.2.0 version
2024-02-26 12:14:32 +01:00
Victor Martinez
be1f0e1dbd chore: upgrade to 0.2.0 version 2024-02-26 12:12:38 +01:00
Víctor Martínez
eb9367e04a
Merge pull request #37 from JasterV/refactor/remove-async-trait-support
refactor: remove support for async-trait crate
2024-02-26 12:09:47 +01:00
Victor Martinez
cb4043fae6 refactor: remove support for async-trait crate 2024-02-26 12:05:07 +01:00
Víctor Martínez
d932f8529f
Merge pull request #36 from JasterV/chore/update-to-0-1-6
chore: update to 0.1.6
2024-02-26 10:13:30 +01:00
Victor Martinez
2afbd36dae chore: update to 0.1.6 2024-02-26 10:13:00 +01:00
Víctor Martínez
9dba8ad7c0
Merge pull request #35 from JasterV/chore/update-patch-version
chore: update patch version
2024-02-26 10:03:16 +01:00
Victor Martinez
cb6ddf7356 chore: update patch version 2024-02-26 09:59:45 +01:00
Víctor Martínez
eb28f20c39
Merge pull request #34 from JasterV/refactor/cargo-workspace
[Refactor] Cargo workspace
2024-02-26 00:30:42 +01:00
Victor Martinez
58faeefa63 chore: update workspace properties 2024-02-26 00:27:59 +01:00