Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use InlineTest? #5

Closed
cmcaine opened this issue Dec 1, 2020 · 2 comments
Closed

How to use InlineTest? #5

cmcaine opened this issue Dec 1, 2020 · 2 comments

Comments

@cmcaine
Copy link

cmcaine commented Dec 1, 2020

When using @testset "inline", i.e. within the source-code of a package, one can use the InlineTest package instead of ReTest, which only defines the strict minimum and also exports @testset, and therefore loads faster (even if ReTest itself loads fast, it can be desirable to have an even lighter dependency). But ReTest still has to be loaded (as a "test" dependency) in order to call retest.

How do I do this?

I've tried

using InlineTest

@testset "foo" begin
    @test 1 == 2
end

using ReTest

runtests()

and

module inner

using InlineTest

@testset "foo" begin
    @test 1 == 2
end

end

using ReTest

runtests()

And in both cases no tests are executed.

Replacing InlineTest with ReTest in either example works as expected.

@rfourquet
Copy link
Collaborator

Yeah, you are a victim of the immaturity of the package :)
I actually struggled trying to have tests passing on CI, without success, before registering InlineTest, and gave up temporarily, having the two packages in the same repo didn't make things easier on this front.

Anyway, assuming you used registered versions, the problem is that there is no registered version of ReTest which uses InlineTest yet. A solution is to checkout master for both, which is usable I think, or to use the ReTest version corresponding to v0.1.0 of InlineTest, via add ReTest#InlineTest-v0.1.0 in Pkg mode.

Thanks for trying this out!

@rfourquet
Copy link
Collaborator

A new version of ReTest (0.2.0) is now released which uses InlineTest. The examples of the OP are working by replacing runtests() with retest(), which is the new API, cf. the docs at https://juliatesting.github.io/ReTest.jl/dev/.

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

No branches or pull requests

2 participants