62 unsigned r_active = 0;
84 for ( ; fsm < 6 && !feof (
data); tok = fgetc (
data)) {
90 fsm = (1 == fsm) ? 2 : 0;
93 fsm = (2 == fsm) ? 3 : ((4 == fsm) ? 5 : 0);
96 fsm = (3 == fsm) ? 4 : 0;
110 while (3 == fscanf (
data,
"# | (S%u) %*s | %u | %u | %*u%% |\n",
111 &r_lvl, &r_active, &r_total)) {
115 if (8 == r_lvl && 0 == strcmp (target_name,
"0.new"))
116 r_active = r_total-r_active;
117 status->
failed += r_active;
118 status->
assert += r_total;
119 if ( status->
failed < r_active
120 || status->
assert < r_total
121 || (
unsigned int)-1 == status->
assert) {
126 else if (1 < r_lvl) {
127 status->
t_warn += r_active;
128 if (status->
t_warn < r_active) {
129 status->
t_warn = (
unsigned int)-1;
168 for ( ; !feof (
data); tok = fgetc (
data)) {
174 if (1 == fsm || 2 == fsm)
186 if (4 == fsm && !feof (
data))
187 read = fscanf (
data,
"arnings = %u\n## Assertions = %u\n"
188 "## FailedAssertions = %u",
204#define DELTA_BUF_LEN 64
226check_example (
const char*
const data_dir,
char*
const out_name, FILE* fout,
229 struct stat file_info;
239 status->
assert = (unsigned)-1;
244 if (0 > stat (ref_name, &file_info)) {
258 if (0 > stat (ref_name, &file_info)) {
272 fref = fopen (ref_name,
"r");
277 warn (
"Error opening %s: %s\n", ref_name, strerror (cache));
283 while (!feof (fref) && !feof (fout)) {
290 nread [0] = fread (
buf [0], 1,
sizeof buf [0], fout);
292 warn (
"Error reading %s: %s\n", out_name, strerror (errno));
297 nread [1] = fread (
buf [1], 1,
sizeof buf [1], fref);
299 warn (
"Error reading %s: %s\n", ref_name, strerror (errno));
307 if (nread [0] != nread [1] || feof (fref) != feof (fout)) {
313 if (0 != memcmp (
buf [0],
buf [1], nread [0])) {
337 data = fopen (out_name,
"r");
341 warn (
"Error opening %s: %s\n", out_name, strerror (errno));
349 check_test (
data, status);
351 check_compat_test (
data, status);
355 check_example (options->
data_dir, out_name,
data, status);
const char * get_target()
void parse_output(const struct target_opts *options, struct target_status *status)
enum ProcessStatus status
char * reference_name(const char *data_dir, const char *subdir, const char *mode)
char * output_name(const char *target)
void warn(const char *const format,...)