}
/* Cleanup the place */
- xbt_dynar_free(&bg_jobs);
+ // xbt_dynar_free(&bg_jobs);
exit(exitcode);
}
if (rctx->cmd)
rctx_start();
- if (!strncmp(line,"set timeout ",strlen("set timeout "))) {
- timeout_value=atoi(line+strlen("set timeout"));
+ if (!strncmp(line,"timeout no",strlen("timeout no"))) {
+ VERB1("[%s] (disable timeout)", filepos);
+ timeout_value = -1;
+ } else if (!strncmp(line,"timeout ",strlen("timeout "))) {
+ timeout_value=atoi(line+strlen("timeout"));
VERB2("[%s] (new timeout value: %d)",
filepos,timeout_value);
close(child_out[1]);
rctx->child_from = child_out[0];
- rctx->end_time = time(NULL) + timeout_value;
+ if (timeout_value > 0)
+ rctx->end_time = time(NULL) + timeout_value;
+ else
+ rctx->end_time = -1;
rctx->reader_done = 0;
rctx->reader = xbt_thread_create(thread_reader,(void*)rctx);
rctx->cmd);
/* Wait for the child to die or the timeout to happen (or an armageddon to happen) */
- while (!rctx->interrupted && !rctx->reader_done && rctx->end_time >= now) {
+ while (!rctx->interrupted && !rctx->reader_done && (rctx->end_time <0 ||rctx->end_time >= now)) {
usleep(100);
now = time(NULL);
}
xbt_mutex_lock(rctx->interruption);
- if (!rctx->interrupted && rctx->end_time < now) {
+ if (!rctx->interrupted && rctx->end_time > 0 && rctx->end_time < now) {
INFO1("<%s> timeouted. Kill the process.",rctx->filepos);
rctx->timeout = 1;
kill(rctx->pid,SIGTERM);
|| strcmp(rctx->output_got->data, rctx->output_wanted->data))) {
if (XBT_LOG_ISENABLED(tesh,xbt_log_priority_info)) {
char *diff= xbt_str_diff(rctx->output_wanted->data,rctx->output_got->data);
- ERROR1("Output mismatch:\n%s",
- diff);
+ ERROR2("Output of <%s> mismatch:\n%s",rctx->filepos,diff);
free(diff);
}
ERROR2("Test suite `%s': NOK (<%s> output mismatch)",
errcode=2;
} else if (rctx->output == e_output_ignore) {
- INFO0("(ignoring the output as requested)");
+ INFO1("(ignoring the output of <%s> as requested)",rctx->filepos);
} else if (rctx->output == e_output_display) {
xbt_dynar_t a = xbt_str_split(rctx->output_got->data, "\n");
char *out = xbt_str_join(a,"\n||");