|
1 | 1 | using GeophysicalModelGenerator |
2 | | -using Test |
| 2 | +using ParallelTestRunner |
3 | 3 |
|
4 | | -@testset verbose = true "GeophysicalModelGenerator" begin |
| 4 | +testsuite = find_tests(@__DIR__) |
5 | 5 |
|
6 | | - @testset "Data import.jl" begin |
7 | | - include("test_data_import.jl") |
8 | | - end |
9 | | - @testset "Data types.jl" begin |
10 | | - include("test_data_types.jl") |
11 | | - end |
12 | | - @testset "Paraview" begin |
13 | | - include("test_paraview.jl") |
14 | | - end |
15 | | - @testset "Paraview collection" begin |
16 | | - include("test_paraview_collection.jl") |
17 | | - end |
18 | | - @testset "Gravity model" begin |
19 | | - include("test_voxel_gravity.jl") |
20 | | - end |
21 | | - @testset "Nearest points" begin |
22 | | - include("test_nearest_points.jl") |
23 | | - end |
24 | | - @testset "Utils" begin |
25 | | - include("test_utils.jl") |
26 | | - end |
27 | | - @testset "Transformations" begin |
28 | | - include("test_transformation.jl") |
29 | | - end |
30 | | - @testset "Surfaces" begin |
31 | | - include("test_surfaces.jl") |
32 | | - end |
33 | | - |
34 | | - @testset "LaMEM" begin |
35 | | - include("test_lamem.jl") |
36 | | - end |
37 | | - |
38 | | - @testset "pTatin" begin |
39 | | - include("test_pTatin_IO.jl") |
40 | | - end |
41 | | - |
42 | | - @testset "SetupGeometry" begin |
43 | | - include("test_setup_geometry.jl") |
44 | | - end |
45 | | - |
46 | | - @testset "STL" begin |
47 | | - include("test_stl.jl") |
48 | | - end |
49 | | - |
50 | | - @testset "IO" begin |
51 | | - include("test_IO.jl") |
52 | | - end |
53 | | - |
54 | | - @testset "ProfileProcessing" begin |
55 | | - include("test_ProfileProcessing.jl") |
56 | | - end |
57 | | - |
58 | | - @testset "GMT integration" begin |
59 | | - include("test_GMT.jl") |
60 | | - end |
61 | | - |
62 | | - @testset "Gmsh integration" begin |
63 | | - include("test_Gmsh.jl") |
64 | | - end |
65 | | - |
66 | | - @testset "Event counts" begin |
67 | | - include("test_event_counts.jl") |
68 | | - end |
69 | | - @testset "Create movie" begin |
70 | | - include("test_create_movie.jl") |
71 | | - end |
72 | | - |
73 | | - @testset "Sea level" begin |
74 | | - include("test_sea_level.jl") |
75 | | - end |
76 | | - |
77 | | - @testset "Ridge Thermal Structure Tests" begin |
78 | | - include("test_ridge_segments.jl") |
79 | | - end |
80 | | - |
81 | | - @testset "Plate Tests" begin |
82 | | - include("test_plate.jl") |
83 | | - end |
84 | | - |
85 | | - @testset "Waterflow" begin |
86 | | - include("test_WaterFlow.jl") |
87 | | - end |
88 | | - |
89 | | - @testset "ASAGI_IO" begin |
90 | | - include("test_ASAGI_IO.jl") |
| 6 | +# Add `using GeophysicalModelGenerator` to each test |
| 7 | +for (name, expr) in testsuite |
| 8 | + if name != "test_tutorials" # Tutorials are standalone |
| 9 | + testsuite[name] = quote |
| 10 | + using GeophysicalModelGenerator |
| 11 | + $expr |
| 12 | + end |
91 | 13 | end |
| 14 | +end |
92 | 15 |
|
93 | | - @testset "Chmy" begin |
94 | | - include("test_Chmy.jl") |
| 16 | +try |
| 17 | + ParallelTestRunner.runtests(GeophysicalModelGenerator, ARGS; testsuite) |
| 18 | +finally |
| 19 | + # Cleanup |
| 20 | + foreach(f -> rm(joinpath(@__DIR__, f)), filter(endswith(".vts"), readdir(@__DIR__))) |
| 21 | + foreach(f -> rm(joinpath(@__DIR__, f)), filter(endswith(".vtu"), readdir(@__DIR__))) |
| 22 | + if isdir(joinpath(@__DIR__, "markers")) |
| 23 | + rm(joinpath(@__DIR__, "markers"), recursive = true) |
95 | 24 | end |
96 | 25 | end |
97 | | - |
98 | | -# Include tutorials |
99 | | -include("test_tutorials.jl") |
100 | | - |
101 | | -# Cleanup |
102 | | -foreach(rm, filter(endswith(".vts"), readdir())) |
103 | | -foreach(rm, filter(endswith(".vtu"), readdir())) |
104 | | -rm("./markers/", recursive = true) |
0 commit comments