Skip to content

Commit

Permalink
simply alias Test.DefaultTestSet to be robust agianst future changes
Browse files Browse the repository at this point in the history
Jutho committed Jan 5, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 345a7b8 commit 6758a80
Showing 5 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ jobs:
version:
- '1.5' # lowest version that supports constant propagation
- '1.6' # long-term stable release
- '1.8' # first version where we swhich to simply aliasing Test.@testset
- '1'
os:
- ubuntu-latest
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TestExtras"
uuid = "5ed8adda-3752-4e41-b88a-e8b09835ee3a"
authors = ["Jutho Haegeman <[email protected]> and contributors"]
version = "0.2"
version = "0.2.1"

[deps]
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
6 changes: 5 additions & 1 deletion src/TestExtras.jl
Original file line number Diff line number Diff line change
@@ -5,7 +5,11 @@ export @timedtestset
export ConstInferred

include("constinferred.jl")
include("timedtest.jl")
if VERSION >= v"1.8"
include("timedtest_new.jl")
else
include("timedtest.jl")
end

using .ConstInferred: @constinferred, @constinferred_broken
using .TimedTests: @timedtestset
2 changes: 1 addition & 1 deletion src/timedtest.jl
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ using Test: Test
using Test: AbstractTestSet, DefaultTestSet, Broken, Fail, Error, Pass, TestSetException
using Test: record, finish, print_test_errors, print_test_results, print_counts,
get_testset, get_testset_depth, get_test_counts, get_alignment, filter_errors,
TESTSET_PRINT_ENABLE
scrub_backtrace, TESTSET_PRINT_ENABLE

macro timedtestset(ex...)
timedtestsetvar = gensym()
9 changes: 9 additions & 0 deletions src/timedtest_new.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module TimedTests
export @timedtestset, TimedTestSet

using Test

const var"@timedtestset" = Test.var"@testset"
const TimedTestSet = Test.DefaultTestSet

end

2 comments on commit 6758a80

@Jutho
Copy link
Owner Author

@Jutho Jutho commented on 6758a80 Jan 5, 2024

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/98302

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 v0.2.1 -m "<description of version>" 6758a805f9cbc8b6cd86e37a5c3ede8eba18ad75
git push origin v0.2.1

Please sign in to comment.