[wesnoth-commits] [wesnoth/wesnoth] a6f36b: Test parsing of WML define and undef macros by the...
Celtic Minstrel
noreply at github.com
Sat Nov 28 19:53:02 UTC 2020
Branch: refs/heads/master
Home: https://github.com/wesnoth/wesnoth
Commit: a6f36becb97ac5b51bf409f2d2968ac3286a47b4
https://github.com/wesnoth/wesnoth/commit/a6f36becb97ac5b51bf409f2d2968ac3286a47b4
Author: CrawlCycle <73139676+CrawlCycle at users.noreply.github.com>
Date: 2020-11-28 (Sat, 28 Nov 2020)
Changed paths:
M source_lists/boost_unit_tests
A src/tests/utils/wml_equivalence.cpp
A src/tests/utils/wml_equivalence.hpp
A src/tests/wml/test_macro_define.cpp
Log Message:
-----------
Test parsing of WML define and undef macros by the preprocessor & parser
This commit adds tools to test parsing of WML macros by the preprocessor
and parser. The commit also adds two tests of the #define and #undef
WML macro as examples.
The tests consist of three steps:
1. Define one WML string containing macros and one WML string
that lacks macros in each test. The two WML strings should be
equivalent after preprocessing.
2. Transform each WML string into a syntax tree (represented by config
objects) with the preprocessor and parser of Wesnoth.
3. Check if the two config objects are equal. Since the two WML strings
are equivalent, the two configs object should be equivalent if the
preprocessor and parsers are both correct.
The output of the preprocessor is in an undocumented format. Therefore,
this commit does not test the preprocessor as an isolated unit.
More information about the Commits
mailing list