equal
deleted
inserted
replaced
|
1 #summary How the engine is tested automatically |
|
2 |
|
3 = Engine tests cases = |
|
4 Hedgewars developers have made some automated tests to test certain |
|
5 features of the engine automatically to ensure a certain level of |
|
6 quality and to prevent old fixed bug from popping up again. |
|
7 |
|
8 Currently, all automated Lua tests are done with Lua scripting. |
|
9 |
|
10 == Running test cases == |
|
11 There are two ways to run a test: Automated and manual. |
|
12 |
|
13 === Automated testing === |
|
14 This requires you to have CMAke. |
|
15 |
|
16 Run `ctest` in the root directory of the repository to run all tests. |
|
17 Run `ctest -R <test name>` to run only the test with the given name. |
|
18 |
|
19 Note that automated tests will run much faster than in real game time. |
|
20 You won't see any actual game action, however. |
|
21 |
|
22 === Manual testing === |
|
23 Each test can also be run manually in which you run the tests in |
|
24 real time and you can see what's going on. |
|
25 |
|
26 Copy the corresponding Lua file from `tests/lua` to `Data/Missions/Training` |
|
27 and open Hedgewars and start the test from the training menu. |
|
28 |
|
29 == Creating test cases == |
|
30 You can find the test cases in the repository under `tests/lua`. |
|
31 |
|
32 These scripts are treated like ordinary scripts in Hedgewars (like |
|
33 misions or multiplayer scripts) but there's one important difference: |
|
34 You must call `EndLuaTest` when the test result (success or failure) |
|
35 has be determined (see [[LuaAPI]]). |
|
36 |