Commit 28057a71 authored by GILLES Sebastien's avatar GILLES Sebastien

#1398 Change teat utility used from Catch2 to Boost.Test.

The reason for the change was partly bug #1363: tests were failing for macOS / shared library / release mode solely due to an internal error of Catch2.

Now we need to have Boost Test installed (as usual ThirdPartyCompilationLibrary facility provides it).

I also used the modifications to refresh the way tests were written:

- Fixture are now handled in a much better way; in peculiar some tests no longer required a fake model and its equally fake Lua file to proceed.
- The model tests have been refined to provide more information in case of failure (the complete path of the files that might not be equal are now directly given).
- Mpi fixture is now working completely: you may define several test suites in an executable without having it fail (previously it was the case only for the full-fledged model fixture).

This commit is unusually big for me, but that is due to the fact with macro everywhere in both Boost.Test and Catch2 I had rather not used them at the same time.
parent 7e79da1e
......@@ -73,6 +73,10 @@ morefem_find_library(LIB_LUA "lua" ${LUA_LIB_DIR} "Lua")
morefem_find_library(LIB_BOOST_FILESYSTEM "boost_filesystem" ${BOOST_LIB_DIR} "Boost filesystem")
morefem_find_library(LIB_BOOST_SYSTEM "boost_system" ${BOOST_LIB_DIR} "Boost system")
morefem_find_library(LIB_BOOST_TEST "boost_unit_test_framework" ${BOOST_LIB_DIR} "Boost test")
morefem_find_library(LIB_BOOST_TEST_EXEC_MONITOR "boost_test_exec_monitor" ${BOOST_LIB_DIR} "Boost test exec monitor")
if(BLAS_CUSTOM_LINKER)
set(LIB_BLAS ${BLAS_LIB})
else()
......
This diff is collapsed.
......@@ -44,7 +44,7 @@
allowLocationSimulation = "YES">
<PathRunnable
runnableDebuggingMode = "0"
FilePath = "/Volumes/Data/opt/clang/Openmpi/bin/orterun">
FilePath = "/Volumes/Data/opt/clang_release/Openmpi/bin/orterun">
</PathRunnable>
<MacroExpansion>
<BuildableReference
......
......@@ -94,5 +94,7 @@ morefem_install(MoReFEM4ElasticityCheckResults)
add_test(ElasticityCheckResults
MoReFEM4ElasticityCheckResults
--test_output_dir ${MOREFEM_TEST_OUTPUT_DIR}
--root_dir ${MOREFEM_ROOT})
--
${MOREFEM_ROOT}
${MOREFEM_TEST_OUTPUT_DIR}
)
......@@ -8,83 +8,112 @@
*/
#define BOOST_TEST_MODULE model_elasticity
#include "ThirdParty/IncludeWithoutWarning/Boost/Test.hpp"
#include "Utilities/Filesystem/File.hpp"
#include "ModelInstances/Elasticity/InputData.hpp"
using namespace MoReFEM;
#include "Test/Tools/CatchMainTest.hpp"
#include "Test/Tools/CheckIdenticalFiles.hpp"
#include "Test/Tools/CompareEnsightFiles.hpp"
#include "Test/Tools/Fixture/Environment.hpp"
void CommonTestCase(std::string&& seq_or_par,
std::string&& dimension);
void CommonTestCase(std::string&& seq_or_par,
std::string&& dimension)
namespace // anonymous
{
decltype(auto) environment = Utilities::Environment::GetInstance(__FILE__, __LINE__);
std::string root_dir, output_dir;
REQUIRE_NOTHROW(root_dir = environment.GetEnvironmentVariable("MOREFEM_ROOT", __FILE__, __LINE__));
REQUIRE_NOTHROW(output_dir = environment.GetEnvironmentVariable("MOREFEM_TEST_OUTPUT_DIR", __FILE__, __LINE__));
REQUIRE(FilesystemNS::Folder::DoExist(root_dir));
REQUIRE(FilesystemNS::Folder::DoExist(output_dir));
std::string ref_dir = root_dir + "/Sources/ModelInstances/Elasticity/ExpectedResults/" + dimension;
std::string obtained_dir = output_dir + std::string("/") + seq_or_par + std::string("/Elasticity/") + dimension;
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "input_data.lua", __FILE__, __LINE__);
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "model_name.hhdata", __FILE__, __LINE__);
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "unknowns.hhdata", __FILE__, __LINE__);
void CommonTestCase(std::string&& seq_or_par,
std::string&& dimension);
ref_dir += "/Mesh_1/";
obtained_dir += "/Mesh_1/";
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "interfaces.hhdata", __FILE__, __LINE__);
} // namespace anonymous
ref_dir += "Ensight6/";
obtained_dir += "Ensight6/";
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "mesh.geo", __FILE__, __LINE__);
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "problem.case", __FILE__, __LINE__);
PRAGMA_DIAGNOSTIC(push)
PRAGMA_DIAGNOSTIC(ignored "-Wdisabled-macro-expansion")
std::ostringstream oconv;
for (auto i = 0; i <= 5; ++i)
{
oconv.str("");
oconv << "solid_displacement." << std::setw(5) << std::setfill('0') << i << ".scl";
TestNS::CompareEnsightFiles(ref_dir, obtained_dir, oconv.str(), __FILE__, __LINE__, 1.e-11);
}
}
TEST_CASE("Elasticity output is conform to what is expected - 3D case, sequential")
BOOST_FIXTURE_TEST_CASE(seq_3d, TestNS::FixtureNS::Environment)
{
CommonTestCase("Seq", "3D");
}
TEST_CASE("Elasticity output is conform to what is expected - 3D case, mpi 4 processors")
BOOST_FIXTURE_TEST_CASE(mpi4_3d, TestNS::FixtureNS::Environment)
{
CommonTestCase("Mpi4", "3D");
}
TEST_CASE("Elasticity output is conform to what is expected - 2D case, sequential")
BOOST_FIXTURE_TEST_CASE(seq_2d, TestNS::FixtureNS::Environment)
{
CommonTestCase("Seq", "2D");
}
TEST_CASE("Elasticity output is conform to what is expected - 2D case, mpi 4 processors")
BOOST_FIXTURE_TEST_CASE(mpi4_2d, TestNS::FixtureNS::Environment)
{
CommonTestCase("Mpi4", "2D");
}
PRAGMA_DIAGNOSTIC(pop)
namespace // anonymous
{
void CommonTestCase(std::string&& seq_or_par,
std::string&& dimension)
{
decltype(auto) environment = Utilities::Environment::GetInstance(__FILE__, __LINE__);
std::string root_dir, output_dir;
/* BOOST_REQUIRE_NO_THROW */(root_dir = environment.GetEnvironmentVariable("MOREFEM_ROOT", __FILE__, __LINE__));
/* BOOST_REQUIRE_NO_THROW */(output_dir = environment.GetEnvironmentVariable("MOREFEM_TEST_OUTPUT_DIR",
__FILE__, __LINE__));
BOOST_REQUIRE(FilesystemNS::Folder::DoExist(root_dir));
BOOST_REQUIRE(FilesystemNS::Folder::DoExist(output_dir));
std::string ref_dir = root_dir + "/Sources/ModelInstances/Elasticity/ExpectedResults/" + dimension;
std::string obtained_dir = output_dir + std::string("/") + seq_or_par + std::string("/Elasticity/") + dimension;
/* BOOST_REQUIRE_NO_THROW */(TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "input_data.lua",
__FILE__, __LINE__));
/* BOOST_REQUIRE_NO_THROW */(TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "model_name.hhdata",
__FILE__, __LINE__));
/* BOOST_REQUIRE_NO_THROW */(TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "unknowns.hhdata",
__FILE__, __LINE__));
ref_dir += "/Mesh_1/";
obtained_dir += "/Mesh_1/";
/* BOOST_REQUIRE_NO_THROW */(TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "interfaces.hhdata",
__FILE__, __LINE__));
ref_dir += "Ensight6/";
obtained_dir += "Ensight6/";
/* BOOST_REQUIRE_NO_THROW */(TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "mesh.geo", __FILE__, __LINE__));
/* BOOST_REQUIRE_NO_THROW */(TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "problem.case", __FILE__, __LINE__));
std::ostringstream oconv;
for (auto i = 0; i <= 5; ++i)
{
oconv.str("");
oconv << "solid_displacement." << std::setw(5) << std::setfill('0') << i << ".scl";
/* BOOST_REQUIRE_NO_THROW */(TestNS::CompareEnsightFiles(ref_dir, obtained_dir, oconv.str(),
__FILE__, __LINE__, 1.e-11));
}
}
} // namespace anonymous
......@@ -92,8 +92,11 @@ add_test(HeatModel1DEnsightOutput-mpi
add_test(HeatCheckResults
MoReFEM4HeatCheckResults
--test_output_dir ${MOREFEM_TEST_OUTPUT_DIR}
--root_dir ${MOREFEM_ROOT})
--
${MOREFEM_ROOT}
${MOREFEM_TEST_OUTPUT_DIR}
)
......@@ -8,35 +8,78 @@
*/
#define BOOST_TEST_MODULE model_heat
#include "ThirdParty/IncludeWithoutWarning/Boost/Test.hpp"
#include "Utilities/Filesystem/File.hpp"
#include "ModelInstances/Heat/InputData.hpp"
using namespace MoReFEM;
#include "Test/Tools/CatchMainTest.hpp"
#include "Test/Tools/CheckIdenticalFiles.hpp"
#include "Test/Tools/CompareEnsightFiles.hpp"
#include "Test/Tools/Fixture/Environment.hpp"
namespace
namespace // anonymous
{
void CommonTestCase(std::string&& seq_or_par,
std::string&& dimension);
} // namespace anonymous
PRAGMA_DIAGNOSTIC(push)
PRAGMA_DIAGNOSTIC(ignored "-Wdisabled-macro-expansion")
BOOST_FIXTURE_TEST_CASE(sequential_1d, TestNS::FixtureNS::Environment)
{
CommonTestCase("Seq", "1D");
}
BOOST_FIXTURE_TEST_CASE(mpi4_1d, TestNS::FixtureNS::Environment)
{
CommonTestCase("Mpi4", "1D");
}
BOOST_FIXTURE_TEST_CASE(sequential_2d, TestNS::FixtureNS::Environment)
{
CommonTestCase("Seq", "2D");
}
BOOST_FIXTURE_TEST_CASE(mpi4_2d, TestNS::FixtureNS::Environment)
{
CommonTestCase("Mpi4", "2D");
}
PRAGMA_DIAGNOSTIC(pop)
namespace // anonymous
{
void CommonTestCase(std::string&& seq_or_par,
std::string&& dimension)
{
decltype(auto) environment = Utilities::Environment::GetInstance(__FILE__, __LINE__);
std::string root_dir, output_dir;
REQUIRE_NOTHROW(root_dir = environment.GetEnvironmentVariable("MOREFEM_ROOT", __FILE__, __LINE__));
REQUIRE_NOTHROW(output_dir = environment.GetEnvironmentVariable("MOREFEM_TEST_OUTPUT_DIR", __FILE__, __LINE__));
/* BOOST_REQUIRE_NO_THROW */(root_dir = environment.GetEnvironmentVariable("MOREFEM_ROOT", __FILE__, __LINE__));
/* BOOST_REQUIRE_NO_THROW */(output_dir = environment.GetEnvironmentVariable("MOREFEM_TEST_OUTPUT_DIR", __FILE__, __LINE__));
REQUIRE(FilesystemNS::Folder::DoExist(root_dir));
REQUIRE(FilesystemNS::Folder::DoExist(output_dir));
BOOST_REQUIRE(FilesystemNS::Folder::DoExist(root_dir));
BOOST_REQUIRE(FilesystemNS::Folder::DoExist(output_dir));
std::string ref_dir = root_dir + "/Sources/ModelInstances/Heat/ExpectedResults/" + dimension;
std::string obtained_dir = output_dir + std::string("/") + seq_or_par + std::string("/Heat/") + dimension;
......@@ -66,28 +109,6 @@ namespace
}
}
}
TEST_CASE("Heat output is conform to what is expected - 1D case, sequential")
{
CommonTestCase("Seq", "1D");
}
TEST_CASE("Heat output is conform to what is expected - 1D case, mpi 4 processors")
{
CommonTestCase("Mpi4", "1D");
}
TEST_CASE("Heat output is conform to what is expected - 2D case, sequential")
{
CommonTestCase("Seq", "2D");
}
TEST_CASE("Heat output is conform to what is expected - 2D case, mpi 4 processors")
{
CommonTestCase("Mpi4", "2D");
}
} // namespace anonymous
......@@ -64,5 +64,8 @@ add_test(HyperelasticityModelEnsightOutput-mpi
add_test(HyperelasticityCheckResults
MoReFEM4HyperelasticityCheckResults
--test_output_dir ${MOREFEM_TEST_OUTPUT_DIR}
--root_dir ${MOREFEM_ROOT})
--
${MOREFEM_ROOT}
${MOREFEM_TEST_OUTPUT_DIR}
)
......@@ -7,6 +7,9 @@
//
*/
#define BOOST_TEST_MODULE model_hyperelasticity
#include "ThirdParty/IncludeWithoutWarning/Boost/Test.hpp"
#include "Utilities/Filesystem/File.hpp"
......@@ -14,65 +17,85 @@
using namespace MoReFEM;
#include "Test/Tools/CatchMainTest.hpp"
#include "Test/Tools/CheckIdenticalFiles.hpp"
#include "Test/Tools/CompareEnsightFiles.hpp"
#include "Test/Tools/Fixture/Environment.hpp"
void CommonTestCase(std::string&& seq_or_par);
namespace // anonymous
{
void CommonTestCase(std::string&& seq_or_par)
{
decltype(auto) environment = Utilities::Environment::GetInstance(__FILE__, __LINE__);
std::string root_dir, output_dir;
void CommonTestCase(std::string&& seq_or_par);
REQUIRE_NOTHROW(root_dir = environment.GetEnvironmentVariable("MOREFEM_ROOT", __FILE__, __LINE__));
REQUIRE_NOTHROW(output_dir = environment.GetEnvironmentVariable("MOREFEM_TEST_OUTPUT_DIR", __FILE__, __LINE__));
REQUIRE(FilesystemNS::Folder::DoExist(root_dir));
REQUIRE(FilesystemNS::Folder::DoExist(output_dir));
} // namespace anonymous
std::string ref_dir = root_dir + "/Sources/ModelInstances/Hyperelasticity/ExpectedResults/";
std::string obtained_dir = output_dir + std::string("/") + seq_or_par + std::string("/MidpointHyperelasticity/");
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "input_data.lua", __FILE__, __LINE__);
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "model_name.hhdata", __FILE__, __LINE__);
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "unknowns.hhdata", __FILE__, __LINE__);
PRAGMA_DIAGNOSTIC(push)
PRAGMA_DIAGNOSTIC(ignored "-Wdisabled-macro-expansion")
ref_dir += "/Mesh_1/";
obtained_dir += "/Mesh_1/";
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "interfaces.hhdata", __FILE__, __LINE__);
BOOST_FIXTURE_TEST_CASE(sequential, TestNS::FixtureNS::Environment)
{
CommonTestCase("Seq");
}
ref_dir += "Ensight6/";
obtained_dir += "Ensight6/";
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "mesh.geo", __FILE__, __LINE__);
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "problem.case", __FILE__, __LINE__);
BOOST_FIXTURE_TEST_CASE(mpi4, TestNS::FixtureNS::Environment)
{
CommonTestCase("Mpi4");
}
std::ostringstream oconv;
PRAGMA_DIAGNOSTIC(pop)
PRAGMA_DIAGNOSTIC(ignored "-Wdisabled-macro-expansion")
for (auto i = 0; i <= 20; ++i)
namespace // anonymous
{
void CommonTestCase(std::string&& seq_or_par)
{
oconv.str("");
oconv << "displacement." << std::setw(5) << std::setfill('0') << i << ".scl";
TestNS::CompareEnsightFiles(ref_dir, obtained_dir, oconv.str(), __FILE__, __LINE__);
}
decltype(auto) environment = Utilities::Environment::GetInstance(__FILE__, __LINE__);
std::string root_dir, output_dir;
}
/* BOOST_REQUIRE_NO_THROW */(root_dir = environment.GetEnvironmentVariable("MOREFEM_ROOT", __FILE__, __LINE__));
/* BOOST_REQUIRE_NO_THROW */(output_dir = environment.GetEnvironmentVariable("MOREFEM_TEST_OUTPUT_DIR", __FILE__, __LINE__));
BOOST_REQUIRE(FilesystemNS::Folder::DoExist(root_dir));
BOOST_REQUIRE(FilesystemNS::Folder::DoExist(output_dir));
TEST_CASE("Hyperelasticity output is conform to what is expected - 3D case, sequential")
{
CommonTestCase("Seq");
}
std::string ref_dir = root_dir + "/Sources/ModelInstances/Hyperelasticity/ExpectedResults/";
std::string obtained_dir = output_dir + std::string("/") + seq_or_par + std::string("/MidpointHyperelasticity/");
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "input_data.lua", __FILE__, __LINE__);
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "model_name.hhdata", __FILE__, __LINE__);
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "unknowns.hhdata", __FILE__, __LINE__);
TEST_CASE("Hyperelasticity output is conform to what is expected - 3D case, mpi 4 processors")
{
CommonTestCase("Mpi4");
}
ref_dir += "/Mesh_1/";
obtained_dir += "/Mesh_1/";
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "interfaces.hhdata", __FILE__, __LINE__);
ref_dir += "Ensight6/";
obtained_dir += "Ensight6/";
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "mesh.geo", __FILE__, __LINE__);
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "problem.case", __FILE__, __LINE__);
std::ostringstream oconv;
for (auto i = 0; i <= 20; ++i)
{
oconv.str("");
oconv << "displacement." << std::setw(5) << std::setfill('0') << i << ".scl";
TestNS::CompareEnsightFiles(ref_dir, obtained_dir, oconv.str(), __FILE__, __LINE__);
}
}
} // namespace anonymous
......@@ -65,5 +65,8 @@ morefem_install(MoReFEM4LaplacianCheckResults)
add_test(LaplacianCheckResults
MoReFEM4LaplacianCheckResults
--test_output_dir ${MOREFEM_TEST_OUTPUT_DIR}
--root_dir ${MOREFEM_ROOT})
--
${MOREFEM_ROOT}
${MOREFEM_TEST_OUTPUT_DIR}
)
......@@ -7,6 +7,9 @@
//
*/
#define BOOST_TEST_MODULE model_laplacian
#include "ThirdParty/IncludeWithoutWarning/Boost/Test.hpp"
#include "Utilities/Filesystem/File.hpp"
......@@ -14,56 +17,74 @@
using namespace MoReFEM;
#include "Test/Tools/CatchMainTest.hpp"
#include "Test/Tools/CheckIdenticalFiles.hpp"
#include "Test/Tools/CompareEnsightFiles.hpp"
#include "Test/Tools/Fixture/Environment.hpp"
void CommonTestCase(std::string&& seq_or_par);
void CommonTestCase(std::string&& seq_or_par)
namespace // anonymous
{
decltype(auto) environment = Utilities::Environment::GetInstance(__FILE__, __LINE__);
std::string root_dir, output_dir;
REQUIRE_NOTHROW(root_dir = environment.GetEnvironmentVariable("MOREFEM_ROOT", __FILE__, __LINE__));
REQUIRE_NOTHROW(output_dir = environment.GetEnvironmentVariable("MOREFEM_TEST_OUTPUT_DIR", __FILE__, __LINE__));
REQUIRE(FilesystemNS::Folder::DoExist(root_dir));
REQUIRE(FilesystemNS::Folder::DoExist(output_dir));
std::string ref_dir = root_dir + "/Sources/ModelInstances/Laplacian/ExpectedResults/";
std::string obtained_dir = output_dir + std::string("/") + seq_or_par + std::string("/Laplacian/");
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "input_data.lua", __FILE__, __LINE__);
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "model_name.hhdata", __FILE__, __LINE__);
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "unknowns.hhdata", __FILE__, __LINE__);
ref_dir += "/Mesh_1/";
obtained_dir += "/Mesh_1/";
void CommonTestCase(std::string&& seq_or_par);
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "interfaces.hhdata", __FILE__, __LINE__);
ref_dir += "Ensight6/";
obtained_dir += "Ensight6/";
} // namespace anonymous
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "mesh.geo", __FILE__, __LINE__);
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "problem.case", __FILE__, __LINE__);
TestNS::CompareEnsightFiles(ref_dir, obtained_dir, "pressure.00000.scl", __FILE__, __LINE__);
}
PRAGMA_DIAGNOSTIC(push)
PRAGMA_DIAGNOSTIC(ignored "-Wdisabled-macro-expansion")
TEST_CASE("Laplacian output is conform to what is expected, sequential")
BOOST_FIXTURE_TEST_CASE(sequential, TestNS::FixtureNS::Environment)
{
CommonTestCase("Seq");
}
TEST_CASE("Laplacian output is conform to what is expected, mpi 4 processors")
BOOST_FIXTURE_TEST_CASE(mpi4, TestNS::FixtureNS::Environment)
{
CommonTestCase("Mpi4");
}
PRAGMA_DIAGNOSTIC(pop)
namespace // anonymous
{
void CommonTestCase(std::string&& seq_or_par)
{
decltype(auto) environment = Utilities::Environment::GetInstance(__FILE__, __LINE__);
std::string root_dir, output_dir;
/* BOOST_REQUIRE_NO_THROW */(root_dir = environment.GetEnvironmentVariable("MOREFEM_ROOT", __FILE__, __LINE__));
/* BOOST_REQUIRE_NO_THROW */(output_dir = environment.GetEnvironmentVariable("MOREFEM_TEST_OUTPUT_DIR", __FILE__, __LINE__));
BOOST_REQUIRE(FilesystemNS::Folder::DoExist(root_dir));
BOOST_REQUIRE(FilesystemNS::Folder::DoExist(output_dir));
std::string ref_dir = root_dir + "/Sources/ModelInstances/Laplacian/ExpectedResults/";
std::string obtained_dir = output_dir + std::string("/") + seq_or_par + std::string("/Laplacian/");
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "input_data.lua", __FILE__, __LINE__);
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "model_name.hhdata", __FILE__, __LINE__);
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "unknowns.hhdata", __FILE__, __LINE__);
ref_dir += "/Mesh_1/";
obtained_dir += "/Mesh_1/";
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "interfaces.hhdata", __FILE__, __LINE__);
ref_dir += "Ensight6/";
obtained_dir += "Ensight6/";
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "mesh.geo", __FILE__, __LINE__);
TestNS::CheckIdenticalFiles(ref_dir, obtained_dir, "problem.case", __FILE__, __LINE__);
TestNS::CompareEnsightFiles(ref_dir, obtained_dir, "pressure.00000.scl", __FILE__, __LINE__);
}
} // namespace anonymous
......@@ -94,6 +94,9 @@ morefem_install(MoReFEM4RivlinCubeCheckResults)
add_test(RivlinCubeCheckResults
MoReFEM4RivlinCubeCheckResults
--test_output_dir ${MOREFEM_TEST_OUTPUT_DIR}
--root_dir ${MOREFEM_ROOT})
--
${MOREFEM_ROOT}
${MOREFEM_TEST_OUTPUT_DIR}
)
/*!
// \file
//
//
// Created by Sebastien Gilles <sebastien.gilles@inria.fr> on the Tue, 10 Apr 2018 17:53:23 +0200
// Copyright (c) Inria. All rights reserved.
//
*/
// \file
//
//
// Created by Sebastien Gilles <sebastien.gilles@inria.fr> on the Tue, 10 Apr 2018 17:53:23 +0200
// Copyright (c) Inria. All rights reserved.
//
*/
#define BOOST_TEST_MODULE model_rivlin_cube
#include "ThirdParty/IncludeWithoutWarning/Boost/Test.hpp"
#include "Utilities/Filesystem/File.hpp"
#include "ModelInstances/RivlinCube/InputData.hpp"
using namespace MoReFEM;
#include "Test/Tools/CatchMainTest.hpp"
#include "Test/Tools/CheckIdenticalFiles.hpp"
#include "Test/Tools/CompareEnsightFiles.hpp"
#include "Test/Tools/Fixture/Environment.hpp"
void CommonTestCase(std::string&& seq_or_par,
std::string&& geometry);
void CommonTestCase(std::string&& seq_or_par,
std::string&& geometry)
namespace // anonymous
{
decltype(auto) environment = Utilities::Environment::GetInstance(__FILE__, __LINE__);
std::string root_dir, output_dir;
REQUIRE_NOTHROW(root_dir = environment.GetEnvironmentVariable("MOREFEM_ROOT", __FILE__, __LINE__));
REQUIRE_NOTHROW(output_dir = environment.GetEnvironmentVariable("MOREFEM_TEST_OUTPUT_DIR", __FILE__, __LINE__));
REQUIRE(FilesystemNS::Folder::DoExist(root_dir));
REQUIRE(FilesystemNS::Folder::DoExist(output_dir));
s