Fix warnings
This commit is contained in:
45
core/cmd.c
45
core/cmd.c
@@ -184,48 +184,3 @@ bool ParseCmd(MA_Arena *arg_arena, CmdParser *p) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ./a.exe -scratch
|
||||
// ./a.exe -quick
|
||||
// ./a.exe -run_tests a.test b.test c.test
|
||||
// ./a.exe --break_on_error
|
||||
// ./a.exe -build=release
|
||||
// ./a.exe --help
|
||||
//
|
||||
void TestCmdParser() {
|
||||
char *argv[] = {
|
||||
"exe",
|
||||
"--build_scratch",
|
||||
"-tests",
|
||||
"a",
|
||||
"b",
|
||||
"c",
|
||||
"--things",
|
||||
"1234",
|
||||
"asdsa",
|
||||
"-build",
|
||||
"release",
|
||||
};
|
||||
int argc = MA_Lengthof(argv);
|
||||
|
||||
MA_Checkpoint scratch = MA_GetScratch();
|
||||
bool build_scratch = false;
|
||||
S8_List test_list = {0};
|
||||
S8_List test_things = {0};
|
||||
int build_profile = 0;
|
||||
const char *build_profiles[] = {"debug", "release"};
|
||||
int build_profiles_count = MA_Lengthof(build_profiles);
|
||||
|
||||
CmdParser p = MakeCmdParser(scratch.arena, argc, argv, "this is a test");
|
||||
AddBool(&p, &build_scratch, "build_scratch", "builds a sandbox where I experiment with things");
|
||||
AddList(&p, &test_list, "tests", "list of specific tests to run");
|
||||
AddList(&p, &test_things, "things", "list of things");
|
||||
AddEnum(&p, &build_profile, "build", "choose build profile", build_profiles, build_profiles_count);
|
||||
bool success = ParseCmd(scratch.arena, &p);
|
||||
IO_Assertf(success, "failed to parse cmd");
|
||||
IO_Assert(build_scratch);
|
||||
IO_Assert(test_list.node_count == 3);
|
||||
IO_Assert(test_things.node_count == 2);
|
||||
IO_Assert(build_profile == 1);
|
||||
MA_ReleaseScratch(scratch);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user