Commit graph

364 commits

Author SHA1 Message Date
gfgtdf
68e5e7d7dc fix travis tests 2016-05-20 15:36:51 +02:00
Celtic Minstrel
106f1510d3 Fix unit test 2016-03-24 12:59:59 -04:00
Celtic Minstrel
cb0fad078a WML unit tests for simple aspects 2016-03-22 07:22:22 -07:00
gfgtdf
6e37603538 Attempt to fix travis mp tests 2016-03-20 19:04:33 +01:00
Celtic Minstrel
240b5f61a7 Output formula errors in unit filters to WML error stream
(And consider them to match no units)
2016-03-17 23:27:03 -04:00
Celtic Minstrel
26a2638f2c Make the formula and Lua views of a unit coincide more closely
Several keys were either missing or misnamed in the formula view.
These have been changed to match the Lua and WML names for the keys.
This affects canrecruit, moves, and max_moves, as well as status.

In addition, a large number of keys were missing entirely from the formula view.
Most of these keys have now been added and can be accessed from formulas.
A few that have little use in filters (such as image_mods or profile) are still missing.

The Lua view missed a few keys that the formula view did provide.
Although these could in principle have been obtained by using the special __cfg key,
they have now been added to the Lua view anyway.
2016-03-17 23:27:03 -04:00
gfgtdf
09e88c89d1 remove a useless prprocessor guard
in inclusion of test/multiplayer/ is already guarded with a #ifdef
MP_TEST so there is no point in using #ifdef MP_TEST in that file.
2016-02-15 18:00:43 +01:00
Celtic Minstrel
64ddd50895 Fix [for] loop not iterating the correct number of times
(when the array length changes during the loop)
2015-12-29 23:40:36 -05:00
gfgtdf
7f13156c28 Revert "Rename team_name/user_team_name to team_id/team_name (old syntax still valid)"
And related commits.

This reverts commit 545253ec2b.
This reverts commit 1215f65eb8.
This reverts commit 11664f4024.
This reverts commit e948df3424.
This reverts commit 3781e7839f.

This commits were reverted to exclude them from wesnoth 1.13.2 release because:
1) We are still unsure about the best name oftthese attributes
2) This breaks multiple campaigns, including LoW and the tutorial.
Feel free to revert this revert after 1.13.2 when thse issues can be solved..
2015-12-10 21:29:52 +01:00
gfgtdf
0241f5687e fix failing lua_get_sides test 2015-12-09 02:26:39 +01:00
aquileia
88d4c15c87 Exclude test strings from gettext 2015-12-02 00:37:14 +01:00
Charles Dang
e948df3424 Updated unit tests to use new team id/name syntax 2015-10-26 13:40:44 +11:00
Celtic Minstrel
f224e2a073 Fix WML unit tests 2015-10-07 20:09:57 -04:00
Charles Dang
798c59c7bd Replace most instances of a single-hex [terrain_mask] action with [terrain]
One file is deliberately not converted until we get a dedicated mask test
2015-10-07 17:00:53 +11:00
Celtic Minstrel
f8e897e8dd Change [explain] to [test_condition] 2015-10-06 14:45:29 -04:00
Celtic Minstrel
aa2e24d1b7 Finally fix all the [for] issues. Probably.
(With unit tests to back it up!)

- Fixes [for]step=0
- Fixes [for]start,stop=0,0
- Fixes [for]start,end,step=0,1,-1
- Probably fixes several other things too
2015-10-06 13:51:28 -04:00
Celtic Minstrel
fd34675dd9 Add an [explain] WML tag
This explains (in the log) why a WML conditional has failed (or succeeded). Currently it is fairly basic, looping through and/or/not and printing out the specific conditional tag that failed as well as, for [variable], the current content of the variable.

It's used in the WML unit tests system, but could also be useful for debugging.

This commit also fixes an issue with passing multiple -a arguments to run_wml_tests.
2015-10-06 13:51:27 -04:00
Celtic Minstrel
7e26e09061 Fix erroneous handling of [break]/[continue] in [elseif] 2015-09-23 00:25:31 -04:00
Celtic Minstrel
0d49eeeb39 Add SUCCEED/FAIL macros for WML test cases 2015-09-22 23:13:38 -04:00
Celtic Minstrel
aec99429c4 Merge branch 'break-continue' into foreach 2015-09-20 00:48:39 -04:00
Celtic Minstrel
3c329408ce Implement [break], [continue], [return] tags (they take no arguments) 2015-09-20 00:47:23 -04:00
Celtic Minstrel
a5184181df Fix SUF $this_unit only working within [filter_wml] 2015-09-19 00:19:26 -04:00
Ignacio R. Morelle
987f0157c2 Revert recent map code changes related to map mask handling
They break some unit tests and we can't seem to decide whether the tests
are truly at fault (that is beyond the fact that they _should_ certainly
use [terrain] instead of [terrain_mask]) or whether the issue that the
author was trying to fix at the beginning was an issue in the first
place.

This reverts the following commits:

 * commit 6b78073b49
 * commit 2f650419da
 * commit a436c46f13
 * commit fcf8b72efd
 * commit 079692d424
 * commit 730d837296
