15 #define GETTEXT_DOMAIN "wesnoth-test"
19 #include <boost/test/unit_test.hpp>
26 std::vector<std::string> args {
"wesnoth"};
33 BOOST_CHECK(!co.
clock);
36 BOOST_CHECK(!co.
debug);
37 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
38 BOOST_CHECK(!co.debug_dot_domain);
39 BOOST_CHECK(!co.debug_dot_level);
44 BOOST_CHECK(!co.
help);
45 BOOST_CHECK(!co.
load);
61 BOOST_CHECK(!co.
nogui);
78 BOOST_CHECK(!co.
test);
89 std::vector<std::string> args {
94 "--preprocess-output-macros",
103 BOOST_CHECK(!co.
clock);
106 BOOST_CHECK(!co.
debug);
107 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
108 BOOST_CHECK(!co.debug_dot_domain);
109 BOOST_CHECK(!co.debug_dot_level);
112 BOOST_CHECK(!co.
fps);
114 BOOST_CHECK(!co.
help);
115 BOOST_CHECK(!co.
load);
116 BOOST_CHECK(!co.
log);
132 BOOST_CHECK(!co.
nogui);
148 BOOST_CHECK(co.
test && co.
test->empty());
159 std::vector<std::string> args {
161 "--ai-config=1:aifoo",
162 "--ai-config=2:aibar",
163 "--algorithm=3:algfoo",
164 "--algorithm=4:algbar",
165 "--campaign=campfoo",
166 "--campaign-difficulty=16",
167 "--campaign-scenario=scenfoo",
168 "--campaign-skip-story",
170 "--controller=5:confoo",
171 "--controller=6:conbar",
172 "--data-dir=datadirfoo",
175 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
176 "--debug-dot-domain=ddfoo",
177 "--debug-dot-level=dlfoo",
185 "--ignore-map-settings",
188 "--log-error=errfoo,errbar/*",
189 "--log-warning=warnfoo,warnfoo/bar",
190 "--log-info=infofoo",
191 "--log-debug=dbgfoo,dbgbar,dbg/foo/bar/baz",
192 "--logdomains=filterfoo",
200 "--parm=7:parmfoo:valfoo",
201 "--parm=8:parmbar:valbar",
202 "--preprocess",
"preppathfoo",
"preptargfoo",
203 "--preprocess-defines=DEFFOO,DEFBAR",
204 "--preprocess-input-macros=inmfoo",
205 "--preprocess-output-macros=outmfoo",
206 "--resolution=800x600",
208 "--scenario=scenfoo",
209 "--screenshot",
"mapfoo",
"outssfoo",
215 "--userdata-dir=userdatadirfoo",
228 BOOST_CHECK(co.
clock);
231 BOOST_CHECK(co.
debug);
232 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
233 BOOST_CHECK(co.debug_dot_domain && *co.debug_dot_domain ==
"ddfoo");
234 BOOST_CHECK(co.debug_dot_level && *co.debug_dot_level ==
"dlfoo");
239 BOOST_CHECK(co.
help);
240 BOOST_CHECK(co.
load && *co.
load ==
"loadfoo");
242 BOOST_CHECK(co.
log->size()==8);
244 BOOST_CHECK(co.
log->at(0).second ==
"errfoo" && co.
log->at(1).second ==
"errbar/*");
246 BOOST_CHECK(co.
log->at(2).second ==
"warnfoo" && co.
log->at(3).second ==
"warnfoo/bar");
248 BOOST_CHECK(co.
log->at(4).second ==
"infofoo");
251 BOOST_CHECK(co.
log->at(5).second ==
"dbgfoo" && co.
log->at(6).second ==
"dbgbar" && co.
log->at(7).second ==
"dbg/foo/bar/baz");
279 BOOST_CHECK(co.
nogui);
295 BOOST_CHECK(co.
test && *co.
test ==
"testfoo");
306 std::vector<std::string> args {
316 BOOST_CHECK(!co.
clock);
319 BOOST_CHECK(!co.
debug);
320 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
321 BOOST_CHECK(!co.debug_dot_domain);
322 BOOST_CHECK(!co.debug_dot_level);
325 BOOST_CHECK(!co.
fps);
327 BOOST_CHECK(!co.
help);
328 BOOST_CHECK(!co.
load);
329 BOOST_CHECK(!co.
log);
345 BOOST_CHECK(!co.
nogui);
361 BOOST_CHECK(!co.
test);
372 std::vector<std::string> args {
374 "--log-error=gui/draw",
375 "--log-info=all,gui/general",
377 "--log-none=all,gui/general,gui/draw",
378 "--log-error=gui/general"};
392 BOOST_AUTO_TEST_SUITE_END()
bool nogui
True if –nogui was given on the command line.
utils::optional< std::vector< std::pair< unsigned int, std::string > > > multiplayer_side
Non-empty if –side was given on the command line.
utils::optional< std::pair< int, int > > resolution
Pair of AxB values specified after –resolution.
utils::optional< std::string > screenshot_map_file
Map file to make a screenshot of.
utils::optional< std::string > multiplayer_scenario
Non-empty if –scenario was given on the command line.
utils::optional< std::string > test
Non-empty if –test was given on the command line.
bool windowed
True if –windowed was given on the command line.
utils::optional< std::vector< std::string > > preprocess_defines
Defines that were given to the –preprocess option.
utils::optional< std::string > screenshot_output_file
Output file to put screenshot in.
utils::optional< int > max_fps
Max FPS specified by –max-fps option.
bool multiplayer_exit_at_end
True if –exit-at-and was given on the command line.
utils::optional< int > campaign_difficulty
Non-empty if –campaign-difficulty was given on the command line.
bool debug
True if –debug was given on the command line.
bool nosound
True if –nosound was given on the command line.
bool multiplayer
True if –multiplayer was given on the command line.
utils::optional< std::string > server
Non-empty if –server was given on the command line.
utils::optional< std::string > userdata_dir
Non-empty if –userdata-dir was given on the command line.
utils::optional< std::vector< std::pair< lg::severity, std::string > > > log
Contains parsed arguments of –log-* (e.g.
bool validcache
True if –validcache was given on the command line.
bool nomusic
True if –nomusic was given on the command line.
bool clock
True if –clock was given on the command line.
utils::optional< std::string > campaign
Non-empty if –campaign was given on the command line.
utils::optional< std::string > logdomains
Non-empty if –logdomains was given on the command line.
bool new_widgets
True if –new-widgets was given on the command line.
utils::optional< std::string > preprocess_input_macros
Non-empty if –preprocess-input-macros was given on the command line.
bool preprocess
True if –preprocess was given on the command line.
utils::optional< unsigned int > rng_seed
RNG seed specified by –rng-seed option.
utils::optional< std::vector< std::pair< unsigned int, std::string > > > multiplayer_ai_config
Non-empty if –ai-config was given on the command line.
bool data_path
True if –data-path was given on the command line.
bool version
True if –version was given on the command line.
utils::optional< std::string > multiplayer_label
Non-empty if –label was given on the command line.
utils::optional< std::string > multiplayer_era
Non-empty if –era was given on the command line.
bool fps
True if –fps was given on the command line.
utils::optional< std::string > multiplayer_turns
Non-empty if –turns was given on the command line.
utils::optional< std::string > data_dir
Non-empty if –data-dir was given on the command line.
utils::optional< std::string > preprocess_target
Target (output) path that was given to the –preprocess option.
bool campaign_skip_story
True if –skip-story was given on the command line.
bool with_replay
True if –with-replay was given on the command line.
bool screenshot
True if –screenshot was given on the command line.
bool userdata_path
True if –userdata-path was given on the command line.
bool multiplayer_ignore_map_settings
True if –ignore-map-settings was given at the command line.
utils::optional< std::string > editor
Non-empty if –editor was given on the command line.
utils::optional< std::string > preprocess_output_macros
Non-empty if –preprocess-output-macros was given on the command line.
bool fullscreen
True if –fullscreen was given on the command line.
utils::optional< std::vector< std::pair< unsigned int, std::string > > > multiplayer_controller
Non-empty if –controller was given on the command line.
utils::optional< std::vector< std::pair< unsigned int, std::string > > > multiplayer_algorithm
Non-empty if –algorithm was given on the command line.
utils::optional< std::string > preprocess_path
Path to parse that was given to the –preprocess option.
bool help
True if –help was given on the command line.
bool nocache
True if –nocache was given on the command line.
utils::optional< std::vector< std::tuple< unsigned int, std::string, std::string > > > multiplayer_parm
Non-empty if –parm was given on the command line.
utils::optional< std::string > campaign_scenario
Non-empty if –campaign-scenario was given on the command line.
utils::optional< std::string > load
Non-empty if –load was given on the command line.
BOOST_AUTO_TEST_CASE(test_empty_options)
BOOST_AUTO_TEST_SUITE(filesystem)