char __attribute__((weak)) *server_parameters="";
-extern const struct weston_test __start_test_section, __stop_test_section;
+extern const struct weston_test_entry __start_test_section, __stop_test_section;
static const char *test_name_;
va_end(argp);
}
-static const struct weston_test *
+static const struct weston_test_entry *
find_test(const char *name)
{
- const struct weston_test *t;
+ const struct weston_test_entry *t;
for (t = &__start_test_section; t < &__stop_test_section; t++)
if (strcmp(t->name, name) == 0)
}
static void
-run_test(const struct weston_test *t, void *data, int iteration)
+run_test(const struct weston_test_entry *t, void *data, int iteration)
{
char str[512];
static void
list_tests(void)
{
- const struct weston_test *t;
+ const struct weston_test_entry *t;
fprintf(stderr, "Available test names:\n");
for (t = &__start_test_section; t < &__stop_test_section; t++)
/* iteration is valid only if test_data is not NULL */
static int
-exec_and_report_test(const struct weston_test *t, void *test_data, int iteration)
+exec_and_report_test(const struct weston_test_entry *t,
+ void *test_data, int iteration)
{
int success = 0;
int skip = 0;
* table_data = NULL.
*/
static int
-iterate_test(const struct weston_test *t, int *passed, int *skipped)
+iterate_test(const struct weston_test_entry *t, int *passed, int *skipped)
{
int ret, i;
void *current_test_data = (void *) t->table_data;
int main(int argc, char *argv[])
{
- const struct weston_test *t;
+ const struct weston_test_entry *t;
int total = 0;
int pass = 0;
int skip = 0;
#error "Tests must not be built with NDEBUG defined, they rely on assert()."
#endif
-struct weston_test {
+struct weston_test_entry {
const char *name;
void (*run)(void *);
const void *table_data;
#define TEST_COMMON(func, name, ret, data, size, n_elem) \
static void func(void *); \
\
- const struct weston_test test##name \
+ const struct weston_test_entry test##name \
__attribute__ ((used, section ("test_section"))) = \
{ \
#name, func, data, size, n_elem, ret \