summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-30 16:49:05 +0200
committerStefan Schmidt <s.schmidt@samsung.com>2020-03-31 14:56:43 +0200
commit455b07ec62e42c246095d78d2506343761480a28 (patch)
treeee500d3dc2890cba6849b3da49a92fe3fb6fa574
parent624ea389c932271fffbc260ada29a2dbadd51603 (diff)
exactness: equip with ERR and CRIT
before a few commits, we had the situation that errors were overseen because the log was simply so big, that errors did not get shown properly. With this commit, exactness will simply abort if there is a real issue in the code. Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D11624
-rw-r--r--src/bin/exactness/exactness.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/bin/exactness/exactness.c b/src/bin/exactness/exactness.c
index 8338c12cd5..6599ef7741 100644
--- a/src/bin/exactness/exactness.c
+++ b/src/bin/exactness/exactness.c
@@ -20,6 +20,13 @@
20 20
21#define BUF_SIZE 1024 21#define BUF_SIZE 1024
22 22
23#define DBG(...) EINA_LOG_DOM_DBG(_log_domain, __VA_ARGS__)
24#define INF(...) EINA_LOG_DOM_INFO(_log_domain, __VA_ARGS__)
25#define ERR(...) EINA_LOG_DOM_ERR(_log_domain, __VA_ARGS__)
26#define CRI(...) EINA_LOG_DOM_CRIT(_log_domain, __VA_ARGS__)
27
28static int _log_domain = -1;
29
23typedef struct 30typedef struct
24{ 31{
25 EINA_INLIST; 32 EINA_INLIST;
@@ -63,8 +70,7 @@ _image_load(const char *filename)
63 err = evas_object_image_load_error_get(img); 70 err = evas_object_image_load_error_get(img);
64 if (err != EVAS_LOAD_ERROR_NONE) 71 if (err != EVAS_LOAD_ERROR_NONE)
65 { 72 {
66 fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n", 73 CRI("Failed to load image");
67 filename, evas_load_error_str(err));
68 return NULL; 74 return NULL;
69 } 75 }
70 76
@@ -174,7 +180,7 @@ _run_test_compare(const List_Entry *ent)
174 { 180 {
175 if (mkdir(origdir, 0744) < 0) 181 if (mkdir(origdir, 0744) < 0)
176 { 182 {
177 fprintf(stderr, "Failed to create dir %s\n", origdir); 183 CRI("Failed to create dir %s\n", origdir);
178 return; 184 return;
179 } 185 }
180 } 186 }
@@ -219,7 +225,7 @@ _run_command_prepare(const List_Entry *ent, char *buf)
219 sprintf(scn_path, "%s/%s.exu", base_dir, ent->name); 225 sprintf(scn_path, "%s/%s.exu", base_dir, ent->name);
220 if (ecore_file_exists(scn_path)) goto ok; 226 if (ecore_file_exists(scn_path)) goto ok;
221 } 227 }
222 fprintf(stderr, "Test %s not found in the provided base directories\n", ent->name); 228 CRI("Test %s not found in the provided base directories\n", ent->name);
223 return EINA_FALSE; 229 return EINA_FALSE;
224ok: 230ok:
225 sbuf = eina_strbuf_new(); 231 sbuf = eina_strbuf_new();
@@ -320,7 +326,7 @@ _job_consume()
320 326
321 if (!ecore_exe_pipe_run(buf, ECORE_EXE_TERM_WITH_PARENT, ent)) 327 if (!ecore_exe_pipe_run(buf, ECORE_EXE_TERM_WITH_PARENT, ent))
322 { 328 {
323 fprintf(stderr, "Failed executing test '%s'\n", ent->name); 329 CRI("Failed executing test '%s'\n", ent->name);
324 } 330 }
325 } 331 }
326 _next_test_to_run = EINA_INLIST_CONTAINER_GET( 332 _next_test_to_run = EINA_INLIST_CONTAINER_GET(
@@ -475,9 +481,13 @@ main(int argc, char *argv[])
475 if (!ecore_evas_init()) 481 if (!ecore_evas_init())
476 return EXIT_FAILURE; 482 return EXIT_FAILURE;
477 483
484 _log_domain = eina_log_domain_register("exactness", "red");
478 _dest_dir = "./"; 485 _dest_dir = "./";
479 _scan_objs = scan_objs; 486 _scan_objs = scan_objs;
480 487
488 eina_log_abort_on_critical_set(EINA_TRUE);
489 eina_log_abort_on_critical_level_set(EINA_LOG_LEVEL_ERR);
490
481 args = ecore_getopt_parse(&optdesc, values, argc, argv); 491 args = ecore_getopt_parse(&optdesc, values, argc, argv);
482 if (args < 0) 492 if (args < 0)
483 { 493 {