preCICE
v3.1.2
Loading...
Searching...
No Matches
src
io
tests
ExportConfigurationTest.cpp
Go to the documentation of this file.
1
#include <
list
>
2
#include <
string
>
3
#include "
io/ExportContext.hpp
"
4
#include "
io/SharedPointer.hpp
"
5
#include "
io/config/ExportConfiguration.hpp
"
6
#include "
testing/TestContext.hpp
"
7
#include "
testing/Testing.hpp
"
8
#include "
xml/XMLTag.hpp
"
9
10
BOOST_AUTO_TEST_SUITE
(IOTests)
11
12
using namespace
precice
;
13
14
BOOST_AUTO_TEST_CASE
(Configuration)
15
{
16
PRECICE_TEST
(1_rank);
17
using
xml::XMLTag
;
18
XMLTag tag =
xml::getRootTag
();
19
{
20
io::ExportConfiguration
config(tag);
21
xml::configure
(tag,
xml::ConfigurationContext
{},
testing::getPathToSources
() +
"/io/tests/config1.xml"
);
22
BOOST_TEST(config.
exportContexts
().size() == 1);
23
const
io::ExportContext
&context = config.
exportContexts
().front();
24
BOOST_TEST(context.
type
==
"vtk"
);
25
BOOST_TEST(context.
everyNTimeWindows
== 10);
26
}
27
{
28
tag.clear();
29
io::ExportConfiguration
config(tag);
30
xml::configure
(tag,
xml::ConfigurationContext
{},
testing::getPathToSources
() +
"/io/tests/config2.xml"
);
31
BOOST_TEST(config.
exportContexts
().size() == 1);
32
const
io::ExportContext
&context = config.
exportContexts
().front();
33
BOOST_TEST(context.
type
==
"vtk"
);
34
BOOST_TEST(context.
everyNTimeWindows
== 1);
35
BOOST_TEST(context.
location
==
"somepath"
);
36
}
37
}
38
39
BOOST_AUTO_TEST_SUITE_END
()
// IOTests
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(Configuration)
Definition
ExportConfigurationTest.cpp:14
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:27
XMLTag.hpp
precice::io::ExportConfiguration
Configuration class for exports.
Definition
ExportConfiguration.hpp:15
precice::io::ExportConfiguration::exportContexts
std::list< ExportContext > & exportContexts()
Returns the configured export context.
Definition
ExportConfiguration.hpp:22
precice::xml::XMLTag
Represents an XML tag to be configured automatically.
Definition
XMLTag.hpp:31
SharedPointer.hpp
list
precice::testing::getPathToSources
std::string getPathToSources()
Returns the base path to the sources.
Definition
Testing.cpp:31
precice::xml::getRootTag
XMLTag getRootTag()
Returns an XMLTag::Listener that does nothing on callbacks.
Definition
XMLTag.cpp:389
precice::xml::configure
void configure(XMLTag &tag, const precice::xml::ConfigurationContext &context, std::string_view configurationFilename)
Configures the given configuration from file configurationFilename.
Definition
XMLTag.cpp:395
precice
Main namespace of the precice library.
Definition
Acceleration.cpp:5
string
precice::io::ExportContext
Definition
ExportContext.hpp:10
precice::io::ExportContext::type
std::string type
Definition
ExportContext.hpp:24
precice::io::ExportContext::everyNTimeWindows
int everyNTimeWindows
Definition
ExportContext.hpp:18
precice::io::ExportContext::location
std::string location
Definition
ExportContext.hpp:15
precice::xml::ConfigurationContext
Tightly coupled to the parameters of Participant()
Definition
XMLTag.hpp:24