CommandLine parser initial
This commit is contained in:
parent
3846b91662
commit
f5cab30f21
11 changed files with 592 additions and 22 deletions
23
CommandLine/tests/TestCommandLine.cpp
Normal file
23
CommandLine/tests/TestCommandLine.cpp
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#include "Tests.hpp"
|
||||
|
||||
using namespace tp;
|
||||
|
||||
static CommandLine createCmdLine() {
|
||||
CommandLine cmd({
|
||||
{ "bool", CommandLine::Arg::BOOL },
|
||||
{ "int", CommandLine::Arg::INT },
|
||||
{ "string", CommandLine::Arg::STR },
|
||||
{ "float", CommandLine::Arg::FLOAT },
|
||||
});
|
||||
return cmd;
|
||||
}
|
||||
|
||||
TEST_DEF_STATIC(Simple) {
|
||||
auto cmd = createCmdLine();
|
||||
const char* args[] = { "false", "2", "'str'", "-0.15" };
|
||||
cmd.parse(4, args, true, 0);
|
||||
}
|
||||
|
||||
TEST_DEF(CommandLine) {
|
||||
testSimple();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue