preCICE v3.1.2
Loading...
Searching...
No Matches
ExportConfigurationTest.cpp
Go to the documentation of this file.
1#include <list>
2#include <string>
7#include "testing/Testing.hpp"
8#include "xml/XMLTag.hpp"
9
11
12using namespace precice;
13
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
BOOST_AUTO_TEST_CASE(Configuration)
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
#define PRECICE_TEST(...)
Definition Testing.hpp:27
Configuration class for exports.
std::list< ExportContext > & exportContexts()
Returns the configured export context.
Represents an XML tag to be configured automatically.
Definition XMLTag.hpp:31
std::string getPathToSources()
Returns the base path to the sources.
Definition Testing.cpp:31
XMLTag getRootTag()
Returns an XMLTag::Listener that does nothing on callbacks.
Definition XMLTag.cpp:389
void configure(XMLTag &tag, const precice::xml::ConfigurationContext &context, std::string_view configurationFilename)
Configures the given configuration from file configurationFilename.
Definition XMLTag.cpp:395
Main namespace of the precice library.
Tightly coupled to the parameters of Participant()
Definition XMLTag.hpp:24