The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
test_commandline_options.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2016 by Lukasz Dobrogowski <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 #define GETTEXT_DOMAIN "wesnoth-test"
15 
16 #include "commandline_options.hpp"
17 
18 #include <boost/test/unit_test.hpp>
19 #include <boost/assign.hpp>
20 
21 BOOST_AUTO_TEST_SUITE( cmdline_opts )
22 
23 BOOST_AUTO_TEST_CASE (test_empty_options)
24 {
25 
26  std::vector<std::string> args = {"wesnoth"};
27  commandline_options co(args);
28 
29  BOOST_CHECK(!co.campaign);
30  BOOST_CHECK(!co.campaign_difficulty);
31  BOOST_CHECK(!co.campaign_scenario);
32  BOOST_CHECK(!co.clock);
33  BOOST_CHECK(!co.data_dir);
34  BOOST_CHECK(!co.data_path);
35  BOOST_CHECK(!co.debug);
36 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
37  BOOST_CHECK(!co.debug_dot_domain);
38  BOOST_CHECK(!co.debug_dot_level);
39 #endif
40  BOOST_CHECK(!co.editor);
41  BOOST_CHECK(!co.fps);
42  BOOST_CHECK(!co.fullscreen);
43  BOOST_CHECK(!co.gunzip);
44  BOOST_CHECK(!co.gzip);
45  BOOST_CHECK(!co.help);
46  BOOST_CHECK(!co.load);
47  BOOST_CHECK(!co.log);
48  BOOST_CHECK(!co.logdomains);
49  BOOST_CHECK(!co.multiplayer);
50  BOOST_CHECK(!co.multiplayer_ai_config);
51  BOOST_CHECK(!co.multiplayer_algorithm);
52  BOOST_CHECK(!co.multiplayer_controller);
53  BOOST_CHECK(!co.multiplayer_era);
54  BOOST_CHECK(!co.multiplayer_exit_at_end);
55  BOOST_CHECK(!co.multiplayer_ignore_map_settings);
56  BOOST_CHECK(!co.multiplayer_label);
57  BOOST_CHECK(!co.multiplayer_parm);
58  BOOST_CHECK(!co.multiplayer_side);
59  BOOST_CHECK(!co.multiplayer_turns);
60  BOOST_CHECK(!co.max_fps);
61  BOOST_CHECK(!co.nocache);
62  BOOST_CHECK(!co.nodelay);
63  BOOST_CHECK(!co.nogui);
64  BOOST_CHECK(!co.nomusic);
65  BOOST_CHECK(!co.nosound);
66  BOOST_CHECK(!co.new_widgets);
67  BOOST_CHECK(!co.path);
68  BOOST_CHECK(!co.preprocess);
69  BOOST_CHECK(!co.preprocess_defines);
70  BOOST_CHECK(!co.preprocess_input_macros);
71  BOOST_CHECK(!co.preprocess_output_macros);
72  BOOST_CHECK(!co.preprocess_path);
73  BOOST_CHECK(!co.preprocess_target);
74  BOOST_CHECK(!co.resolution);
75  BOOST_CHECK(!co.rng_seed);
76  BOOST_CHECK(!co.multiplayer_scenario);
77  BOOST_CHECK(!co.server);
78  BOOST_CHECK(!co.screenshot);
79  BOOST_CHECK(!co.screenshot_map_file);
80  BOOST_CHECK(!co.screenshot_output_file);
81  BOOST_CHECK(!co.test);
82  BOOST_CHECK(!co.userconfig_dir);
83  BOOST_CHECK(!co.userconfig_path);
84  BOOST_CHECK(!co.userdata_dir);
85  BOOST_CHECK(!co.userdata_path);
86  BOOST_CHECK(!co.validcache);
87  BOOST_CHECK(!co.version);
88  BOOST_CHECK(!co.windowed);
89  BOOST_CHECK(!co.with_replay);
90 }
91 
92 BOOST_AUTO_TEST_CASE (test_default_options)
93 {
94  std::vector<std::string> args = {
95  "wesnoth",
96  "--campaign",
97  "--editor",
98  "--logdomains",
99  "--preprocess-output-macros",
100  "--server",
101  "--test"};
102 
103  commandline_options co(args);
104  BOOST_CHECK(co.campaign && co.campaign->empty());
105  BOOST_CHECK(!co.campaign_difficulty);
106  BOOST_CHECK(!co.campaign_scenario);
107  BOOST_CHECK(!co.clock);
108  BOOST_CHECK(!co.data_dir);
109  BOOST_CHECK(!co.data_path);
110  BOOST_CHECK(!co.debug);
111 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
112  BOOST_CHECK(!co.debug_dot_domain);
113  BOOST_CHECK(!co.debug_dot_level);
114 #endif
115  BOOST_CHECK(co.editor && co.editor->empty());
116  BOOST_CHECK(!co.fps);
117  BOOST_CHECK(!co.fullscreen);
118  BOOST_CHECK(!co.gunzip);
119  BOOST_CHECK(!co.gzip);
120  BOOST_CHECK(!co.help);
121  BOOST_CHECK(!co.load);
122  BOOST_CHECK(!co.log);
123  BOOST_CHECK(co.logdomains && co.logdomains->empty());
124  BOOST_CHECK(!co.multiplayer);
125  BOOST_CHECK(!co.multiplayer_ai_config);
126  BOOST_CHECK(!co.multiplayer_algorithm);
127  BOOST_CHECK(!co.multiplayer_controller);
128  BOOST_CHECK(!co.multiplayer_era);
129  BOOST_CHECK(!co.multiplayer_exit_at_end);
130  BOOST_CHECK(!co.multiplayer_ignore_map_settings);
131  BOOST_CHECK(!co.multiplayer_label);
132  BOOST_CHECK(!co.multiplayer_parm);
133  BOOST_CHECK(!co.multiplayer_scenario);
134  BOOST_CHECK(!co.multiplayer_side);
135  BOOST_CHECK(!co.multiplayer_turns);
136  BOOST_CHECK(!co.max_fps);
137  BOOST_CHECK(!co.nocache);
138  BOOST_CHECK(!co.nodelay);
139  BOOST_CHECK(!co.nogui);
140  BOOST_CHECK(!co.nomusic);
141  BOOST_CHECK(!co.nosound);
142  BOOST_CHECK(!co.new_widgets);
143  BOOST_CHECK(!co.path);
144  BOOST_CHECK(!co.preprocess);
145  BOOST_CHECK(!co.preprocess_defines);
146  BOOST_CHECK(!co.preprocess_input_macros);
147  BOOST_CHECK(co.preprocess_output_macros && co.preprocess_output_macros->empty());
148  BOOST_CHECK(!co.preprocess_path);
149  BOOST_CHECK(!co.preprocess_target);
150  BOOST_CHECK(!co.resolution);
151  BOOST_CHECK(!co.rng_seed);
152  BOOST_CHECK(co.server && co.server->empty());
153  BOOST_CHECK(!co.screenshot);
154  BOOST_CHECK(!co.screenshot_map_file);
155  BOOST_CHECK(!co.screenshot_output_file);
156  BOOST_CHECK(co.test && co.test->empty());
157  BOOST_CHECK(!co.userconfig_dir);
158  BOOST_CHECK(!co.userconfig_path);
159  BOOST_CHECK(!co.userdata_dir);
160  BOOST_CHECK(!co.userdata_path);
161  BOOST_CHECK(!co.validcache);
162  BOOST_CHECK(!co.version);
163  BOOST_CHECK(!co.windowed);
164  BOOST_CHECK(!co.with_replay);
165 }
166 
167 BOOST_AUTO_TEST_CASE (test_full_options)
168 {
169  std::vector<std::string> args = {
170  "wesnoth",
171  "--ai-config=1:aifoo",
172  "--ai-config=2:aibar",
173  "--algorithm=3:algfoo",
174  "--algorithm=4:algbar",
175  "--campaign=campfoo",
176  "--campaign-difficulty=16",
177  "--campaign-scenario=scenfoo",
178  "--clock",
179  "--controller=5:confoo",
180  "--controller=6:conbar",
181  "--data-dir=datadirfoo",
182  "--data-path",
183  "--debug",
184 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
185  "--debug-dot-domain=ddfoo",
186  "--debug-dot-level=dlfoo",
187 #endif
188  "--editor=editfoo",
189  "--era=erafoo",
190  "--exit-at-end",
191  "--fps",
192  "--fullscreen",
193  "--gunzip=gunzipfoo.gz",
194  "--gzip=gzipfoo",
195  "--help",
196  "--ignore-map-settings",
197  "--label=labelfoo",
198  "--load=loadfoo",
199  "--log-error=errfoo,errbar/*",
200  "--log-warning=warnfoo,warnfoo/bar",
201  "--log-info=infofoo",
202  "--log-debug=dbgfoo,dbgbar,dbg/foo/bar/baz",
203  "--logdomains=filterfoo",
204  "--max-fps=100",
205  "--multiplayer",
206  "--new-widgets",
207  "--nocache",
208  "--nodelay",
209  "--nomusic",
210  "--nosound",
211  "--nogui",
212  "--parm=7:parmfoo:valfoo",
213  "--parm=8:parmbar:valbar",
214  "--path",
215  "--preprocess", "preppathfoo", "preptargfoo",
216  "--preprocess-defines=DEFFOO,DEFBAR",
217  "--preprocess-input-macros=inmfoo",
218  "--preprocess-output-macros=outmfoo",
219  "--resolution=800x600",
220  "--rng-seed=1234",
221  "--scenario=scenfoo",
222  "--screenshot", "mapfoo", "outssfoo",
223  "--side=9:sidefoo",
224  "--side=10:sidebar",
225  "--server=servfoo",
226  "--test=testfoo",
227  "--turns=42",
228  "--userconfig-dir=userconfigdirfoo",
229  "--userconfig-path",
230  "--userdata-dir=userdatadirfoo",
231  "--userdata-path",
232  "--validcache",
233  "--version",
234  "--windowed",
235  "--with-replay"};
236 
237  commandline_options co(args);
238 
239  BOOST_CHECK(co.campaign && *co.campaign == "campfoo");
240  BOOST_CHECK(co.campaign_difficulty && *co.campaign_difficulty == 16);
241  BOOST_CHECK(co.campaign_scenario && *co.campaign_scenario == "scenfoo");
242  BOOST_CHECK(co.clock);
243  BOOST_CHECK(co.data_dir && *co.data_dir == "datadirfoo");
244  BOOST_CHECK(co.data_path);
245  BOOST_CHECK(co.debug);
246 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
247  BOOST_CHECK(co.debug_dot_domain && *co.debug_dot_domain == "ddfoo");
248  BOOST_CHECK(co.debug_dot_level && *co.debug_dot_level == "dlfoo");
249 #endif
250  BOOST_CHECK(co.editor && *co.editor == "editfoo");
251  BOOST_CHECK(co.fps);
252  BOOST_CHECK(co.fullscreen);
253  BOOST_CHECK(co.gunzip && *co.gunzip == "gunzipfoo.gz");
254  BOOST_CHECK(co.gzip && *co.gzip == "gzipfoo");
255  BOOST_CHECK(co.help);
256  BOOST_CHECK(co.load && *co.load == "loadfoo");
257  BOOST_CHECK(co.log);
258  BOOST_CHECK(co.log->size()==8);
259  BOOST_CHECK(co.log->at(0).get<0>() == 0 && co.log->at(1).get<0>() == 0);
260  BOOST_CHECK(co.log->at(0).get<1>() == "errfoo" && co.log->at(1).get<1>() == "errbar/*");
261  BOOST_CHECK(co.log->at(2).get<0>() == 1 && co.log->at(3).get<0>() == 1);
262  BOOST_CHECK(co.log->at(2).get<1>() == "warnfoo" && co.log->at(3).get<1>() == "warnfoo/bar");
263  BOOST_CHECK(co.log->at(4).get<0>() == 2);
264  BOOST_CHECK(co.log->at(4).get<1>() == "infofoo");
265  BOOST_CHECK(co.log->at(5).get<0>() == 3 && co.log->at(6).get<0>() == 3 && co.log->at(7).get<0>() == 3);
266  BOOST_CHECK(co.log->at(5).get<1>() == "dbgfoo" && co.log->at(6).get<1>() == "dbgbar" && co.log->at(7).get<1>() == "dbg/foo/bar/baz");
267  BOOST_CHECK(co.logdomains && *co.logdomains == "filterfoo");
268  BOOST_CHECK(co.multiplayer);
269  BOOST_CHECK(co.multiplayer_ai_config);
270  BOOST_CHECK(co.multiplayer_ai_config->size() == 2);
271  BOOST_CHECK(co.multiplayer_ai_config->at(0).get<0>() == 1 && co.multiplayer_ai_config->at(0).get<1>() == "aifoo");
272  BOOST_CHECK(co.multiplayer_ai_config->at(1).get<0>() == 2 && co.multiplayer_ai_config->at(1).get<1>() == "aibar");
273  BOOST_CHECK(co.multiplayer_algorithm);
274  BOOST_CHECK(co.multiplayer_algorithm->at(0).get<0>() == 3 && co.multiplayer_algorithm->at(0).get<1>() == "algfoo");
275  BOOST_CHECK(co.multiplayer_algorithm->at(1).get<0>() == 4 && co.multiplayer_algorithm->at(1).get<1>() == "algbar");
276  BOOST_CHECK(co.multiplayer_controller);
277  BOOST_CHECK(co.multiplayer_controller->at(0).get<0>() == 5 && co.multiplayer_controller->at(0).get<1>() == "confoo");
278  BOOST_CHECK(co.multiplayer_controller->at(1).get<0>() == 6 && co.multiplayer_controller->at(1).get<1>() == "conbar");
279  BOOST_CHECK(co.multiplayer_era && *co.multiplayer_era == "erafoo");
280  BOOST_CHECK(co.multiplayer_exit_at_end);
281  BOOST_CHECK(co.multiplayer_ignore_map_settings);
282  BOOST_CHECK(co.multiplayer_label && *co.multiplayer_label == "labelfoo");
283  BOOST_CHECK(co.multiplayer_parm);
284  BOOST_CHECK(co.multiplayer_parm->at(0).get<0>() == 7 && co.multiplayer_parm->at(0).get<1>() == "parmfoo" && co.multiplayer_parm->at(0).get<2>() == "valfoo");
285  BOOST_CHECK(co.multiplayer_parm->at(1).get<0>() == 8 && co.multiplayer_parm->at(1).get<1>() == "parmbar" && co.multiplayer_parm->at(1).get<2>() == "valbar");
286  BOOST_CHECK(co.multiplayer_scenario && *co.multiplayer_scenario == "scenfoo");
287  BOOST_CHECK(co.multiplayer_side);
288  BOOST_CHECK(co.multiplayer_side->size() == 2);
289  BOOST_CHECK(co.multiplayer_side->at(0).get<0>() == 9 && co.multiplayer_side->at(0).get<1>() == "sidefoo");
290  BOOST_CHECK(co.multiplayer_side->at(1).get<0>() == 10 && co.multiplayer_side->at(1).get<1>() == "sidebar");
291  BOOST_CHECK(co.multiplayer_turns && *co.multiplayer_turns == "42");
292  BOOST_CHECK(co.max_fps && *co.max_fps == 100);
293  BOOST_CHECK(co.nocache);
294  BOOST_CHECK(co.nodelay);
295  BOOST_CHECK(co.nogui);
296  BOOST_CHECK(co.nomusic);
297  BOOST_CHECK(co.nosound);
298  BOOST_CHECK(co.new_widgets);
299  BOOST_CHECK(co.path);
300  BOOST_CHECK(co.preprocess && co.preprocess_path && co.preprocess_target);
301  BOOST_CHECK(*co.preprocess_path == "preppathfoo" && *co.preprocess_target == "preptargfoo");
302  BOOST_CHECK(co.preprocess_defines && co.preprocess_defines->size() == 2);
303  BOOST_CHECK(co.preprocess_defines->at(0) == "DEFFOO" && co.preprocess_defines->at(1) == "DEFBAR");
304  BOOST_CHECK(co.preprocess_input_macros && *co.preprocess_input_macros == "inmfoo");
305  BOOST_CHECK(co.preprocess_output_macros && *co.preprocess_output_macros == "outmfoo");
306  BOOST_CHECK(co.resolution);
307  BOOST_CHECK(co.resolution->get<0>() == 800 && co.resolution->get<1>() == 600);
308  BOOST_CHECK(co.rng_seed && *co.rng_seed == 1234);
309  BOOST_CHECK(co.server && *co.server == "servfoo");
310  BOOST_CHECK(co.screenshot && co.screenshot_map_file && co.screenshot_output_file);
311  BOOST_CHECK(*co.screenshot_map_file == "mapfoo" && *co.screenshot_output_file == "outssfoo");
312  BOOST_CHECK(co.test && *co.test == "testfoo");
313  BOOST_CHECK(co.userconfig_dir && *co.userconfig_dir == "userconfigdirfoo");
314  BOOST_CHECK(co.userconfig_path);
315  BOOST_CHECK(co.userdata_dir && *co.userdata_dir == "userdatadirfoo");
316  BOOST_CHECK(co.userdata_path);
317  BOOST_CHECK(co.validcache);
318  BOOST_CHECK(co.version);
319  BOOST_CHECK(co.windowed);
320  BOOST_CHECK(co.with_replay);
321 }
322 
323 BOOST_AUTO_TEST_CASE (test_positional_options)
324 {
325  std::vector<std::string> args = {
326  "wesnoth",
327  "datadirfoo"};
328 
329  commandline_options co(args);
330 
331  BOOST_CHECK(!co.campaign);
332  BOOST_CHECK(!co.campaign_difficulty);
333  BOOST_CHECK(!co.campaign_scenario);
334  BOOST_CHECK(!co.clock);
335  BOOST_CHECK(co.data_dir && *co.data_dir == "datadirfoo");
336  BOOST_CHECK(!co.data_path);
337  BOOST_CHECK(!co.debug);
338 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
339  BOOST_CHECK(!co.debug_dot_domain);
340  BOOST_CHECK(!co.debug_dot_level);
341 #endif
342  BOOST_CHECK(!co.editor);
343  BOOST_CHECK(!co.fps);
344  BOOST_CHECK(!co.fullscreen);
345  BOOST_CHECK(!co.gunzip);
346  BOOST_CHECK(!co.gzip);
347  BOOST_CHECK(!co.help);
348  BOOST_CHECK(!co.load);
349  BOOST_CHECK(!co.log);
350  BOOST_CHECK(!co.logdomains);
351  BOOST_CHECK(!co.multiplayer);
352  BOOST_CHECK(!co.multiplayer_ai_config);
353  BOOST_CHECK(!co.multiplayer_algorithm);
354  BOOST_CHECK(!co.multiplayer_controller);
355  BOOST_CHECK(!co.multiplayer_era);
356  BOOST_CHECK(!co.multiplayer_exit_at_end);
357  BOOST_CHECK(!co.multiplayer_ignore_map_settings);
358  BOOST_CHECK(!co.multiplayer_label);
359  BOOST_CHECK(!co.multiplayer_parm);
360  BOOST_CHECK(!co.multiplayer_scenario);
361  BOOST_CHECK(!co.multiplayer_side);
362  BOOST_CHECK(!co.multiplayer_turns);
363  BOOST_CHECK(!co.max_fps);
364  BOOST_CHECK(!co.nocache);
365  BOOST_CHECK(!co.nodelay);
366  BOOST_CHECK(!co.nogui);
367  BOOST_CHECK(!co.nomusic);
368  BOOST_CHECK(!co.nosound);
369  BOOST_CHECK(!co.new_widgets);
370  BOOST_CHECK(!co.path);
371  BOOST_CHECK(!co.preprocess);
372  BOOST_CHECK(!co.preprocess_defines);
373  BOOST_CHECK(!co.preprocess_input_macros);
374  BOOST_CHECK(!co.preprocess_output_macros);
375  BOOST_CHECK(!co.preprocess_path);
376  BOOST_CHECK(!co.preprocess_target);
377  BOOST_CHECK(!co.resolution);
378  BOOST_CHECK(!co.rng_seed);
379  BOOST_CHECK(!co.server);
380  BOOST_CHECK(!co.screenshot);
381  BOOST_CHECK(!co.screenshot_map_file);
382  BOOST_CHECK(!co.screenshot_output_file);
383  BOOST_CHECK(!co.test);
384  BOOST_CHECK(!co.userconfig_dir);
385  BOOST_CHECK(!co.userconfig_path);
386  BOOST_CHECK(!co.userdata_dir);
387  BOOST_CHECK(!co.userdata_path);
388  BOOST_CHECK(!co.validcache);
389  BOOST_CHECK(!co.version);
390  BOOST_CHECK(!co.windowed);
391  BOOST_CHECK(!co.with_replay);
392 }
393 
394 BOOST_AUTO_TEST_SUITE_END()
boost::optional< std::vector< boost::tuple< unsigned int, std::string, std::string > > > multiplayer_parm
Non-empty if –parm was given on the command line. Vector of pairs (side number, parm name...
bool nogui
True if –nogui was given on the command line. Disables GUI.
boost::optional< std::string > multiplayer_turns
Non-empty if –turns was given on the command line. Dependent on –multiplayer.
boost::optional< std::vector< boost::tuple< unsigned int, std::string > > > multiplayer_algorithm
Non-empty if –algorithm was given on the command line. Vector of pairs (side number, value). Dependent on –multiplayer.
bool userdata_path
True if –userdata-path was given on the command line. Prints path to user data directory and exits...
boost::optional< std::string > multiplayer_scenario
Non-empty if –scenario was given on the command line. Dependent on –multiplayer.
bool multiplayer_ignore_map_settings
True if –ignore-map-settings was given at the command line. Do not use map settings.
boost::optional< std::string > gunzip
Non-empty if –gunzip was given on the command line. Uncompresses a .gz file and exits.
boost::optional< std::string > campaign_scenario
Non-empty if –campaign-scenario was given on the command line. Chooses starting scenario in the camp...
boost::optional< int > max_fps
Max FPS specified by –max-fps option.
boost::optional< unsigned int > rng_seed
RNG seed specified by –rng-seed option. Initializes RNG with given seed.
bool fps
True if –fps was given on the command line. Shows number of fps.
BOOST_AUTO_TEST_SUITE(test_map_location)
boost::optional< std::string > data_dir
Non-empty if –data-dir was given on the command line. Sets the config dir to the specified one...
boost::optional< std::vector< boost::tuple< int, std::string > > > log
Contains parsed arguments of –log-* (e.g.
boost::optional< std::string > multiplayer_era
Non-empty if –era was given on the command line. Dependent on –multiplayer.
boost::optional< std::string > multiplayer_label
Non-empty if –label was given on the command line. Dependent on –multiplayer.
boost::optional< std::string > load
Non-empty if –load was given on the command line. Savegame specified to load after start...
bool preprocess
True if –preprocess was given on the command line. Starts Wesnoth in preprocessor-only mode...
bool with_replay
True if –with-replay was given on the command line. Shows replay of the loaded file.
boost::optional< std::string > userconfig_dir
Non-empty if –userconfig-dir was given on the command line. Sets the user config dir to the specifie...
boost::optional< std::vector< boost::tuple< unsigned int, std::string > > > multiplayer_controller
Non-empty if –controller was given on the command line. Vector of pairs (side number, controller). Dependent on –multiplayer.
bool nodelay
True if –nodelay was given on the command line.
boost::optional< std::string > logdomains
Non-empty if –logdomains was given on the command line. Prints possible logdomains filtered by given...
bool windowed
True if –windowed was given on the command line. Starts Wesnoth in windowed mode.
boost::optional< std::string > editor
Non-empty if –editor was given on the command line. Goes directly into editor. If string is longer t...
boost::optional< std::string > userdata_dir
Non-empty if –userdata-dir was given on the command line. Sets the user data dir to the specified on...
boost::optional< std::string > gzip
Non-empty if –gzip was given on the command line. Compresses a file to .gz and exits.
boost::optional< std::string > preprocess_output_macros
Non-empty if –preprocess-output-macros was given on the command line. Outputs all preprocessed macro...
boost::optional< std::string > test
Non-empty if –test was given on the command line. Goes directly into test mode, into a scenario...
bool multiplayer
True if –multiplayer was given on the command line. Goes directly into multiplayer mode...
bool clock
True if –clock was given on the command line. Enables.
bool userconfig_path
True if –userconfig-path was given on the command line. Prints path to user config directory and exi...
bool path
True if –path was given on the command line. Prints the path to data directory and exits...
boost::optional< int > campaign_difficulty
Non-empty if –campaign-difficulty was given on the command line. Numerical difficulty of the campaig...
bool nomusic
True if –nomusic was given on the command line. Disables music.
boost::optional< std::string > preprocess_target
Target (output) path that was given to the –preprocess option.
bool debug
True if –debug was given on the command line. Enables debug mode.
bool nocache
True if –nocache was given on the command line. Disables cache usage.
boost::optional< std::string > screenshot_map_file
Map file to make a screenshot of. First parameter given after –screenshot.
boost::optional< std::string > preprocess_path
Path to parse that was given to the –preprocess option.
bool new_widgets
True if –new-widgets was given on the command line. Hidden option to enable the new widget toolkit...
boost::optional< std::vector< boost::tuple< unsigned int, std::string > > > multiplayer_ai_config
Non-empty if –ai-config was given on the command line. Vector of pairs (side number, value). Dependent on –multiplayer.
boost::optional< std::vector< boost::tuple< unsigned int, std::string > > > multiplayer_side
Non-empty if –side was given on the command line. Vector of pairs (side number, faction id)...
bool data_path
True if –data-path was given on the command line. Prints path to data directory and exits...
bool screenshot
True if –screenshot was given on the command line. Starts Wesnoth in screenshot mode.
bool version
True if –version was given on the command line. Prints version and exits.
boost::optional< std::string > screenshot_output_file
Output file to put screenshot in. Second parameter given after –screenshot.
bool fullscreen
True if –fullscreen was given on the command line. Starts Wesnoth in fullscreen mode.
bool validcache
True if –validcache was given on the command line. Makes Wesnoth assume the cache is valid...
boost::optional< std::vector< std::string > > preprocess_defines
Defines that were given to the –preprocess option.
bool nosound
True if –nosound was given on the command line. Disables sound.
boost::optional< std::string > preprocess_input_macros
Non-empty if –preprocess-input-macros was given on the command line. Specifies a file that contains ...
bool multiplayer_exit_at_end
True if –exit-at-and was given on the command line. Dependent on –multiplayer.
boost::optional< std::string > campaign
Non-empty if –campaign was given on the command line. ID of the campaign we want to start...
BOOST_AUTO_TEST_CASE(test_empty_options)
bool help
True if –help was given on the command line. Prints help and exits.
boost::optional< std::string > server
Non-empty if –server was given on the command line. Connects Wesnoth to specified server...
boost::optional< boost::tuple< int, int > > resolution
Pair of AxB values specified after –resolution. Changes Wesnoth resolution.