Mercurial > repos > public > sbplib_julia
diff test/runtests.jl @ 711:df88aee35bb9 feature/selectable_tests
Switch to _test.jl suffix
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sat, 20 Feb 2021 20:45:40 +0100 |
parents | 48a61e085e60 |
children | be648c6d6686 |
line wrap: on
line diff
--- a/test/runtests.jl Sat Feb 20 20:36:27 2021 +0100 +++ b/test/runtests.jl Sat Feb 20 20:45:40 2021 +0100 @@ -6,7 +6,7 @@ run_testfiles(path) run_testfiles(path, glob) -Find and run all files with filenames starting with "test". If `path` is omitted the test folder is assumed. +Find and run all files with filenames ending with "_test.jl". If `path` is omitted the test folder is assumed. The argument `glob` can optionally be supplied to filter which test files are run. """ function run_testfiles(args) @@ -19,7 +19,6 @@ run_testfiles(".", glob) end -# TODO change from prefix `test` to suffix `_test` for testfiles function run_testfiles(path, glob) for name ∈ readdir(path) filepath = joinpath(path, name) @@ -30,11 +29,7 @@ end end - if !endswith(name, ".jl") ## TODO combine this into test below when switching to suffix - continue - end - - if startswith(name, "test") && occursin(glob, filepath) + if endswith(name, "_test.jl") && occursin(glob, filepath) printstyled("Running "; bold=true, color=:green) println(filepath) include(filepath)