forked from enlightenment/edi
Load the test results for Golang builds
This commit is contained in:
parent
5e318be09c
commit
263c9b5f1e
|
@ -152,6 +152,25 @@ void edi_consolepanel_clear()
|
||||||
_edi_test_count = _edi_test_pass = _edi_test_fail = 0;
|
_edi_test_count = _edi_test_pass = _edi_test_fail = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_edi_test_output_suite(int count, int pass, int fail)
|
||||||
|
{
|
||||||
|
char *line;
|
||||||
|
const char *format = _("Total pass %d (%d%%), fail %d)");
|
||||||
|
int linemax, percent;
|
||||||
|
|
||||||
|
linemax = strlen(format) - 6 + 30;
|
||||||
|
line = malloc(sizeof(char) * linemax);
|
||||||
|
|
||||||
|
percent = 0;
|
||||||
|
if (count > 0)
|
||||||
|
percent = (int) ((pass / (double) count) * 100);
|
||||||
|
|
||||||
|
snprintf(line, linemax, format, pass, percent, fail);
|
||||||
|
elm_code_file_line_append(_edi_test_code->file, line, strlen(line), (fail > 0) ? _EDI_SUITE_FAILED : _EDI_SUITE_PASSED);
|
||||||
|
free(line);
|
||||||
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_exe_data(void *d EINA_UNUSED, int t EINA_UNUSED, void *event_info)
|
_exe_data(void *d EINA_UNUSED, int t EINA_UNUSED, void *event_info)
|
||||||
{
|
{
|
||||||
|
@ -178,23 +197,15 @@ _exe_error(void *d EINA_UNUSED, int t EINA_UNUSED, void *event_info)
|
||||||
return ECORE_CALLBACK_RENEW;
|
return ECORE_CALLBACK_RENEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static Eina_Bool
|
||||||
_edi_test_output_suite(int count, int pass, int fail)
|
_exe_done(void *d EINA_UNUSED, int t EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
char *line;
|
if (_edi_test_count == 0)
|
||||||
const char *format = _("Total pass %d (%d%%), fail %d)");
|
return ECORE_CALLBACK_RENEW;
|
||||||
int linemax, percent;
|
|
||||||
|
|
||||||
linemax = strlen(format) - 6 + 30;
|
_edi_test_output_suite(_edi_test_count, _edi_test_pass, _edi_test_fail);
|
||||||
line = malloc(sizeof(char) * linemax);
|
_edi_test_count = 0;
|
||||||
|
return ECORE_CALLBACK_RENEW;
|
||||||
percent = 0;
|
|
||||||
if (count > 0)
|
|
||||||
percent = (int) ((pass / (double) count) * 100);
|
|
||||||
|
|
||||||
snprintf(line, linemax, format, pass, percent, fail);
|
|
||||||
elm_code_file_line_append(_edi_test_code->file, line, strlen(line), (fail > 0) ? _EDI_SUITE_FAILED : _EDI_SUITE_PASSED);
|
|
||||||
free(line);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
@ -309,6 +320,23 @@ static void _edi_test_line_callback(const char *content)
|
||||||
else if (!strncmp(content, "FAIL:", 5))
|
else if (!strncmp(content, "FAIL:", 5))
|
||||||
{
|
{
|
||||||
_edi_test_line_parse_suite(content + 6);
|
_edi_test_line_parse_suite(content + 6);
|
||||||
|
|
||||||
|
else if (!strncmp(content, "=== RUN", 7))
|
||||||
|
{
|
||||||
|
edi_testpanel_show();
|
||||||
|
_edi_test_count++;
|
||||||
|
}
|
||||||
|
else if (!strncmp(content, "--- PASS:", 9))
|
||||||
|
{
|
||||||
|
_edi_test_pass++;
|
||||||
|
|
||||||
|
elm_code_file_line_append(_edi_test_code->file, content + 10, strlen(content) - 10, _EDI_SUITE_PASSED);
|
||||||
|
}
|
||||||
|
else if (!strncmp(content, "--- FAIL:", 9))
|
||||||
|
{
|
||||||
|
_edi_test_fail++;
|
||||||
|
|
||||||
|
elm_code_file_line_append(_edi_test_code->file, content + 10, strlen(content) - 10, _EDI_SUITE_FAILED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,6 +381,7 @@ void edi_consolepanel_add(Evas_Object *parent)
|
||||||
|
|
||||||
ecore_event_handler_add(ECORE_EXE_EVENT_DATA, _exe_data, NULL);
|
ecore_event_handler_add(ECORE_EXE_EVENT_DATA, _exe_data, NULL);
|
||||||
ecore_event_handler_add(ECORE_EXE_EVENT_ERROR, _exe_error, NULL);
|
ecore_event_handler_add(ECORE_EXE_EVENT_ERROR, _exe_error, NULL);
|
||||||
|
ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _exe_done, NULL);
|
||||||
ecore_event_handler_add(EDI_EVENT_CONFIG_CHANGED, _edi_consolepanel_config_changed, NULL);
|
ecore_event_handler_add(EDI_EVENT_CONFIG_CHANGED, _edi_consolepanel_config_changed, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue