Suite: add in live status per test

In this way, a program launching the suite can easily parse the messages
and update statuses in a dedicated GUI.
master
Daniel Zaoui 4 years ago
parent f7dfae4423
commit 433d843898
  1. 15
      src/bin/exactness.c

@ -105,9 +105,10 @@ _image_save(Exactness_Image *ex_img, const char *output)
ecore_evas_free(ee);
}
static void
static Eina_Bool
_file_compare(const char *orig_dir, const char *ent_name)
{
Eina_Bool result = EINA_FALSE;
Exactness_Image *img1, *img2, *imgO = NULL;
char *filename1 = alloca(strlen(orig_dir) + strlen(ent_name) + 20);
char *filename2 = alloca(strlen(_dest_dir) + strlen(ent_name) + 20);
@ -123,10 +124,12 @@ _file_compare(const char *orig_dir, const char *ent_name)
sprintf(buf, "%s/%s/comp_%s", _dest_dir, CURRENT_SUBDIR, ent_name);
_image_save(imgO, buf);
_compare_errors = eina_list_append(_compare_errors, strdup(ent_name));
result = EINA_TRUE;
}
exactness_image_free(img1);
exactness_image_free(img2);
exactness_image_free(imgO);
return result;
}
static void
@ -164,7 +167,8 @@ _run_test_compare(const List_Entry *ent)
char *origdir = alloca(strlen(_dest_dir) + 20);
const char *base_dir;
Eina_List *itr;
int n = 1;
int n = 1, nb_fails = 0;
printf("STATUS %s: COMPARE\n", ent->name);
EINA_LIST_FOREACH(_base_dirs, itr, base_dir)
{
sprintf(path, "%s/%s.exu", base_dir, ent->name);
@ -197,11 +201,15 @@ found:
if (ecore_file_exists(path))
{
sprintf(path, "%s%c%.3d.png", ent->name, SHOT_DELIMITER, n);
_file_compare(origdir, path);
if (_file_compare(origdir, path)) nb_fails++;
}
else break;
n++;
} while (EINA_TRUE);
if (!nb_fails)
printf("STATUS %s: END - SUCCESS\n", ent->name);
else
printf("STATUS %s: END - FAIL (%d/%d)\n", ent->name, nb_fails, n - 1);
}
#define CONFIG "ELM_SCALE=1 ELM_FINGER_SIZE=10"
@ -229,6 +237,7 @@ _run_command_prepare(const List_Entry *ent, char *buf)
return EINA_FALSE;
ok:
sbuf = eina_strbuf_new();
printf("STATUS %s: START\n", ent->name);
eina_strbuf_append_printf(sbuf,
"%s %s exactness_play %s %s%s %s%.*s %s%s%s-t '%s' ",
CONFIG, _wrap_command ? _wrap_command : "",

Loading…
Cancel
Save