preCICE v3.2.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ToolingTests.cpp
Go to the documentation of this file.
1#include <sstream>
2#include <string>
3#include "precice/Tooling.hpp"
4#include "testing/Testing.hpp"
5
6BOOST_AUTO_TEST_SUITE(PreciceTests)
8
10BOOST_AUTO_TEST_CASE(MarkdownReference)
11{
13 const std::string ref = [] {
16 return oss.str();
17 }();
18
19 BOOST_TEST(ref.size() > 0);
20 for (const auto &keyword : {"# precice-configuration", "<precice-configuration", "</precice-configuration>", "Example", "Valid Subtags:", "Attribute"}) {
21 BOOST_TEST(ref.find(keyword) != std::string::npos, "The output should include \"" << keyword << '"');
22 }
23}
24
27{
29 const std::string ref = [] {
32 return oss.str();
33 }();
34
35 BOOST_TEST(ref.size() > 0);
36 for (const auto &keyword : {"<!-- TAG precice-configuration", "<!-- TAG mesh", "ATTR name:"}) {
37 BOOST_TEST(ref.find(keyword) != std::string::npos, "The output should include \"" << keyword << '"');
38 }
39}
40
43{
45 const std::string ref = [] {
48 return oss.str();
49 }();
50
51 BOOST_TEST(ref.size() > 0);
52 for (const auto &keyword : {"<!ELEMENT precice-configuration", "<!ATTLIST mesh name"}) {
53 BOOST_TEST(ref.find(keyword) != std::string::npos, "The output should include \"" << keyword << '"');
54 }
55}
56
57BOOST_AUTO_TEST_SUITE(ConfigCheck)
58
61{
63 BOOST_REQUIRE_NO_THROW(
65 precice::testing::getPathToSources() + "/precice/tests/config-checker.xml",
66 "SolverTwo",
67 1));
68}
69
72{
74 BOOST_REQUIRE_NO_THROW(
76 precice::testing::getPathToSources() + "/precice/tests/config-checker.xml",
77 "SolverTwo",
78 4));
79}
80
82
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
BOOST_AUTO_TEST_CASE(MarkdownReference)
std::string getPathToSources()
Returns the base path to the sources.
Definition Testing.cpp:33
void printConfigReference(std::ostream &out, ConfigReferenceType reftype)
Generates a configuration reference.
Definition Tooling.cpp:15
void checkConfiguration(const std::string &filename, const std::string &participant, int size)
Checks a given configuration.
Definition Tooling.cpp:32
@ MD
Markdown version used for the website.
T str(T... args)