1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#include "../src/file.h"
#include "test.h"
#include "testcnfs.h"
static unsigned scheduled;
static void schedule_solve_job_with_option (int expected, const char *opt,
const char *path) {
if (!kissat_file_readable (path)) {
tissat_warning ("Skipping unreadable '%s'", path);
return;
}
size_t len = strlen (opt) + strlen (path) + 1;
char *cmd = malloc (len);
strcpy (cmd, opt);
strcat (cmd, path);
tissat_schedule_application (expected, cmd);
free (cmd);
scheduled++;
}
static const char *simps[] = {
"",
#ifndef NOPTIONS
"--eliminateinit=0 ",
"--probeinit=0 ",
"--reduceinit=10 --rephaseinit=10 --rephaseint=10 ",
"--incremental ",
"--walkinitially ",
#endif
};
static const char **end_of_simps = simps + sizeof (simps) / sizeof *simps;
static void schedule_solve_job (int expected, const char *path) {
for (const char **p = simps; p != end_of_simps; p++) {
char combined[128];
if (tissat_big) {
for (all_tissat_options (opt)) {
sprintf (combined, *p, opt);
schedule_solve_job_with_option (expected, combined, path);
}
} else {
const char *opt = tissat_next_option (scheduled);
sprintf (combined, *p, opt);
schedule_solve_job_with_option (expected, combined, path);
}
}
}
void tissat_schedule_solve (void) {
#define CNF(EXPECTED, NAME, BIG) \
if (!BIG || tissat_big) \
schedule_solve_job (EXPECTED, "../test/cnf/" #NAME ".cnf");
CNFS
#undef CNF
}
|