# HG changeset patch # User Wuzzy # Date 1507126311 -7200 # Node ID 754e0a7bdd44caaf272260ff2ccaf24db9963cf5 # Parent 0de5837d0fc50078e3d5163f2b59981de5475102 Explain briefly how engine testing works diff -r 0de5837d0fc5 -r 754e0a7bdd44 CommandLineOptions.wiki --- a/CommandLineOptions.wiki Wed Oct 04 11:48:28 2017 +0100 +++ b/CommandLineOptions.wiki Wed Oct 04 16:11:51 2017 +0200 @@ -1,7 +1,7 @@ #summary Full list of command line switches for hedgewars, hwengine and server #labels Documentation,Engine,Frontend -= Commnd-line options = += Command-line options = @@ -116,4 +116,4 @@ * {{{--port=PORT}}} or {{{-p PORT}}}: Server listens on `PORT` * {{{--dedicated=BOOL}}} or {{{-d BOOL}}}: Spawn a separate process (`BOOL` is either “True” or “False”) - * {{{--help}}}: Shows a short text explaining the command-line arguments and exists the program thereafter. \ No newline at end of file + * {{{--help}}}: Shows a short text explaining the command-line arguments and exists the program thereafter. diff -r 0de5837d0fc5 -r 754e0a7bdd44 EngineTestCases.wiki --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/EngineTestCases.wiki Wed Oct 04 16:11:51 2017 +0200 @@ -0,0 +1,36 @@ +#summary How the engine is tested automatically + += Engine tests cases = +Hedgewars developers have made some automated tests to test certain +features of the engine automatically to ensure a certain level of +quality and to prevent old fixed bug from popping up again. + +Currently, all automated Lua tests are done with Lua scripting. + +== Running test cases == +There are two ways to run a test: Automated and manual. + +=== Automated testing === +This requires you to have CMAke. + +Run `ctest` in the root directory of the repository to run all tests. +Run `ctest -R ` to run only the test with the given name. + +Note that automated tests will run much faster than in real game time. +You won't see any actual game action, however. + +=== Manual testing === +Each test can also be run manually in which you run the tests in +real time and you can see what's going on. + +Copy the corresponding Lua file from `tests/lua` to `Data/Missions/Training` +and open Hedgewars and start the test from the training menu. + +== Creating test cases == +You can find the test cases in the repository under `tests/lua`. + +These scripts are treated like ordinary scripts in Hedgewars (like +misions or multiplayer scripts) but there's one important difference: +You must call `EndLuaTest` when the test result (success or failure) +has be determined (see [[LuaAPI]]). + diff -r 0de5837d0fc5 -r 754e0a7bdd44 LuaAPI.wiki --- a/LuaAPI.wiki Wed Oct 04 11:48:28 2017 +0100 +++ b/LuaAPI.wiki Wed Oct 04 16:11:51 2017 +0200 @@ -1373,4 +1373,6 @@ Calling this function ends an engine test and reports a test result. -`success` is either one of `TEST_SUCCESSFUL` to report a successful test or `TEST_FAILED` for a failed test. \ No newline at end of file +`success` is either one of `TEST_SUCCESSFUL` to report a successful test or `TEST_FAILED` for a failed test. + +See [EngineTestCases] to learn more about testing the engine. diff -r 0de5837d0fc5 -r 754e0a7bdd44 TableOfContents.wiki --- a/TableOfContents.wiki Wed Oct 04 11:48:28 2017 +0100 +++ b/TableOfContents.wiki Wed Oct 04 16:11:51 2017 +0200 @@ -44,6 +44,7 @@ * [PascalSyntax Pascal syntax rules] * [EngineProtocol Engine protocol] * [Hedgeroid_explained Hedgeroid, the Android port] + * [EngineTestCases Engine test cases] * Guides * [ContributingCode How to contribute code] * [GettingEmscriptenToWork Getting Emscripten to work]