Skip to content

Commit

Permalink
Throw if test_end_expr not a :block expr (#191)
Browse files Browse the repository at this point in the history
* Throw if `test_end_expr` not a `:block` expression

* Bump version
  • Loading branch information
nickrobinson251 authored Oct 3, 2024
1 parent fc7845b commit f9e5e54
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ReTestItems"
uuid = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
version = "1.28.0"
version = "1.29.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
1 change: 1 addition & 0 deletions src/ReTestItems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ function runtests(
(0 memory_threshold 1) || throw(ArgumentError("`memory_threshold` must be between 0 and 1, got $(repr(memory_threshold))"))
testitem_timeout > 0 || throw(ArgumentError("`testitem_timeout` must be a positive number, got $(repr(testitem_timeout))"))
timeout_profile_wait >= 0 || throw(ArgumentError("`timeout_profile_wait` must be a non-negative number, got $(repr(timeout_profile_wait))"))
test_end_expr.head === :block || throw(ArgumentError("`test_end_expr` must be a `:block` expression, got a `$(repr(test_end_expr.head))` expression"))
# If we were given paths but none were valid, then nothing to run.
!isempty(paths) && isempty(paths′) && return nothing
ti_filter = TestItemFilter(shouldrun, tags, name)
Expand Down
4 changes: 4 additions & 0 deletions test/integrationtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1503,4 +1503,8 @@ else
end # VERSION
end

@testset "`test_end_expr` must be `:block`" begin
@test_throws "`test_end_expr` must be a `:block` expression" runtests(; test_end_expr=:(@assert false))
end

end # integrationtests.jl testset

2 comments on commit f9e5e54

@nickrobinson251
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/116521

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.29.0 -m "<description of version>" f9e5e54b5b064a15980c35cee5a6954c7a6c0fcf
git push origin v1.29.0

Please sign in to comment.