ValidationFAQ
From The Battle for Wesnoth Wiki
Revision as of 07:27, 22 January 2021 by Pentarctagon (talk | contribs)
The validation tool built in to the Wesnoth engine
(Version 1.15.? and later only) The Wesnoth engine's --validate option makes Wesnoth run the validation instead of playing the game. It's run automatically on the mainline campaigns as part of the continuous-integration builds, via the utils/travis/schema_validation.sh script.
The rules for validating WML are defined by SchemaWML files in the data/schema/ directory.
Manually validating a mainline campaign
To run it manually on a mainline campaign, validate data/_main.cfg with the appropriate defines.
- wesnoth --validate data/_main.cfg --preprocess-defines=TEST,SCHEMA_SHOULD_SKIP_THIS
- wesnoth --validate data/_main.cfg --preprocess-defines=TUTORIAL
- wesnoth --validate data/_main.cfg --preprocess-defines=EASY,CAMPAIGN_THE_RISE_OF_WESNOTH,DISABLE_GRAND_MARSHAL
- wesnoth --validate data/_main.cfg --preprocess-defines=NORMAL,CAMPAIGN_THE_RISE_OF_WESNOTH,DISABLE_GRAND_MARSHAL
- etc
Points to note:
- These commands may also need --userconfig-dir and --data-dir arguments, depending on where you're running the Wesnoth executable from.
- TEST validates the WML unit-tests, and requires SCHEMA_SHOULD_SKIP_THIS to avoid failing on some tests which check the engine's response to invalid WML.
- Campaigns need a separate validation run for each of their difficulty levels.
- The [campaign]extra_defines= value needs to be added on the command line, for example TRoW uses DISABLE_GRAND_MARSHAL
Validating an add-on
(Version 1.15.? and later only) Can be done using the Wesnoth engine's --validate-addon option.
(Version 1.15.4 and later only) The current status as of 1.15.4 is that this tool isn't ready for use yet.
Needs more documentation, but for now check:
- https://github.com/wesnoth/wesnoth/issues/4223 only validates when the cache is rebuilt
- https://github.com/wesnoth/wesnoth/issues/4224 no feedback on typos
- https://github.com/wesnoth/wesnoth/issues/4225 the GUI starts even when just validating