TestItemRunner.jl icon indicating copy to clipboard operation
TestItemRunner.jl copied to clipboard

Bug: Module docstring breaks detection of tests

Open jakobnissen opened this issue 3 years ago • 1 comments

In the following MWE package:

module Foo

using TestItems

greet() = print("Hello World!")

@testitem "Test1" begin
    @test 1 + 1 == 2
end

end # module Foo

With the recommended test/runtests.jl:

using TestItemRunner

@run_package_tests

TestItemRunner runs well:

Test Summary: | Pass  Total  Time
Package       |    1      1  0.1s
     Testing Foo tests passed

However, adding a docstring at the top of the module:

"Foo"
module Foo
[ test of file elided ]

Makes this package detect zero tests:

Test Summary: |Time
Package       | None  0.0s
     Testing Foo tests passed

jakobnissen avatar Nov 16 '22 13:11 jakobnissen

Detection of @testitem is not tested. I recommend that

jakobnissen avatar Nov 21 '22 10:11 jakobnissen

Fixed in https://github.com/julia-vscode/TestItemDetection.jl/pull/21, tests in https://github.com/julia-vscode/JuliaWorkspaces.jl/pull/22.

davidanthoff avatar Jul 07 '24 12:07 davidanthoff