int main(int argc, char **argv) { bool succeed = false; char *redirout = (char*)stdout; char *redirerr = (char*)stderr; char *defs = NULL; con_init(); OPTS_OPTION_U16(OPTION_MEMDUMPCOLS) = 16; /* * Command line option parsing commences now We only need to support * a few things in the test suite. */ while (argc > 1) { ++argv; --argc; if (argv[0][0] == '-') { if (parsecmd("redirout", &argc, &argv, &redirout, 1, false)) continue; if (parsecmd("redirerr", &argc, &argv, &redirerr, 1, false)) continue; if (parsecmd("defs", &argc, &argv, &defs, 1, false)) continue; con_change(redirout, redirerr); if (!strcmp(argv[0]+1, "debug")) { OPTS_OPTION_BOOL(OPTION_DEBUG) = true; continue; } if (!strcmp(argv[0]+1, "memchk")) { OPTS_OPTION_BOOL(OPTION_MEMCHK) = true; continue; } if (!strcmp(argv[0]+1, "nocolor")) { con_color(0); continue; } con_err("invalid argument %s\n", argv[0]+1); return -1; } } con_change(redirout, redirerr); succeed = test_perform("tests", defs); stat_info(); return (succeed) ? EXIT_SUCCESS : EXIT_FAILURE; }
int main(void) { return test_perform(); }