preCICE v3.2.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExportConfigurationTest.cpp
Go to the documentation of this file.
1#include <list>
6#include "testing/Testing.hpp"
7#include "xml/XMLTag.hpp"
8
10BOOST_AUTO_TEST_SUITE(Configuration)
11
12using namespace precice;
13
16{
18 using xml::XMLTag;
19 XMLTag tag = xml::getRootTag();
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 &econtext = config.exportContexts().front();
24 BOOST_TEST(econtext.type == "vtk");
25 BOOST_TEST(econtext.everyNTimeWindows == 10);
26}
27
30{
32 using xml::XMLTag;
33 XMLTag tag = xml::getRootTag();
34 io::ExportConfiguration config(tag);
35 xml::configure(tag, xml::ConfigurationContext{}, testing::getPathToSources() + "/io/tests/config2.xml");
36 BOOST_TEST(config.exportContexts().size() == 1);
37 const io::ExportContext &econtext = config.exportContexts().front();
38 BOOST_TEST(econtext.type == "vtk");
39 BOOST_TEST(econtext.everyNTimeWindows == 1);
40 BOOST_TEST(econtext.location == "somepath");
41}
42
43BOOST_AUTO_TEST_SUITE_END() // Configuration
BOOST_AUTO_TEST_CASE(VTKEvery10)
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
#define PRECICE_TEST()
Definition Testing.hpp:39
#define PRECICE_TEST_SETUP(...)
Creates and attaches a TestSetup to a Boost test case.
Definition Testing.hpp:29
Configuration class for exports.
std::list< ExportContext > & exportContexts()
Returns the configured export context.
Represents an XML tag to be configured automatically.
Definition XMLTag.hpp:28
std::string getPathToSources()
Returns the base path to the sources.
Definition Testing.cpp:33
XMLTag getRootTag()
Returns an empty root tag with name "configuration".
Definition XMLTag.cpp:278
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
Main namespace of the precice library.
Tightly coupled to the parameters of Participant()
Definition XMLTag.hpp:21