Releases: jbr/test-harness
v0.3.0
Three small improvements which might potentially represent breaking changes, but likely do not:
Inner and outer attributes
As identified by @tisonkun in #33, previous versions of this crate did not support tagging a test function with #[ignore]
. Other attributes were also ignored. As of test-harness 0.3.0, both inner and outer attributes are applied to the test function.
Function visibility
This version also propagates test function visibility
Special handling of #[should_panic]
In general, tests can return any impl std::process::Termination
, but #[should_panic]
tests MUST return the concrete unit type ()
. In order to enable the usage of #[should_panic]
now that attributes are propagated, test-harness checks for that attribute specifically and forces the return type to be ()
.
Changelog
Added
- [breaking] propagate attributes and visibility
Other
- (actions) enforce conventional commits
- (deps) bump actions/configure-pages from 4 to 5
- (actions) dependabot uses conventional commits
- Bump Swatinem/rust-cache from 2.7.2 to 2.7.3
- (actions) use release-plz
- (actions) remove protoc from docs and fix permissions
- Bump Swatinem/rust-cache from 2.7.1 to 2.7.2
v0.2.0
Two small improvements, one of which is potentially vaguely semver-breaking:
#[test(harness)]
If your test harness is named harness
as in fn harness(test: ...)
, instead of writing #[test(harness = harness)]
, you can just write #[test(harness)]
.
Passing through any impl Termination
Tests will now return any type that implements std::process::Termination, not just ()
. This is possibly semver-breaking if somehow there was code that was using type inference based on the return type being ()
, but other than that, returning ()
will continue to work.
v0.1.1
This update adds support for using this test macro as a drop-in replacement for the standard #[test] macro, with no harness argument. This allows test harness usage to be interleaved with tests that need no setup/teardown, without the need to fully namespace test_harness::test