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);
45 BOOST_CHECK(!co.
gzip);
46 BOOST_CHECK(!co.
help);
47 BOOST_CHECK(!co.
load);
64 BOOST_CHECK(!co.
nogui);
81 BOOST_CHECK(!co.
test);
94 std::vector<std::string> args {
99 "--preprocess-output-macros",
108 BOOST_CHECK(!co.
clock);
111 BOOST_CHECK(!co.
debug);
112 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
113 BOOST_CHECK(!co.debug_dot_domain);
114 BOOST_CHECK(!co.debug_dot_level);
117 BOOST_CHECK(!co.
fps);
120 BOOST_CHECK(!co.
gzip);
121 BOOST_CHECK(!co.
help);
122 BOOST_CHECK(!co.
load);
123 BOOST_CHECK(!co.
log);
140 BOOST_CHECK(!co.
nogui);
156 BOOST_CHECK(co.
test && co.
test->empty());
169 std::vector<std::string> args {
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 "--campaign-skip-story",
180 "--controller=5:confoo",
181 "--controller=6:conbar",
182 "--data-dir=datadirfoo",
185 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
186 "--debug-dot-domain=ddfoo",
187 "--debug-dot-level=dlfoo",
194 "--gunzip=gunzipfoo.gz",
197 "--ignore-map-settings",
200 "--log-error=errfoo,errbar/*",
201 "--log-warning=warnfoo,warnfoo/bar",
202 "--log-info=infofoo",
203 "--log-debug=dbgfoo,dbgbar,dbg/foo/bar/baz",
204 "--logdomains=filterfoo",
213 "--parm=7:parmfoo:valfoo",
214 "--parm=8:parmbar:valbar",
215 "--preprocess",
"preppathfoo",
"preptargfoo",
216 "--preprocess-defines=DEFFOO,DEFBAR",
217 "--preprocess-input-macros=inmfoo",
218 "--preprocess-output-macros=outmfoo",
219 "--resolution=800x600",
221 "--scenario=scenfoo",
222 "--screenshot",
"mapfoo",
"outssfoo",
228 "--userconfig-dir=userconfigdirfoo",
230 "--userdata-dir=userdatadirfoo",
243 BOOST_CHECK(co.
clock);
246 BOOST_CHECK(co.
debug);
247 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
248 BOOST_CHECK(co.debug_dot_domain && *co.debug_dot_domain ==
"ddfoo");
249 BOOST_CHECK(co.debug_dot_level && *co.debug_dot_level ==
"dlfoo");
255 BOOST_CHECK(co.
gzip && *co.
gzip ==
"gzipfoo");
256 BOOST_CHECK(co.
help);
257 BOOST_CHECK(co.
load && *co.
load ==
"loadfoo");
259 BOOST_CHECK(co.
log->size()==8);
260 BOOST_CHECK(co.
log->at(0).first == 0 && co.
log->at(1).first == 0);
261 BOOST_CHECK(co.
log->at(0).second ==
"errfoo" && co.
log->at(1).second ==
"errbar/*");
262 BOOST_CHECK(co.
log->at(2).first == 1 && co.
log->at(3).first == 1);
263 BOOST_CHECK(co.
log->at(2).second ==
"warnfoo" && co.
log->at(3).second ==
"warnfoo/bar");
264 BOOST_CHECK(co.
log->at(4).first == 2);
265 BOOST_CHECK(co.
log->at(4).second ==
"infofoo");
266 BOOST_CHECK(co.
log->at(5).first == 3 && co.
log->at(6).first == 3 && co.
log->at(7).first == 3);
267 BOOST_CHECK(co.
log->at(5).second ==
"dbgfoo" && co.
log->at(6).second ==
"dbgbar" && co.
log->at(7).second ==
"dbg/foo/bar/baz");
296 BOOST_CHECK(co.
nogui);
312 BOOST_CHECK(co.
test && *co.
test ==
"testfoo");
325 std::vector<std::string> args {
335 BOOST_CHECK(!co.
clock);
338 BOOST_CHECK(!co.
debug);
339 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
340 BOOST_CHECK(!co.debug_dot_domain);
341 BOOST_CHECK(!co.debug_dot_level);
344 BOOST_CHECK(!co.
fps);
347 BOOST_CHECK(!co.
gzip);
348 BOOST_CHECK(!co.
help);
349 BOOST_CHECK(!co.
load);
350 BOOST_CHECK(!co.
log);
367 BOOST_CHECK(!co.
nogui);
383 BOOST_CHECK(!co.
test);
394 BOOST_AUTO_TEST_SUITE_END()
std::optional< std::string > preprocess_input_macros
Non-empty if –preprocess-input-macros was given on the command line.
bool nogui
True if –nogui was given on the command line.
std::optional< std::string > server
Non-empty if –server was given on the command line.
std::optional< std::string > multiplayer_turns
Non-empty if –turns was given on the command line.
bool windowed
True if –windowed was given on the command line.
std::optional< std::string > preprocess_path
Path to parse that was given to the –preprocess option.
std::optional< std::vector< std::pair< unsigned int, std::string > > > multiplayer_controller
Non-empty if –controller was given on the command line.
std::optional< std::vector< std::pair< int, std::string > > > log
Contains parsed arguments of –log-* (e.g.
std::optional< std::string > multiplayer_label
Non-empty if –label was given on the command line.
bool multiplayer_exit_at_end
True if –exit-at-and was given on the command line.
std::optional< std::string > userdata_dir
Non-empty if –userdata-dir was given on the command line.
std::optional< std::string > preprocess_output_macros
Non-empty if –preprocess-output-macros was given on the command line.
std::optional< std::string > logdomains
Non-empty if –logdomains was given on the command line.
std::optional< int > campaign_difficulty
Non-empty if –campaign-difficulty was given on the command line.
std::optional< std::vector< std::pair< unsigned int, std::string > > > multiplayer_algorithm
Non-empty if –algorithm was given on the command line.
std::optional< std::string > multiplayer_scenario
Non-empty if –scenario was given on the command line.
std::optional< std::string > multiplayer_era
Non-empty if –era was given on the command line.
std::optional< std::string > campaign_scenario
Non-empty if –campaign-scenario was given on the command line.
bool debug
True if –debug was given on the command line.
std::optional< unsigned int > rng_seed
RNG seed specified by –rng-seed option.
bool nosound
True if –nosound was given on the command line.
bool multiplayer
True if –multiplayer was given on the command line.
bool userconfig_path
True if –userconfig-path was given on the command line.
std::optional< std::vector< std::tuple< unsigned int, std::string, std::string > > > multiplayer_parm
Non-empty if –parm was given on the command line.
std::optional< std::vector< std::pair< unsigned int, std::string > > > multiplayer_side
Non-empty if –side was given on the command line.
std::optional< std::vector< std::pair< unsigned int, std::string > > > multiplayer_ai_config
Non-empty if –ai-config was given on the command line.
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.
bool nodelay
True if –nodelay was given on the command line.
std::optional< std::string > gunzip
Non-empty if –gunzip was given on the command line.
bool new_widgets
True if –new-widgets was given on the command line.
bool preprocess
True if –preprocess 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.
std::optional< std::string > load
Non-empty if –load was given on the command line.
std::optional< std::string > campaign
Non-empty if –campaign was given on the command line.
bool fps
True if –fps was given on the command line.
std::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.
std::optional< std::string > data_dir
Non-empty if –data-dir was given on the command line.
bool multiplayer_ignore_map_settings
True if –ignore-map-settings was given at the command line.
std::optional< std::vector< std::string > > preprocess_defines
Defines that were given to the –preprocess option.
bool fullscreen
True if –fullscreen was given on the command line.
std::optional< std::string > test
Non-empty if –test was given on the command line.
std::optional< std::string > userconfig_dir
Non-empty if –userconfig-dir was given on the command line.
std::optional< int > max_fps
Max FPS specified by –max-fps option.
std::optional< std::pair< int, int > > resolution
Pair of AxB values specified after –resolution.
bool help
True if –help was given on the command line.
bool nocache
True if –nocache was given on the command line.
std::optional< std::string > screenshot_map_file
Map file to make a screenshot of.
std::optional< std::string > screenshot_output_file
Output file to put screenshot in.
std::optional< std::string > gzip
Non-empty if –gzip was given on the command line.
std::optional< std::string > editor
Non-empty if –editor was given on the command line.
BOOST_AUTO_TEST_CASE(test_empty_options)
BOOST_AUTO_TEST_SUITE(filesystem)