diff --git a/templates/test/test/runtests.jl b/templates/test/test/runtests.jl index ea5fe07..1140eea 100644 --- a/templates/test/test/runtests.jl +++ b/templates/test/test/runtests.jl @@ -13,16 +13,6 @@ const GROUP = uppercase( end, ) -# define paths -testdir = @__DIR__ -testsetupdir = joinpath(testdir, "setup/") -exampledir = joinpath(@__DIR__, "..", "examples/") -examplesetupdir = joinpath(exampledir, "setup/") - -# Load setup code into path, so `using SetupModule` works -isdir(testsetupdir) && push!(LOAD_PATH, testsetupdir) -isdir(examplesetupdir) && push!(LOAD_PATH, examplesetupdir) - function istestfile(filename) return isfile(filename) && endswith(filename, ".jl") && @@ -31,9 +21,9 @@ end @time begin # tests in groups based on folder structure - for testgroup in filter(isdir, readdir(testdir)) + for testgroup in filter(isdir, readdir(@__DIR__)) if GROUP == "ALL" || GROUP == uppercase(testgroup) - for file in filter(istestfile, readdir(joinpath(testdir, testgroup); join=true)) + for file in filter(istestfile, readdir(joinpath(@__DIR__, testgroup); join=true)) @eval @safetestset $file begin include($file) end @@ -42,7 +32,7 @@ end end # single files in top folder - for file in filter(istestfile, readdir(testdir)) + for file in filter(istestfile, readdir(@__DIR__)) (file == basename(@__FILE__)) && continue @eval @safetestset $file begin include($file) @@ -50,7 +40,8 @@ end end # test examples - for file in filter(endswith(".jl"), readdir(exampledir; join=true)) + examplepath = joinpath(@__DIR__, "..", "examples") + for file in filter(endswith(".jl"), readdir(examplepath; join=true)) filename = basename(file) @eval begin @safetestset $filename begin diff --git a/test/runtests.jl b/test/runtests.jl index ea5fe07..1140eea 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -13,16 +13,6 @@ const GROUP = uppercase( end, ) -# define paths -testdir = @__DIR__ -testsetupdir = joinpath(testdir, "setup/") -exampledir = joinpath(@__DIR__, "..", "examples/") -examplesetupdir = joinpath(exampledir, "setup/") - -# Load setup code into path, so `using SetupModule` works -isdir(testsetupdir) && push!(LOAD_PATH, testsetupdir) -isdir(examplesetupdir) && push!(LOAD_PATH, examplesetupdir) - function istestfile(filename) return isfile(filename) && endswith(filename, ".jl") && @@ -31,9 +21,9 @@ end @time begin # tests in groups based on folder structure - for testgroup in filter(isdir, readdir(testdir)) + for testgroup in filter(isdir, readdir(@__DIR__)) if GROUP == "ALL" || GROUP == uppercase(testgroup) - for file in filter(istestfile, readdir(joinpath(testdir, testgroup); join=true)) + for file in filter(istestfile, readdir(joinpath(@__DIR__, testgroup); join=true)) @eval @safetestset $file begin include($file) end @@ -42,7 +32,7 @@ end end # single files in top folder - for file in filter(istestfile, readdir(testdir)) + for file in filter(istestfile, readdir(@__DIR__)) (file == basename(@__FILE__)) && continue @eval @safetestset $file begin include($file) @@ -50,7 +40,8 @@ end end # test examples - for file in filter(endswith(".jl"), readdir(exampledir; join=true)) + examplepath = joinpath(@__DIR__, "..", "examples") + for file in filter(endswith(".jl"), readdir(examplepath; join=true)) filename = basename(file) @eval begin @safetestset $filename begin diff --git a/test/setup/Setup.jl b/test/setup/Setup.jl deleted file mode 100644 index 8724864..0000000 --- a/test/setup/Setup.jl +++ /dev/null @@ -1,5 +0,0 @@ -module Setup - -const dummy_true = true - -end diff --git a/test/test_setupmodule.jl b/test/test_setupmodule.jl deleted file mode 100644 index 02dd1de..0000000 --- a/test/test_setupmodule.jl +++ /dev/null @@ -1,4 +0,0 @@ -using Setup, Test - -# simple stub test to see if setup code was loaded correctly -@test Setup.dummy_true