Reorganize unit tests.

This commit is contained in:
Pentarctagon 2022-12-07 15:59:39 -06:00 committed by Pentarctagon
parent ffbb1c0913
commit 5eae1b6199
148 changed files with 143 additions and 19 deletions

View file

@ -49,6 +49,11 @@
#endif
[/ais]
#ifdef DEBUG_MODE
# load tests that need manual user input to run and validate
{test/scenarios/manual_tests}
#endif
#ifdef EDITOR
[textdomain]
name="wesnoth-editor"
@ -56,15 +61,12 @@
#endif
#ifdef TEST
{scenario-test.cfg}
{scenario-leaders.cfg}
{scenario-movethrough.cfg}
{scenario-story.cfg}
{ai/scenarios/}
{ai/micro_ais/scenarios/}
#define DONT_RELOAD_CORE
#enddef
# load test scenarios and macros
{test/}
#endif

View file

@ -1,5 +1,4 @@
#textdomain wesnoth-test
# @file data/scenario-test.cfg
[test]
name=_"Test scenario"

View file

@ -1,5 +1,4 @@
#textdomain wesnoth-test
# @file data/scenario-test.cfg
[test]
name=_"Test scenario"

View file

@ -1,5 +1,4 @@
#textdomain wesnoth-test
# @file data/scenario-test.cfg
[test]
name=_"Test scenario"

View file

@ -1,5 +1,4 @@
#textdomain wesnoth-test
# @file data/scenario-test.cfg
[test]
name=_"Test scenario"

View file

@ -30,7 +30,48 @@
{test/macros}
#Load test scenarios
{test/scenarios}
{test/scenarios/behavioral_tests}
{test/scenarios/cve_tests}
{test/scenarios/lua_tests}
{test/scenarios/lua_tests/ai}
{test/scenarios/lua_tests/filesystem}
{test/scenarios/lua_tests/functional}
{test/scenarios/lua_tests/gui}
{test/scenarios/lua_tests/gui/widget}
{test/scenarios/lua_tests/location_set}
{test/scenarios/lua_tests/mathx}
{test/scenarios/lua_tests/stringx}
{test/scenarios/lua_tests/unit_test}
{test/scenarios/lua_tests/wesnoth}
{test/scenarios/lua_tests/wesnoth/audio}
{test/scenarios/lua_tests/wesnoth/game_events}
{test/scenarios/lua_tests/wesnoth/interface}
{test/scenarios/lua_tests/wesnoth/map}
{test/scenarios/lua_tests/wesnoth/paths}
{test/scenarios/lua_tests/wesnoth/schedule}
{test/scenarios/lua_tests/wesnoth/sides}
{test/scenarios/lua_tests/wesnoth/sync}
{test/scenarios/lua_tests/wesnoth/units}
{test/scenarios/lua_tests/wml}
{test/scenarios/lua_tests/wml-utils}
{test/scenarios/macro_tests}
{test/scenarios/test_tests}
{test/scenarios/wml_tests/ScenarioWML}
{test/scenarios/wml_tests/ScenarioWML/AiWML}
{test/scenarios/wml_tests/ScenarioWML/EffectWML}
{test/scenarios/wml_tests/ScenarioWML/EventWML}
{test/scenarios/wml_tests/ScenarioWML/EventWML/ActionWML}
{test/scenarios/wml_tests/ScenarioWML/EventWML/ActionWML/ConditionalActionsWML}
{test/scenarios/wml_tests/ScenarioWML/EventWML/ActionWML/DirectActionsWML}
{test/scenarios/wml_tests/ScenarioWML/EventWML/ActionWML/InterfaceActionsWML}
{test/scenarios/wml_tests/ScenarioWML/EventWML/ActionWML/InternalActionsWML}
{test/scenarios/wml_tests/ScenarioWML/MusicListWML}
{test/scenarios/wml_tests/ScenarioWML/SideWML}
{test/scenarios/wml_tests/ScenarioWML/TimeWML}
{test/scenarios/wml_tests/TerrainWML}
{test/scenarios/wml_tests/UnitsWML}
{test/scenarios/wml_tests/UnitsWML/AbilitiesWML}
{test/scenarios/wml_tests/WesnothFormulaLanguage}
#endif

View file

