static int register_maxnamelen(const struct tvec_state *tv)
{
const struct tvec_regdef *rd;
- int maxlen = 6, n;
+ int maxlen = 10, n;
for (rd = tv->test->regs; rd->name; rd++)
{ n = strlen(rd->name); if (n > maxlen) maxlen = n; }
fmt->prefix = prefix;
l = fmt->pfxlim = prefix + strlen(prefix);
SPLIT_RANGE(q, prefix, l); fmt->pfxtail = q;
- DPUTM(&fmt->w, q, l - q);
}
}
* need to write that. Otherwise, there's only blank stuff, which we
* accumulate in the buffer.
*
- * If we're at the start of a line here, then
+ * If we're at the start of a line here, then
*/
if (r > p) {
- if (fmt->f&FMTF_NEWL) { PUT_PFXINB; fmt->f &= ~FMTF_NEWL; }
+ if (fmt->f&FMTF_NEWL) { PUT_PREFIX; fmt->f &= ~FMTF_NEWL; }
PUT_SAVED; PUT_NONBLANK; DRESET(&fmt->w);
}
SAVE_TAIL;
/* There is at least one more segment, so we know that there'll be a line
* to output.
*/
- if (fmt->f&FMTF_NEWL) PUT_PFXINB;
- if (r > p) { PUT_SAVED; PUT_NONBLANK; }
+ if (r > p) {
+ if (fmt->f&FMTF_NEWL) PUT_PREFIX;
+ PUT_SAVED; PUT_NONBLANK;
+ } else if (fmt->f&FMTF_NEWL)
+ PUT_PFXINB;
PUT_NEWLINE; DRESET(&fmt->w);
SPLIT_SEGMENT;
* newline, so we write the initial prefix and drop the trailing blanks.
*/
while (q) {
- PUT_PREFIX; PUT_NONBLANK; PUT_NEWLINE;
+ if (r > p) { PUT_PREFIX; PUT_NONBLANK; }
+ else PUT_PFXINB;
+ PUT_NEWLINE;
SPLIT_SEGMENT;
}
if (!(~h->f&(HOF_TTY | HOF_PROGRESS))) {
h->f &= ~HOF_PROGRESS;
+ putc(' ', h->fmt.fp);
setattr(h, HA_SKIP); fputs("skipped", h->fmt.fp); setattr(h, 0);
} else {
fprintf(h->fmt.fp, "%s: ", h->tv->test->name);
fputc('\n', h->fmt.fp);
}
-static void human_report(struct tvec_output *o, const char *msg, va_list *ap)
+static void human_report(struct tvec_output *o, unsigned level,
+ const char *msg, va_list *ap)
{
struct human_output *h = (struct human_output *)o;
struct tvec_state *tv = h->tv;
human_bgroup, human_skipgroup, human_egroup,
human_btest, human_skip, human_fail, human_dumpreg, human_etest,
human_bbench, human_ebench,
- human_report, human_report,
+ human_report,
human_destroy
};
format_char(&t->fmt, '\n');
}
-static void tap_report(struct tap_output *t,
- const struct gprintf_ops *gops, void *go,
+static void tap_report(struct tvec_output *o, unsigned level,
const char *msg, va_list *ap)
{
+ struct tap_output *t = (struct tap_output *)o;
struct tvec_state *tv = t->tv;
+ const struct gprintf_ops *gops; void *go;
+ if (level >= TVLEV_ERR) {
+ fputs("Bail out! ", t->fmt.fp);
+ gops = &file_printops; go = t->fmt.fp;
+ } else {
+ gops = &tap_printops; go = t;
+ }
if (tv->infile) gprintf(gops, go, "%s:%u: ", tv->infile, tv->lno);
gprintf(gops, go, msg, ap); gops->putch(go, '\n');
}
-static void tap_error(struct tvec_output *o, const char *msg, va_list *ap)
-{
- struct tap_output *t = (struct tap_output *)o;
-
- fputs("Bail out! ", t->fmt.fp);
- tap_report(t, &file_printops, t->fmt.fp, msg, ap);
-}
-
-static void tap_notice(struct tvec_output *o, const char *msg, va_list *ap)
-{
- struct tap_output *t = (struct tap_output *)o;
-
- tap_report(t, &tap_printops, t, msg, ap);
-}
-
static void tap_destroy(struct tvec_output *o)
{
struct tap_output *t = (struct tap_output *)o;
tap_bgroup, tap_skipgroup, tap_egroup,
tap_btest, tap_skip, tap_fail, tap_dumpreg, tap_etest,
tap_bbench, tap_ebench,
- tap_error, tap_notice,
+ tap_report,
tap_destroy
};