2015-08-16 00:38:31 -03:00
Charles Dang
fcf8b72efd Partially revert a436c46f13 and replace [terrain_mask] with [terrain] 2015-08-14 08:41:04 +11:00
Charles Dang
a436c46f13 Comment out [terrain_mask] inclusion possibly breaking feeding test 2015-08-13 15:29:35 +11:00
gfgtdf
49219ad0fd add team share_vision=all/shroud/none
previously there were 2 flags share_view=yes/no and share_maps=yes/no,
but only 3 possible settings (share both, share none, only share shroud)
(so share_maps= was ignored if share_viewv=yes). This made the wml code and
the c++ code needlessly complicated.

Now these 2 flags are replaced by share_vision=all/shroud/none
2015-07-23 14:00:08 +02:00
Elvish_Hunter
d4a3c76447 Improved the [role] unit test
A new unit test, called 'test_role_lua' was added, to ensure that the [role]
tag could be used from Lua.
Also, in the first unit test the types list is stored in a variable, to
ensure that variable substitution works as intended
2015-06-13 21:23:40 +02:00
Elvish_Hunter
1b239aa3e6 Added a new unit test for [role] 2015-06-10 22:07:28 +02:00
Chris Beck
f4c99b3a1a fixup wesnoth.wml_conditionals, add unit tests 2015-04-10 14:16:21 -04:00
Ignacio R. Morelle
7f5152d0c3 Add filesystem code unit tests (bug #23216)
This is somewhat incomplete, but already covers most core functionality
and helped uncover an important bug in the BFS implementation (see
commit 1c927c8407).

Most notably, normalize_path() isn't tested yet, as well as corner cases
with empty strings and get_wml_location().
2015-04-05 02:04:05 -03:00
Charles Dang
0911b1f4d5 Added some conditional unit tests 2015-04-03 08:31:13 +11:00
Charles Dang
d9ef035bc0 Ran wmlindent on the new unit test. Some formatting had to be manually fixed. 2015-01-08 06:07:07 +11:00
Chris Beck
8459bf7104 add lua function "fire_wml_menu_item" and unit tests for menu items
this commit also changed slightly the way that wml menu events
are synced. previously they were run via "run_in_synced_context",
now they are run via "run_in_synced_context_if_not_already", which
makes it safe to fire them from lua (a synced context).
2015-01-06 21:42:52 -05:00
Charles Dang
46fc0d4d93 Fixup HEAD, small formatting bit I missed 2015-01-05 20:57:05 +11:00
Charles Dang
3b43c7dcf1 Ran wmlindnet on unit tests. Some formatting had to be manually corrected 2015-01-05 20:42:12 +11:00
Chris Beck
18b5059b23 add some [time_area] unit tests 2015-01-05 02:34:09 -05:00
Chris Beck
6a3321d0db fix bug #23130 (xp modifier not working), add unit tests
Reverts commit e85c37e161 which was
an error.

I chose to use a scoped_pointer this time around because the
definition of play_controller should not actually depend on the
complete definition of unit_type.
2015-01-02 18:03:24 -05:00
Chris Beck
a273be5520 add a wml unit test for {CLEAR_VARIABLE} macro 2014-12-29 00:39:14 -05:00
Chris Beck
2239ab3f65 add a unit test for lua get_sides return object 2014-12-26 01:07:57 -05:00
Chris Beck
2396cfc937 reduce the failure probability of a lua random unit test
It seemed to spuriously pass on travis when it should be failing,
this should be much more unlikely now.
2014-12-19 22:51:30 -05:00
Chris Beck
489074b0a4 add --mp-tests option and preproc defines, and mp unit tests folder
These tests are meant to be run in a networked context to check for
OOS and similar.
2014-12-19 19:47:27 -05:00
Chris Beck
d1d0990235 add a unit test for wesnoth.require 2014-12-06 23:32:29 -05:00
Chris Beck
69d7924df5 add a wml unit test for lua dofile 2014-12-05 15:30:12 -05:00
Chris Beck
a8d69793ee add tests for {MOVE_UNIT} macro 2014-10-18 15:44:05 -04:00
Chris Beck
6cb9c518c7 Merge branch 'has_ally_master'
Conflicts:
	wml_test_schedule
2014-07-12 11:05:18 -04:00
Chris Beck
5a64d43fae add [has_ally],[has_enemy] tags for standard side filter
Unlike [allied_with] and [enemy_of], these will match if only if
there is *any* ally or enemy matching the filter. The other versions
of the tag match only if all sides matching the filter are
allied / opposed.

This commit also adds a unit test that checks that it works as
expected.
2014-07-12 10:33:56 -04:00
Chris Beck
72d91daed0 fixup [filter_vision] tags
This is the master version of PR #237, with unit tests.
2014-07-12 09:59:24 -04:00
Chris Beck
1cb74d62f8 Merge pull request #229 from cbeck88/wmi_items_preference
add adv. preference for number of menu items displayed at once,

and remaining fixups there
2014-07-07 14:09:46 -04:00
Ignacio R. Morelle
e527969bdc wmlindent pass on data/test/scenarios/, safe subset
This commit only includes files that weren't incorrectly modified by
wmlindent as the result of bugs; in other words, all files but the
following:

 * break_replay_with_lua_random.cfg
 * characterize_pathfinding.cfg
 * event_handlers_in_events.cfg
 * recruit_facing.cfg
2014-07-03 19:56:35 -04:00
Chris Beck
cee6874786 Merge branch 'refactor_unit_filter' 2014-07-03 19:27:36 -04:00