/*
- * Copyright (C) 2012, 2013
+ * Copyright (C) 2012, 2013, 2014, 2015
* Dale Weiler
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
while (*line != '\0' && *line != ' ' &&
*line != '\t' && *line != '\n') line++;
}
- vec_push(argv, '\0');
+ vec_push(argv, (char *)0);
}
return status;
}
#else
+ #include <sys/stat.h>
typedef struct {
fs_file_t *handles[3];
char name_err[L_tmpnam];
char *cmd = NULL;
popen_t *open = (popen_t*)mem_a(sizeof(popen_t));
- util_tmpnam(open->name_err);
- util_tmpnam(open->name_out);
+ tmpnam(open->name_err);
+ tmpnam(open->name_out);
(void)mode; /* excluded */
const char *qcflags = NULL;
task_t task;
+ memset(&task, 0, sizeof(task));
+
found ++;
if (!tmpl) {
con_err("error compiling task template: %s\n", files->d_name);
* so we don't trample over an existing one.
*/
tmpl->tempfilename = NULL;
- util_asprintf(&tmpl->tempfilename, "%s/TMPDAT.%s", directories[i], files->d_name);
+ util_asprintf(&tmpl->tempfilename, "%s/TMPDAT.%s.dat", directories[i], files->d_name);
/*
* Additional QCFLAGS enviroment variable may be used
} else {
/* Preprocessing (qcflags mean shit all here we don't allow them) */
if (tmpl->testflags && !strcmp(tmpl->testflags, "-no-defs")) {
- util_snprintf(buf, sizeof(buf), "%s -E %s/%s -o %s",
+ util_snprintf(buf, sizeof(buf), "%s -E %s/%s %s -o %s",
task_bins[TASK_COMPILE],
directories[i],
tmpl->sourcefile,
+ tmpl->compileflags,
tmpl->tempfilename
);
} else {
- util_snprintf(buf, sizeof(buf), "%s -E %s/%s %s/%s -o %s",
+ util_snprintf(buf, sizeof(buf), "%s -E %s/%s %s/%s %s -o %s",
task_bins[TASK_COMPILE],
curdir,
defs,
directories[i],
tmpl->sourcefile,
+ tmpl->compileflags,
tmpl->tempfilename
);
}
while ((files = fs_dir_read(dir))) {
if (strstr(files->d_name, "TMP") ||
strstr(files->d_name, ".stdout") ||
- strstr(files->d_name, ".stderr"))
+ strstr(files->d_name, ".stderr") ||
+ strstr(files->d_name, ".dat"))
{
util_snprintf(buffer, sizeof(buffer), "%s/%s", curdir, files->d_name);
if (remove(buffer))
size_t i = 0;
size_t j = 0;
size_t failed = 0;
+ int status = 0;
util_snprintf(space[0], sizeof(space[0]), "%d", (int)vec_size(task_tasks));
continue;
}
- if (task_pclose(task_tasks[i].runhandles) != EXIT_SUCCESS && strcmp(task_tasks[i].tmpl->proceduretype, "-fail")) {
+ status = task_pclose(task_tasks[i].runhandles);
+ if ((!strcmp(task_tasks[i].tmpl->proceduretype, "-fail") && status == EXIT_SUCCESS)
+ || ( strcmp(task_tasks[i].tmpl->proceduretype, "-fail") && status == EXIT_FAILURE)) {
con_out("failure: `%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]),