From: Daniel Arndt Date: Thu, 28 Dec 2017 14:20:58 +0000 (+0100) Subject: Add GMSH quicktest X-Git-Tag: v9.0.0-rc1~614^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5679%2Fhead;p=dealii.git Add GMSH quicktest --- diff --git a/tests/gmsh/create_tria_01.cc b/tests/gmsh/create_tria_01.cc index fb790848c7..a48d393fe4 100644 --- a/tests/gmsh/create_tria_01.cc +++ b/tests/gmsh/create_tria_01.cc @@ -62,6 +62,8 @@ int main () Assert(ierr==0, ExcInternalError()); gmsh_grid<2>("file.msh"); cat_file("file.msh"); + std::remove("file.log"); + std::remove("file_warn.log"); return 0; } diff --git a/tests/quick_tests/CMakeLists.txt b/tests/quick_tests/CMakeLists.txt index 0e81ba8e8d..5b01681858 100644 --- a/tests/quick_tests/CMakeLists.txt +++ b/tests/quick_tests/CMakeLists.txt @@ -183,6 +183,11 @@ IF (DEAL_II_WITH_ZLIB) make_quicktest("boost_zlib" ${_mybuild} "") ENDIF() +# Test GMSH +IF (DEAL_II_WITH_GMSH) + make_quicktest("gmsh" ${_mybuild} "") +ENDIF() + # A custom test target: ADD_CUSTOM_TARGET(test COMMAND ${CMAKE_COMMAND} -D ALL_TESTS="${ALL_TESTS}" -P ${CMAKE_CURRENT_SOURCE_DIR}/run.cmake diff --git a/tests/quick_tests/gmsh.cc b/tests/quick_tests/gmsh.cc new file mode 100644 index 0000000000..85c9d684d1 --- /dev/null +++ b/tests/quick_tests/gmsh.cc @@ -0,0 +1,47 @@ +//----------------------------------------------------------- +// +// Copyright (C) 2014 - 2017 by the deal.II authors +// +// This file is subject to LGPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//----------------------------------------------------------- + +// Test that the GMSH executable actually works. +// This is a reduced version of gmsh/create_tria_01. + +#include +#include + +#include + +int main () +{ + std::ofstream geo("file.geo"); + + geo << "Lx = 25.0;" << std::endl + << "Ly = 1.0;" << std::endl + << "Point(1) = {0, 0, 0, Lx};" << std::endl + << "Point(2) = {Lx, 0, 0, Lx};" << std::endl + << "Point(3) = {Lx, Ly, 0, Lx};" << std::endl + << "Point(4) = {0, Ly, 0, Lx};" << std::endl + << "Line(1) = {1, 2};" << std::endl + << "Line(2) = {2, 3};" << std::endl + << "Line(3) = {3, 4};" << std::endl + << "Line(4) = {4, 1};" << std::endl + << "Line Loop(5) = {3, 4, 1, 2};" << std::endl + << "Plane Surface(0) = {5};" << std::endl + << "Transfinite Surface{0} = {5};" << std::endl + << "Recombine Surface {0};" << std::endl; + geo.close(); + + const int ierr = std::system(DEAL_II_GMSH_EXECUTABLE_PATH " -2 file.geo 1>file.log 2>file_warn.log"); + Assert(ierr==0, dealii::ExcInternalError()); + + std::remove ("file.geo"); + std::remove ("file.log"); + std::remove ("file_warn.log"); + return 0; +}