#define TASK_COMPILE 0
#define TASK_EXECUTE 1
-#define TASK_PREPROCESS 2
/*
* Task template system:
* templates are rules for a specific test, used to create a "task" that
*/
bool task_template_generate(task_template_t *tmpl, char tag, const char *file, size_t line, char *value, size_t *pad) {
size_t desclen = 0;
+ size_t filelen = 0;
char **destval = NULL;
if (!tmpl)
pad[0] = desclen;
}
+ if ((filelen = strlen(file)) > pad[2])
+ pad[2] = filelen;
+
return true;
}
const char *task_type(task_template_t *tmpl) {
if (!strcmp(tmpl->proceduretype, "-pp"))
- return "preprocessor test";
+ return "type: preprocessor test";
if (!strcmp(tmpl->proceduretype, "-execute"))
- return "execution test";
+ return "type: execution test";
if (!strcmp(tmpl->proceduretype, "-compile"))
- return "compile test";
- if (!strcmp(tmpl->proceduretype, "-fail"))
- return "fail test";
- return "<undefined test>";
+ return "type: compile test";
+ return "type: fail test";
}
/*
}
if (!execute) {
- con_out("succeeded: `%s` %*s (%*s)\n",
+ con_out("succeeded: `%s` %*s %*s\n",
task_tasks[i].tmpl->description,
(pad[0] + pad[1] - strlen(task_tasks[i].tmpl->description)) + (strlen(task_tasks[i].tmpl->rulesfile) - pad[1]),
task_tasks[i].tmpl->rulesfile,
- (pad[0] + pad[1] - strlen(task_tasks[i].tmpl->rulesfile)) + (strlen(task_type(task_tasks[i].tmpl)) - pad[0]),
+ (pad[1] + pad[2] - strlen(task_tasks[i].tmpl->rulesfile)) + (strlen(task_type(task_tasks[i].tmpl)) - pad[2]),
task_type(task_tasks[i].tmpl)
);
mem_d(match[j]);
vec_free(match);
- con_out("succeeded: `%s` %*s\n",
+ con_out("succeeded: `%s` %*s %*s\n",
task_tasks[i].tmpl->description,
(pad[0] + pad[1] - strlen(task_tasks[i].tmpl->description)) + (strlen(task_tasks[i].tmpl->rulesfile) - pad[1]),
- task_tasks[i].tmpl->rulesfile
+ task_tasks[i].tmpl->rulesfile,
+ (pad[1] + pad[2] - strlen(task_tasks[i].tmpl->rulesfile)) + (strlen(task_type(task_tasks[i].tmpl))- pad[2]),
+ task_type(task_tasks[i].tmpl)
);
}
static const char *default_defs = "defs.qh";
size_t pad[] = {
- 0, 0
+ /* test ### [succeed/fail]: `description` [tests/template.tmpl] [type] */
+ 0, 0, 0
};
/*