Added html output for easier viewing of the errors.

devs/tasn/jenkins
Tom Hacohen 10 years ago
parent feac36f368
commit 11cc575120
  1. 57
      src/bin/exactness.c

@ -168,27 +168,54 @@ main(int argc, char *argv[])
exactness_ctx.tests_executed,
eina_inlist_count(EINA_INLIST_GET(test_list)));
if (exactness_ctx.errors)
if (exactness_ctx.errors || exactness_ctx.compare_errors)
{
Eina_List *itr;
List_Entry *ent;
printf("List of tests that failed execution:\n");
EINA_LIST_FOREACH(exactness_ctx.errors, itr, ent)
FILE *report_file;
char report_filename[EXACTNESS_PATH_MAX] = "";
/* Generate the filename. */
snprintf(report_filename, EXACTNESS_PATH_MAX,
"%s/%s/errors.html",
exactness_config.dest_dir, CURRENT_SUBDIR);
report_file = fopen(report_filename, "w+");
printf("%s %p\n", report_filename, report_file);
fprintf(report_file,
"<html><head><title>Exactness report</title></head><body>");
if (exactness_ctx.errors)
{
printf("\t* %s\n", ent->name);
fprintf(report_file,
"<h1>Tests that failed execution:</h1><br/><ul>");
Eina_List *itr;
List_Entry *ent;
printf("List of tests that failed execution:\n");
EINA_LIST_FOREACH(exactness_ctx.errors, itr, ent)
{
printf("\t* %s\n", ent->name);
fprintf(report_file, "<li>%s</li>", ent->name);
}
fprintf(report_file, "</ul>");
}
ret = 1;
}
if (exactness_ctx.compare_errors)
{
char *test_name;
printf("List of images that failed comparison:\n");
EINA_LIST_FREE(exactness_ctx.compare_errors, test_name)
if (exactness_ctx.compare_errors)
{
printf("\t* %s\n", test_name);
free(test_name);
fprintf(report_file,
"<h1>Images that failed comparison: (Original, Current, Diff)</h1><br/><ul>");
char *test_name;
printf("List of images that failed comparison:\n");
EINA_LIST_FREE(exactness_ctx.compare_errors, test_name)
{
printf("\t* %s\n", test_name);
fprintf(report_file, "<li><h2>%s</h2> <img src='../orig/%s' /> <img src='%s' /> <img src='comp_%s' /></li>", test_name, test_name, test_name, test_name);
free(test_name);
}
fprintf(report_file, "</ul>");
}
fprintf(report_file,
"</body></html>");
printf("Report html: %s\n", report_filename);
ret = 1;
}

Loading…
Cancel
Save