diff --git a/dummy.c b/dummy.c new file mode 100644 index 00000000..e69de29b diff --git a/meson.build b/meson.build index 66370e4c..e336e490 100644 --- a/meson.build +++ b/meson.build @@ -140,15 +140,16 @@ libui_sources = [] libui_deps = [] libui_soversion = '' libui_rpath = '' -subdir('common') +#subdir('common') +libui_sources+=['dummy.c'] if libui_OS == 'windows' - subdir('windows') +# subdir('windows') install_headers('ui_windows.h') elif libui_OS == 'darwin' - subdir('darwin') +# subdir('darwin') install_headers('ui_darwin.h') else - subdir('unix') +# subdir('unix') install_headers('ui_unix.h') endif libui_libui = library('ui', libui_sources, @@ -173,4 +174,4 @@ if libui_mode == 'static' libui_binary_deps = libui_deps endif subdir('test') -subdir('examples') +#subdir('examples') diff --git a/test/initmain.c b/test/initmain.c index 51b7efc9..a9984ef8 100644 --- a/test/initmain.c +++ b/test/initmain.c @@ -2,11 +2,11 @@ #include "../ui.h" #include "testing.h" -Test(Init) +testingTest(Init) { } -Test(Uninit) +testingTest(Uninit) { } @@ -17,7 +17,7 @@ static void queued(void *data) *flag = 1; } -static void timer(void *n) +static void timer(void *data) { int *n = (int *) data; @@ -25,12 +25,12 @@ static void timer(void *n) *n++; } -Test(QueueMain) +testingTest(QueueMain) { } -// TODO Test(QueueMain_DifferentThread) +// TODO testingTest(QueueMain_DifferentThread) -Test(Timer) +testingTest(Timer) { } diff --git a/test/meson.build b/test/meson.build index 5c15220a..9d55e675 100644 --- a/test/meson.build +++ b/test/meson.build @@ -2,6 +2,7 @@ libui_test_sources = [ 'initmain.c', + 'main.c', 'testing.c', ] diff --git a/test/testing.c b/test/testing.c index 165020d6..c3e58909 100644 --- a/test/testing.c +++ b/test/testing.c @@ -27,7 +27,7 @@ struct testingT { static testingT *tests = NULL; static testingT *testsTail = NULL; -static void testingprivNewTest(const char *name, void (*f)(testingT *), testingT *prev) +static testingT *newTest(const char *name, void (*f)(testingT *), testingT *prev) { testingT *t; @@ -39,7 +39,9 @@ static void testingprivNewTest(const char *name, void (*f)(testingT *), testingT t->returned = 0; t->defers = NULL; t->defersRun = 0; - t->next = testsTail; + t->next = NULL; + if (prev != NULL) + prev->next = t; return t; } @@ -47,7 +49,7 @@ void testingprivRegisterTest(const char *name, void (*f)(testingT *)) { testingT *t; - t = testingprivNewTest(name, f, testsTail); + t = newTest(name, f, testsTail); testsTail = t; if (tests == NULL) tests = t; @@ -87,7 +89,6 @@ static void runTestSet(testingT *t, int *anyFailed) int testingMain(void) { - testingT *t; int anyFailed; // TODO see if this should run if all tests are skipped @@ -119,7 +120,7 @@ void testingprivTLogfFull(testingT *t, const char *file, long line, const char * void testingprivTLogvfFull(testingT *t, const char *file, long line, const char *format, va_list ap) { // TODO extract filename from file - printf("\t%s:%d: ", file, line); + printf("\t%s:%ld: ", file, line); // TODO split into lines separated by \n\t\t and trimming trailing empty lines vprintf(format, ap); printf("\n"); @@ -153,7 +154,7 @@ void testingprivTSkipNow(testingT *t) returnNow(t); } -void testingTDefer(testingT *t, void (*f)(void *data), void *data) +void testingTDefer(testingT *t, void (*f)(testingT *t, void *data), void *data) { struct defer *d; diff --git a/test/testing.h b/test/testing.h index 2f75be5e..2393a66d 100644 --- a/test/testing.h +++ b/test/testing.h @@ -6,11 +6,11 @@ #include -#define testingprivFullName(basename) testingprivImpl ## basename +#define testingprivImplName(basename) testingprivImpl ## basename #define testingprivScaffoldName(basename) testingprivScaffold ## basename #define testingprivMkScaffold(basename, argtype, argname) \ - static inline void testingprivScaffoldName(basename)(argtype *argname) { testingprivFullName(basename)(argname); } + static inline void testingprivScaffoldName(basename)(argtype *argname) { testingprivImplName(basename)(argname); } // references: // - https://gitlab.gnome.org/GNOME/glib/blob/master/glib/gconstructor.h