diff --git a/Project.toml b/Project.toml index 71df53a..cfd430c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ReTestItems" uuid = "817f1d60-ba6b-4fd5-9520-3cf149f6a823" -version = "1.31.0" +version = "1.32.0" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/src/ReTestItems.jl b/src/ReTestItems.jl index 75d6672..2de30e9 100644 --- a/src/ReTestItems.jl +++ b/src/ReTestItems.jl @@ -379,13 +379,17 @@ function _runtests_in_current_env( inc_time = time() @debugv 1 "Including tests in $paths" testitems, _ = include_testfiles!(proj_name, projectfile, paths, ti_filter, cfg.verbose_results, cfg.report) + @debugv 1 "Done including tests in $paths" nworkers = cfg.nworkers nworker_threads = cfg.nworker_threads ntestitems = length(testitems.testitems) - @debugv 1 "Done including tests in $paths" - @info "Finished scanning for test items in $(round(time() - inc_time, digits=2)) seconds." * - " Scheduling $ntestitems tests on pid $(Libc.getpid())" * - (nworkers == 0 ? "" : " with $nworkers worker processes and $nworker_threads threads per worker.") + @info "Finished scanning for test items in $(round(time() - inc_time, digits=2)) seconds." + if ntestitems == 0 + @warn "No test items found." + else + @info "Scheduling $ntestitems tests on pid $(Libc.getpid())" * + (nworkers == 0 ? "" : " with $nworkers worker processes and $nworker_threads threads per worker.") + end try if nworkers == 0 length(cfg.worker_init_expr.args) > 0 && error("worker_init_expr is set, but will not run because number of workers is 0.") diff --git a/test/integrationtests.jl b/test/integrationtests.jl index dc53e97..e897a8c 100644 --- a/test/integrationtests.jl +++ b/test/integrationtests.jl @@ -1547,4 +1547,20 @@ end @test_throws "`test_end_expr` must be a `:block` expression" runtests(; test_end_expr=:(@assert false)) end +@testset "warn if no test items" begin + msg = "No test items found." + @test_logs (:warn, msg) match_mode=:any begin + runtests(joinpath(TEST_FILES_DIR, "_empty_file_test.jl")) + end + @test_logs (:warn, msg) match_mode=:any begin + runtests(joinpath(TEST_FILES_DIR, "_empty_file_test.jl"); nworkers=1) + end + @test_logs (:warn, msg) match_mode=:any begin + runtests(joinpath(TEST_FILES_DIR, "_happy_tests.jl"); name="blahahahaha_nope") + end + @test_logs (:warn, msg) match_mode=:any begin + runtests(joinpath(TEST_FILES_DIR, "_happy_tests.jl"); tags=[:blahahahaha_nope]) + end +end + end # integrationtests.jl testset