@ -9,10 +9,10 @@
#####
{GENERIC_UNIT_TEST "cve_2018_1999023" (
[lua]
code = << pcall(function() wesnoth.dofile("test/scenarios/bytecode.bin") end) >>
code = << pcall(function() wesnoth.dofile("test/scenarios/cve_tests/bytecode.bin") end) >>
[/lua]
[lua]
code = << pcall(function() wesnoth.require("test/scenarios/bytecode.bin") end) >>
code = << pcall(function() wesnoth.require("test/scenarios/cve_tests/bytecode.bin") end) >>
[/lua]
[lua]
code = <<

View file

@ -0,0 +1 @@
git doesn't allow adding empty directories; delete this once any test is added

View file

@ -0,0 +1 @@
git doesn't allow adding empty directories; delete this once any test is added

View file

@ -0,0 +1 @@
git doesn't allow adding empty directories; delete this once any test is added

View file

@ -0,0 +1 @@
git doesn't allow adding empty directories; delete this once any test is added

View file

@ -0,0 +1 @@
git doesn't allow adding empty directories; delete this once any test is added

View file

@ -0,0 +1 @@
git doesn't allow adding empty directories; delete this once any test is added

View file

@ -0,0 +1 @@
git doesn't allow adding empty directories; delete this once any test is added

View file

@ -0,0 +1 @@
git doesn't allow adding empty directories; delete this once any test is added

View file

@ -0,0 +1 @@
git doesn't allow adding empty directories; delete this once any test is added

View file

@ -0,0 +1 @@
git doesn't allow adding empty directories; delete this once any test is added

View file

@ -0,0 +1 @@
git doesn't allow adding empty directories; delete this once any test is added

View file

@ -0,0 +1 @@
git doesn't allow adding empty directories; delete this once any test is added

View file

@ -1,5 +1,4 @@
#textdomain wesnoth-test
# @file data/scenario-test.cfg
[test]
name=_"Test scenario"

View file

@ -1,6 +1,7 @@
#textdomain wesnoth-test
[test]
id=story
name=_"Test story"
[story]
[part]
music=elvish-theme.ogg

View file

@ -1,5 +1,36 @@
#textdomain wesnoth-test
{GENERIC_UNIT_TEST "test_max_menu_items" (
[test]
name = _ "Unit Test test_max_menu_items"
map_file=test/maps/generic_unit_test.map
turns = -1
id = test_max_menu_items
{DAWN}
[side]
side=1
controller=human
recruit=
gold=100
[leader]
name = _ "Alice"
type = Elvish Archer
id=alice
[/leader]
[/side]
[side]
side=2
controller=human
recruit=
gold=100
[leader]
name = _ "Bob"
type = Orcish Grunt
id=bob
[/leader]
[/side]
[event]
name=side 1 turn
first_time_only=no
@ -118,4 +149,4 @@
description=_"foo21"
[/set_menu_item]
[/event]
)}
[/test]

View file

@ -23,8 +23,38 @@
[/terrain]
#enddef
{GENERIC_UNIT_TEST "test_relative_dir" (
[test]
name = _ "Unit Test test_relative_dir"
map_file=test/maps/generic_unit_test.map
turns = -1
id = test_relative_dir
is_unit_test=no
{DAWN}
[side]
side=1
controller=human
recruit=
gold=100
[leader]
name = _ "Alice"
type = Elvish Archer
id=alice
[/leader]
[/side]
[side]
side=2
controller=human
recruit=
gold=100
[leader]
name = _ "Bob"
type = Orcish Grunt
id=bob
[/leader]
[/side]
[event]
name=start
[modify_unit]
@ -121,4 +151,4 @@
terrain="Md"
[/terrain]
[/event]
)}
[/test]

View file

@ -1,4 +1,5 @@
#textdomain wesnoth-test
#define AI_NOTIFICATION_STAGE CODE
[ai]
ai_algorithm=idle_ai
@ -87,5 +88,12 @@ end
[/test]
#enddef
{test/scenarios/ai/config}
{test/scenarios/ai/modify}
{test/scenarios/wml_tests/ScenarioWML/AiWML/config}
{test/scenarios/wml_tests/ScenarioWML/AiWML/modify}
#undef AI_NOTIFICATION_STAGE
#undef ASPECT_NOTIFICATION
#undef SPLIT
#undef AI_ASPECT_UNIT_TEST
#undef AI_UNIT_TEST

View file

@ -0,0 +1 @@
git doesn't allow adding empty directories; delete this once any test is added

Some files were not shown because too many files have changed in this diff Show more