FxLibcTest/include/ft/widgets/fbar.h

37 lines
1.0 KiB
C

//---
// ft.widgets.fbar: A colored bar summarizing test results
//---
#ifndef _FT_WIDGETS_FBAR_H_
#define _FT_WIDGETS_FBAR_H_
#include <justui/jwidget.h>
#include <ft/test.h>
/* fbar: A bar summarizing test results with colored sections
This widget is a simple display widget. It displays either a summary for a
list or a summary for a whole header set (list of lists).
The length of the pending section is based on the proportion of pending
tests. The length of the other sections is based on the number of assertions
in each category. */
typedef struct {
jwidget widget;
/* Current set of tests or set of lists (only one can be non-NULL) */
ft_test **tests;
ft_list *lists;
} fbar;
/* fbar_create(): Create an fbar with no data tied */
fbar *fbar_create(void *parent);
/* fbar_set_tests(): Show statistics for a list */
void fbar_set_tests(fbar *b, ft_test **tests);
/* fbar_set_lists(): Show statistics for a full header set */
void fbar_set_lists(fbar *b, ft_list *lists);
#endif /* _FT_WIDGETS_FBAR_H_ */