Difference between revisions of "ValidationFAQ"

From The Battle for Wesnoth Wiki
(Better explanation of what TEST covers)
Line 17: Line 17:
 
Points to note:
 
Points to note:
 
* These commands may also need ''--userconfig-dir'' and ''--data-dir'' arguments, depending on where you're running the Wesnoth executable from.
 
* 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.
+
* ''TEST'' validates test scenarios, including the AI demo scenarios and 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.
 
* 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''
 
* The ''[campaign]extra_defines='' value needs to be added on the command line, for example TRoW uses ''DISABLE_GRAND_MARSHAL''

Revision as of 13:39, 11 June 2021

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 test scenarios, including the AI demo scenarios and 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: