Skip to content

Commit

Permalink
tests: Add --no-test option
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsamaroo committed Dec 16, 2024
1 parent cb75a4f commit d52b541
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ if PROGRAM_FILE != "" && realpath(PROGRAM_FILE) == @__FILE__
nargs = '*'
default = all_test_names
help = "Enables the specified test to run in the testsuite"
"--no-test"
nargs = '*'
default = String[]
help = "Disables the specified test from running in the testsuite"
"-s", "--simulate"
action = :store_true
help = "Don't actually run the tests"
Expand Down Expand Up @@ -87,6 +91,25 @@ if PROGRAM_FILE != "" && realpath(PROGRAM_FILE) == @__FILE__
exit(1)
end
end
for test in parsed_args["no-test"]
if isdir(joinpath(@__DIR__, test))
for (_, other_test) in tests
if startswith(other_test, test)
filter!(x -> x != other_test, to_test)
continue
end
end
elseif test in all_test_names
filter!(x -> x != test, to_test)
else
println(stderr, "Unknown test: $test")
println(stderr, "Available tests:")
for ((test_title, _), test_name) in zip(tests, all_test_names)
println(stderr, " $test_name: $test_title")
end
exit(1)
end
end

@info "Running tests: $(join(to_test, ", "))"
parsed_args["simulate"] && exit(0)
Expand Down

0 comments on commit d52b541

Please sign in to comment.