16#define GETTEXT_DOMAIN "wesnoth-test"
18#include <boost/test/unit_test.hpp>
20#include <boost/algorithm/string/predicate.hpp>
32 constexpr auto schema_path =
"src/tests/wml/schema/test_schema_validator/test_schema_super_cycle.cfg";
33 constexpr auto config_path =
"src/tests/wml/schema/test_schema_validator/test_super_cycle.cfg";
42 defines_map.try_emplace(
"SCHEMA_VALIDATION");
47 return boost::algorithm::contains(
e.dev_message,
"Inheritance cycle from other/second to main/first found");
53 constexpr auto schema_path =
"src/tests/wml/schema/test_schema_validator/test_schema_super_cycle.cfg";
54 constexpr auto config_path =
"src/tests/wml/schema/test_schema_validator/test_super_cycle_only_if_used.cfg";
62 defines_map.try_emplace(
"SCHEMA_VALIDATION");
70 constexpr auto schema_path =
"src/tests/wml/schema/test_schema_validator/test_schema_super_cycle.cfg";
71 constexpr auto config_path
72 =
"src/tests/wml/schema/test_schema_validator/test_super_cycle_crashes_on_unknown_key.cfg";
80 defines_map.try_emplace(
"SCHEMA_VALIDATION");
85 return boost::algorithm::contains(
e.dev_message,
"Invalid key 'unknown=' in tag [first]");
91 constexpr auto schema_path =
"src/tests/wml/schema/test_schema_validator/test_schema_super_missing.cfg";
92 constexpr auto config_path =
"src/tests/wml/schema/test_schema_validator/test_super_cycle.cfg";
100 defines_map.try_emplace(
"SCHEMA_VALIDATION");
105 return boost::algorithm::contains(
e.dev_message,
"Super not/here not found. Needed by other/second");
111 constexpr auto schema_path =
"src/tests/wml/schema/test_schema_validator/test_schema_super_missing.cfg";
112 constexpr auto config_path =
"src/tests/wml/schema/test_schema_validator/test_super_cycle_only_if_used.cfg";
120 defines_map.try_emplace(
"SCHEMA_VALIDATION");
128 constexpr auto schema_path =
"src/tests/wml/schema/test_schema_validator/test_schema_super_mandatory_missing.cfg";
129 constexpr auto config_path =
"src/tests/wml/schema/test_schema_validator/test_super_mandatory.cfg";
137 defines_map.try_emplace(
"SCHEMA_VALIDATION");
145 constexpr auto schema_path =
"src/tests/wml/schema/test_schema_validator/test_schema_super_mandatory_missing.cfg";
146 constexpr auto config_path =
"src/tests/wml/schema/test_schema_validator/test_super_mandatory_missing.cfg";
154 defines_map.try_emplace(
"SCHEMA_VALIDATION");
158 return boost::algorithm::contains(
e.dev_message,
"Missing key 'id=' in tag [campaign]");
164 constexpr auto schema_path =
"src/tests/wml/schema/test_schema_validator/test_schema_super_cycle_mandatory.cfg";
165 constexpr auto config_path =
"src/tests/wml/schema/test_schema_validator/test_super_cycle_mandatory.cfg";
173 defines_map.try_emplace(
"SCHEMA_VALIDATION");
181 constexpr auto schema_path =
"src/tests/wml/schema/test_schema_validator/test_schema_link_cycle.cfg";
184 return boost::algorithm::contains(
e.message,
"Link cycle from");
188BOOST_AUTO_TEST_SUITE_END()
Realization of serialization/validator.hpp abstract validator.
Interfaces for manipulating version numbers of engine, add-ons, etc.
const version_info wesnoth_version(VERSION)
config read(std::istream &in, abstract_validator *validator)
filesystem::scoped_istream preprocess_file(const std::string &fname, preproc_map &defines)
Function to use the WML preprocessor on a file.
std::map< std::string, struct preproc_define > preproc_map
One of the realizations of serialization/validator.hpp abstract validator.
Used to manage with not initialized validators Supposed to be thrown from the constructor.
Helper class, don't construct this directly.
BOOST_AUTO_TEST_SUITE(filesystem)
BOOST_AUTO_TEST_CASE(test_super_cycle)
Add a special kind of assert to validate whether the input from WML doesn't contain any problems that...