From c53fa31a0a27206bd74f3bd724813a46f4d3419a Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Sun, 21 Apr 2013 06:23:40 +0000 Subject: [PATCH] More preprocessor testing support for the testsuite. --- test.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test.c b/test.c index d4af984..0ee3095 100644 --- a/test.c +++ b/test.c @@ -886,9 +886,10 @@ void task_destroy(void) { /* * This executes the QCVM task for a specificly compiled progs.dat * using the template passed into it for call-flags and user defined - * messages. + * messages IF the procedure type is -execute, otherwise it matches + * the preprocessor output. */ -bool task_execute(task_template_t *tmpl, char ***line) { +bool task_trymatch(task_template_t *tmpl, char ***line) { bool success = true; FILE *execute; char buffer[4096]; @@ -1022,7 +1023,8 @@ void task_schedualize(size_t *pad) { * Generate a task from thin air if it requires execution in * the QCVM. */ - execute = !!(!strcmp(task_tasks[i].tmpl->proceduretype, "-execute")); + execute = !! (!strcmp(task_tasks[i].tmpl->proceduretype, "-execute")) || + (!strcmp(task_tasks[i].tmpl->proceduretype, "-pp")); /* * We assume it compiled before we actually compiled :). On error @@ -1069,10 +1071,6 @@ void task_schedualize(size_t *pad) { continue; } - if (!strcmp(task_tasks[i].tmpl->proceduretype, "-pp")) { - /* this is a pain */ - } - if (!execute) { con_out("succeeded: `%s` %*s %*s\n", task_tasks[i].tmpl->description, @@ -1089,7 +1087,7 @@ void task_schedualize(size_t *pad) { * If we made it here that concludes the task is to be executed * in the virtual machine. */ - if (!task_execute(task_tasks[i].tmpl, &match)) { + if (!task_trymatch(task_tasks[i].tmpl, &match)) { size_t d = 0; con_err("failure: `%s` (invalid results from execution) [%s]\n", -- 2.39.2