Add tests PASSED and FAILED to elm_code statuses

and the widget rendering.

Use this in EDI to add a test summarising panel.
Tests are executed in verbose mode so we can list
all the tests that have been run - can summarise
later if we wish...
This commit is contained in:
Andy Williams 2014-11-18 21:11:10 +00:00
parent 2299130410
commit 62fd0bb3f7
5 changed files with 26 additions and 0 deletions

View File

@ -7,6 +7,7 @@
#include <elm_code_common.h>
#include <elm_code_file.h>
#include <elm_code_parse.h>
#include <elm_code_widget.h>
#ifdef EAPI

View File

@ -17,6 +17,9 @@ typedef enum {
ELM_CODE_STATUS_TYPE_REMOVED,
ELM_CODE_STATUS_TYPE_CHANGED,
ELM_CODE_STATUS_TYPE_PASSED,
ELM_CODE_STATUS_TYPE_FAILED,
ELM_CODE_STATUS_TYPE_COUNT
} Elm_Code_Status_Type;

View File

@ -119,6 +119,21 @@ EAPI const char *elm_code_file_path_get(Elm_Code_File *file)
return eina_file_filename_get(file->file);
}
EAPI void elm_code_file_clear(Elm_Code_File *file)
{
Elm_Code_Line *l;
EINA_LIST_FREE(file->lines, l)
{
if (l->content)
free(l->content);
free(l);
}
if (file->parent)
elm_code_callback_fire(file->parent, &ELM_CODE_EVENT_FILE_LOAD_DONE, file);
}
EAPI unsigned int elm_code_file_lines_get(Elm_Code_File *file)
{
return eina_list_count(file->lines);

View File

@ -76,6 +76,8 @@ EAPI const char *elm_code_file_path_get(Elm_Code_File *file);
*
*/
EAPI void elm_code_file_clear(Elm_Code_File *file);
EAPI unsigned int elm_code_file_lines_get(Elm_Code_File *file);
EAPI void elm_code_file_line_append(Elm_Code_File *file, const char *line);

View File

@ -176,6 +176,11 @@ EAPI Evas_Object *elm_code_widget_add(Evas_Object *parent, Elm_Code *code)
evas_object_textgrid_palette_set(o, EVAS_TEXTGRID_PALETTE_STANDARD, ELM_CODE_STATUS_TYPE_CHANGED,
36, 36, 96, 255);
evas_object_textgrid_palette_set(o, EVAS_TEXTGRID_PALETTE_STANDARD, ELM_CODE_STATUS_TYPE_PASSED,
54, 96, 54, 255);
evas_object_textgrid_palette_set(o, EVAS_TEXTGRID_PALETTE_STANDARD, ELM_CODE_STATUS_TYPE_FAILED,
96, 54, 54, 255);
// setup token colors
evas_object_textgrid_palette_set(o, EVAS_TEXTGRID_PALETTE_STANDARD, ELM_CODE_TOKEN_TYPE_DEFAULT,
205, 205, 205, 255);