preCICE
Loading...
Searching...
No Matches
src
io
tests
ExportConfigurationTest.cpp
Go to the documentation of this file.
1
#include <list>
2
#include "
io/ExportContext.hpp
"
3
#include "
io/config/ExportConfiguration.hpp
"
4
#include "
testing/TestContext.hpp
"
5
#include "
testing/Testing.hpp
"
6
#include "
xml/XMLTag.hpp
"
7
8
BOOST_AUTO_TEST_SUITE
(IOTests)
9
BOOST_AUTO_TEST_SUITE
(Configuration)
10
11
using namespace
precice
;
12
13
PRECICE_TEST_SETUP
(1_rank)
14
BOOST_AUTO_TEST_CASE
(VTKEvery10)
15
{
16
PRECICE_TEST
();
17
using
xml::XMLTag
;
18
XMLTag tag =
xml::getRootTag
();
19
io::ExportConfiguration
config
(tag);
20
xml::configure
(tag,
xml::ConfigurationContext
{},
testing::getPathToSources
() +
"/io/tests/config1.xml"
);
21
BOOST_TEST(
config
.exportContexts().size() == 1);
22
const
io::ConfiguredExport
&econtext =
config
.exportContexts().front();
23
BOOST_TEST(econtext.
type
==
"vtk"
);
24
BOOST_TEST(econtext.
everyNTimeWindows
== 10);
25
}
26
27
PRECICE_TEST_SETUP
(1_rank)
28
BOOST_AUTO_TEST_CASE
(VTKLocation)
29
{
30
PRECICE_TEST
();
31
using
xml::XMLTag
;
32
XMLTag tag =
xml::getRootTag
();
33
io::ExportConfiguration
config
(tag);
34
xml::configure
(tag,
xml::ConfigurationContext
{},
testing::getPathToSources
() +
"/io/tests/config2.xml"
);
35
BOOST_TEST(
config
.exportContexts().size() == 1);
36
const
io::ConfiguredExport
&econtext =
config
.exportContexts().front();
37
BOOST_TEST(econtext.
type
==
"vtk"
);
38
BOOST_TEST(econtext.
everyNTimeWindows
== 1);
39
BOOST_TEST(econtext.
location
==
"somepath"
);
40
}
41
42
BOOST_AUTO_TEST_SUITE_END
()
// Configuration
43
BOOST_AUTO_TEST_SUITE_END
()
// IOTests
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(testIQNIMVJPPWithSubsteps)
Definition
AccelerationSerialTest.cpp:124
ExportConfiguration.hpp
ExportContext.hpp
BOOST_AUTO_TEST_SUITE
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END
BOOST_AUTO_TEST_SUITE_END()
TestContext.hpp
Testing.hpp
PRECICE_TEST
#define PRECICE_TEST()
Definition
Testing.hpp:39
PRECICE_TEST_SETUP
#define PRECICE_TEST_SETUP(...)
Creates and attaches a TestSetup to a Boost test case.
Definition
Testing.hpp:29
XMLTag.hpp
precice::io::ExportConfiguration
Configuration class for exports.
Definition
ExportConfiguration.hpp:14
precice::xml::XMLTag
Represents an XML tag to be configured automatically.
Definition
XMLTag.hpp:28
precice::config
Definition
Configuration.cpp:26
precice::testing::getPathToSources
std::string getPathToSources()
Returns the base path to the sources.
Definition
Testing.cpp:34
precice::xml::getRootTag
XMLTag getRootTag()
Returns an empty root tag with name "configuration".
Definition
XMLTag.cpp:278
precice::xml::configure
std::string configure(XMLTag &tag, const precice::xml::ConfigurationContext &context, std::string_view configurationFilename)
Configures the given configuration from file configurationFilename.
Definition
XMLTag.cpp:284
precice
Main namespace of the precice library.
Definition
Acceleration.cpp:5
precice::io::ConfiguredExport
Definition
ExportContext.hpp:11
precice::io::ConfiguredExport::type
std::string type
Definition
ExportContext.hpp:25
precice::io::ConfiguredExport::location
std::string location
Definition
ExportContext.hpp:13
precice::io::ConfiguredExport::everyNTimeWindows
int everyNTimeWindows
Definition
ExportContext.hpp:16
precice::xml::ConfigurationContext
Tightly coupled to the parameters of Participant().
Definition
XMLTag.hpp:21