18 #include <boost/filesystem.hpp>
19 #include <boost/filesystem/fstream.hpp>
20 #include <boost/test/unit_test.hpp>
22 namespace bfs = boost::filesystem;
31 void set(
const std::string& content)
35 const auto mode = std::ios_base::out;
36 stream.open(
path, std::ios_base::trunc | mode);
37 auto permission = (bfs::perms::owner_read | bfs::perms::owner_write);
38 bfs::permissions(
path, permission);
51 const bfs::path path = bfs::unique_path(
"%%%%-%%%%-%%%%-%%%%-%%%%-%%%%.tmp.out");
71 BOOST_CHECK_EQUAL(config_a, config_b);
A config object defines a single node in a WML file, with access to child nodes.
Self destructive temporary file at the current directory.
void set(const std::string &content)
Set file to content and close the file.
const bfs::path path
Path to the temporary file.
void remove()
Removes a tip.
bool exists(const image::locator &i_locator)
Returns true if the given image actually exists, without loading it.
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
void read(config &cfg, std::istream &in, abstract_validator *validator)
void check_wml_equivalence(const std::string &a, const std::string &b)
Assert two WML strings are equivalent.
config preprocess_and_parse(const std::string &wml_str, preproc_map *macro_map)
Make a syntax tree by preprocessing and parsing a WML string.
Tool to check if two WML string are equivalent.