mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 22:22:17 +00:00
Initial preprocessor procedure option for testsuite implemented.
This commit is contained in:
parent
ea0e2c47d5
commit
79282bfee0
1 changed files with 41 additions and 23 deletions
64
test.c
64
test.c
|
@ -894,32 +894,41 @@ bool task_execute(task_template_t *tmpl, char ***line) {
|
||||||
char buffer[4096];
|
char buffer[4096];
|
||||||
memset (buffer,0,sizeof(buffer));
|
memset (buffer,0,sizeof(buffer));
|
||||||
|
|
||||||
/*
|
if (strcmp(tmpl->proceduretype, "-pp")) {
|
||||||
* Drop the execution flags for the QCVM if none where
|
/*
|
||||||
* actually specified.
|
* Drop the execution flags for the QCVM if none where
|
||||||
*/
|
* actually specified.
|
||||||
if (!strcmp(tmpl->executeflags, "$null")) {
|
*/
|
||||||
snprintf(buffer, sizeof(buffer), "%s %s",
|
if (!strcmp(tmpl->executeflags, "$null")) {
|
||||||
task_bins[TASK_EXECUTE],
|
snprintf(buffer, sizeof(buffer), "%s %s",
|
||||||
tmpl->tempfilename
|
task_bins[TASK_EXECUTE],
|
||||||
|
tmpl->tempfilename
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
snprintf(buffer, sizeof(buffer), "%s %s %s",
|
||||||
|
task_bins[TASK_EXECUTE],
|
||||||
|
tmpl->executeflags,
|
||||||
|
tmpl->tempfilename
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
util_debug("TEST", "executing qcvm: `%s` [%s]\n",
|
||||||
|
tmpl->description,
|
||||||
|
buffer
|
||||||
);
|
);
|
||||||
|
|
||||||
|
execute = popen(buffer, "r");
|
||||||
|
if (!execute)
|
||||||
|
return false;
|
||||||
} else {
|
} else {
|
||||||
snprintf(buffer, sizeof(buffer), "%s %s %s",
|
/*
|
||||||
task_bins[TASK_EXECUTE],
|
* we're preprocessing, which means we need to read int
|
||||||
tmpl->executeflags,
|
* the produced file and do some really weird shit.
|
||||||
tmpl->tempfilename
|
*/
|
||||||
);
|
if (!(execute = fs_file_open(tmpl->tempfilename, "r")))
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
util_debug("TEST", "executing qcvm: `%s` [%s]\n",
|
|
||||||
tmpl->description,
|
|
||||||
buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
execute = popen(buffer, "r");
|
|
||||||
if (!execute)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now lets read the lines and compare them to the matches we expect
|
* Now lets read the lines and compare them to the matches we expect
|
||||||
* and handle accordingly.
|
* and handle accordingly.
|
||||||
|
@ -965,7 +974,12 @@ bool task_execute(task_template_t *tmpl, char ***line) {
|
||||||
mem_d(data);
|
mem_d(data);
|
||||||
data = NULL;
|
data = NULL;
|
||||||
}
|
}
|
||||||
pclose(execute);
|
|
||||||
|
if (strcmp(tmpl->proceduretype, "-pp"))
|
||||||
|
pclose(execute);
|
||||||
|
else
|
||||||
|
fs_file_close(execute);
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1055,6 +1069,10 @@ void task_schedualize(size_t *pad) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!strcmp(task_tasks[i].tmpl->proceduretype, "-pp")) {
|
||||||
|
/* this is a pain */
|
||||||
|
}
|
||||||
|
|
||||||
if (!execute) {
|
if (!execute) {
|
||||||
con_out("succeeded: `%s` %*s %*s\n",
|
con_out("succeeded: `%s` %*s %*s\n",
|
||||||
task_tasks[i].tmpl->description,
|
task_tasks[i].tmpl->description,
|
||||||
|
|
Loading…
Reference in a new issue