test(mesh): cover Gmsh stub errors without the Gmsh extension

Add a focused test file asserting read_gmsh_msh raises ErrorException and
mesh_from_current_gmsh_model stays undefined until JuliaFEMGmshExt loads.

- Add test_gmsh_stub.jl with two throws checks for the weakdep path
- Include the new file from test/mesh/runtests.jl next to existing mesh tests
This commit is contained in:
Jukka Aho
2026-05-11 03:02:14 +03:00
parent c0701b0524
commit 30a975ec9d
2 changed files with 11 additions and 0 deletions
+1
View File
@@ -7,3 +7,4 @@ using Tensors
include("test_refine.jl")
include("test_mesh_api.jl")
include("test_gmsh_stub.jl")
+10
View File
@@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: 2015-2026 Jukka Aho
# SPDX-License-Identifier: MIT
using Test
using JuliaFEM
@testset "Gmsh bridge stubs (extension not loaded)" begin
@test_throws ErrorException JuliaFEM.read_gmsh_msh("nonexistent.msh")
@test_throws MethodError JuliaFEM.mesh_from_current_gmsh_model()
end