Skip to content

Test examples#73

Merged
jonathanpallant merged 2 commits into
mainfrom
test-examples
May 5, 2026
Merged

Test examples#73
jonathanpallant merged 2 commits into
mainfrom
test-examples

Conversation

@knoellle

@knoellle knoellle commented May 4, 2026

Copy link
Copy Markdown
Member

Examples were linted in CI before, but not executed.
Since our examples don't have side-effects or spawn GUIs, etc. we can safely run them too in CI to ensure all the asserts in them hold true.

Should avoid repeats of #72

I chose to add a test case to each example which calls the main function, then tell cargo test to also run tests in example code. (--all-targets is very confusing naming. It refers to test targets, not compiler targets).
An alternative implementation would be to explicitly cargo run --example <name> each example in the CI job. There is no cargo run --examples.

No changelog entry since this should™ have no effect on the end user.

@knoellle knoellle requested a review from jonathanpallant May 4, 2026 18:26
@jonathanpallant jonathanpallant merged commit eff1b5a into main May 5, 2026
15 checks passed
@jonathanpallant jonathanpallant deleted the test-examples branch May 5, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants