Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "CTBase"
uuid = "54762871-cc72-4466-b8e8-f6c8b58076cd"
version = "0.17.2"
version = "0.17.3"
authors = ["Olivier Cots <olivier.cots@irit.fr>", "Jean-Baptiste Caillau <caillau@univ-cotedazur.fr>"]

[deps]
Expand Down
11 changes: 10 additions & 1 deletion ext/TestRunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,12 @@ function _select_tests(
# Also match strictly against filename without extension?
candidate_filename_no_ext = replace(candidate_filename, ".jl" => "")

candidate_basename = basename(candidate_filename)
candidate_basename_no_ext = replace(candidate_basename, ".jl" => "")
candidate_basename_no_test_prefix =
startswith(candidate_basename_no_ext, "test_") ? candidate_basename_no_ext[6:end] :
candidate_basename_no_ext

matched = false
for sel in selections
regex = _glob_to_regex(sel)
Expand All @@ -334,7 +340,10 @@ function _select_tests(
# 3. Filename without extension (e.g. test_utils)
if !isnothing(match(regex, candidate_str)) ||
!isnothing(match(regex, candidate_filename)) ||
!isnothing(match(regex, candidate_filename_no_ext))
!isnothing(match(regex, candidate_filename_no_ext)) ||
!isnothing(match(regex, candidate_basename)) ||
!isnothing(match(regex, candidate_basename_no_ext)) ||
!isnothing(match(regex, candidate_basename_no_test_prefix))
matched = true
break
end
Expand Down
10 changes: 10 additions & 0 deletions test/suite_ext/test_testrunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,16 @@ function test_testrunner()
)
@test sel == ["suite/test_a.jl"]
end

@testset verbose = VERBOSE showtiming = SHOWTIMING "available_tests glob string: selection may match basename without test_ prefix" begin
mkpath(joinpath(temp_dir, "suite_src"))
touch(joinpath(temp_dir, "suite_src", "test_utils.jl"))

available = TestRunner.TestSpec["suite_src/*"]

sel = select_tests(["utils"], available, false, identity; test_dir=temp_dir)
@test sel == ["suite_src/test_utils.jl"]
end
end
end

Expand Down
Loading