#80 Introduce CTest-based test harness

Open Darren Kulp kulp
Showing 3 of 9 files from the diff.

@@ -255,17 +255,15 @@
Loading
255 255
    return rc;
256 256
}
257 257
258 -
static int mark_globals(struct symbol_list *symbols, struct global_list *globals)
258 +
static void mark_globals(struct symbol_list *symbols, struct global_list *globals)
259 259
{
260 260
    struct symbol *which;
261 261
    list_foreach(global_list, g, globals)
262 262
        if ((which = symbol_find(symbols, g->name)))
263 263
            which->global = 1;
264 264
        else
265 -
            debug(0, "Symbol `%s' was marked as a global, but was not defined",
265 +
            fatal(0, "Symbol `%s' was marked as a global, but was not defined",
266 266
                    g->name);
267 -
268 -
    return 0;
269 267
}
270 268
271 269
static int check_symbols(struct symbol_list *symbols)

@@ -125,13 +125,13 @@
Loading
125 125
        assert(i->rec_count < OBJ_MAX_REC_CNT);
126 126
127 127
        if (i->rec_count == 0) {
128 -
            debug(0, "Object has no records, skipping");
128 +
            debug(1, "Object has no records, skipping");
129 129
            continue;
130 130
        }
131 131
132 132
        // TODO support more than one record per object
133 133
        if (i->rec_count > 1)
134 -
            debug(0, "Object has more than one record, only using first");
134 +
            fatal(0, "Object has more than one record (unsupported)");
135 135
136 136
        struct objmeta *meta = calloc(1, sizeof *meta);
137 137
        meta->state = s;
@@ -216,7 +216,7 @@
Loading
216 216
{
217 217
    list_foreach(obj_list, Node, ol) {
218 218
        if (!Node->obj->rec_count) {
219 -
            debug(0, "Object has no records, skipping");
219 +
            debug(1, "Object has no records, skipping");
220 220
            continue;
221 221
        }
222 222

@@ -513,13 +513,13 @@
Loading
513 513
    void *run_ud = NULL;
514 514
    rc = s->run_sim(s, &ops, &run_ud, NULL);
515 515
    if (rc < 0)
516 -
        fprintf(stderr, "Error during simulation, P=0x%08x\n", s->machine.regs[15]);
516 +
        fatal(0, "Error during simulation, P=0x%08x", s->machine.regs[15]);
517 517
518 518
    fclose(infile);
519 519
520 520
    rc = devices_teardown(s);
521 521
    if (rc != 0)
522 -
        fprintf(stderr, "Error during device teardown\n");
522 +
        fatal(0, "Error during device teardown");
523 523
524 524
    if (s->conf.debugging > 0)
525 525
        fprintf(stderr, "Instructions executed: %lu\n", s->insns_executed);

Learn more Showing 1 files with coverage changes found.

Changes in src/tld.c
-1
+1
Loading file...

25 Commits

Hiding 19 contexual commits
Hiding 4 contexual commits
-1
-2
+1
Pull Request Base Commit
Files Coverage
hw/vpi 99.1%
src -<.1% 96.5%
Project Totals (35 files) 96.6%
Loading