X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/9e15b38133dbce39d340806433ea84f995753717..998925c8d088559a780a9f4fa63f66bad3e3321e:/tests/interface.at diff --git a/tests/interface.at b/tests/interface.at index 3307c3d..4cc41d9 100644 --- a/tests/interface.at +++ b/tests/interface.at @@ -1,4 +1,4 @@ -dnl Copyright © 2020 Nick Bowler +dnl Copyright © 2020, 2022-2023 Nick Bowler dnl License GPLv2+: GNU General Public License version 2 or any later version. dnl This is free software: you are free to change and redistribute it. dnl There is NO WARRANTY, to the extent permitted by law. @@ -71,6 +71,7 @@ int main(void) { int rc; + g_type_init(); rc = test_foo(g_object_new(TEST_TYPE_A, NULL)); printf("%d\n", rc); if (rc < 0) @@ -79,9 +80,7 @@ int main(void) } ]]) TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore]) - -AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \ - test-a.o test-fooable.o main.o]) +TEST_LINK_GOBJECT([main], [test-a.o test-fooable.o main.o]) AT_CHECK([./main], [0], [42 ]) @@ -106,6 +105,7 @@ int main(void) { int rc; + g_type_init(); g_type_module_use(g_object_new(TEST_TYPE_A_MOD, NULL)); rc = test_foo(g_object_new(TEST_TYPE_A, NULL)); @@ -116,9 +116,7 @@ int main(void) } ]]) TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore]) - -AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \ - test-a.o test-a-mod.o test-fooable.o main.o]) +TEST_LINK_GOBJECT([main], [test-a.o test-a-mod.o test-fooable.o main.o]) AT_CHECK([./main], [0], [54 ]) @@ -147,6 +145,7 @@ int main(void) { int rc; + g_type_init(); rc = test_foo(g_object_new(TEST_TYPE_A, NULL)); printf("%d\n", rc); if (rc < 0) @@ -161,9 +160,7 @@ int main(void) } ]]) TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore]) - -AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \ - test-a.o test-b.o test-fooable.o main.o]) +TEST_LINK_GOBJECT([main], [test-a.o test-b.o test-fooable.o main.o]) AT_CHECK([./main], [0], [Test:A foo called 42 Test:B foo called @@ -196,6 +193,7 @@ int main(void) { int rc; + g_type_init(); g_type_module_use(g_object_new(TEST_TYPE_B_MOD, NULL)); rc = test_foo(g_object_new(TEST_TYPE_A, NULL)); @@ -212,10 +210,8 @@ int main(void) } ]]) TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore]) - -AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \ - test-a.o test-b.o test-b-mod.o test-fooable.o main.o]) - +TEST_LINK_GOBJECT([main], + [test-a.o test-b.o test-b-mod.o test-fooable.o main.o]) AT_CHECK([./main], [0], [Test:A foo called 42 Test:B foo called @@ -249,6 +245,7 @@ int main(void) { int rc; + g_type_init(); g_type_module_use(g_object_new(TEST_TYPE_A_MOD, NULL)); g_type_module_use(g_object_new(TEST_TYPE_B_MOD, NULL)); @@ -266,10 +263,8 @@ int main(void) } ]]) TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore]) - -AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \ - test-a.o test-a-mod.o test-b.o test-b-mod.o test-fooable.o main.o]) - +TEST_LINK_GOBJECT([main], + [test-a.o test-a-mod.o test-b.o test-b-mod.o test-fooable.o main.o]) AT_CHECK([./main], [0], [Test:A foo called 42 Test:B foo called @@ -302,6 +297,7 @@ int main(void) { int rc; + g_type_init(); rc = test_foo(g_object_new(TEST_TYPE_C, NULL)); printf("%d\n", rc); if (rc < 0) @@ -312,9 +308,7 @@ int main(void) ]]) TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore]) - -AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \ - test-a.o test-b.o test-c.o test-fooable.o main.o]) +TEST_LINK_GOBJECT([main], [test-a.o test-b.o test-c.o test-fooable.o main.o]) AT_CHECK([./main], [0], [Test:C foo called Test:B foo called Test:A foo called @@ -350,6 +344,7 @@ int main(void) { int rc; + g_type_init(); g_type_module_use(g_object_new(TEST_TYPE_A_MOD, NULL)); g_type_module_use(g_object_new(TEST_TYPE_B_MOD, NULL)); g_type_module_use(g_object_new(TEST_TYPE_C_MOD, NULL)); @@ -364,10 +359,9 @@ int main(void) ]]) TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore]) - -AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \ - test-a.o test-a-mod.o test-b.o test-b-mod.o test-c.o test-c-mod.o \ - test-fooable.o main.o]) +TEST_LINK_GOBJECT([main], m4_join([ ], + [test-a.o test-a-mod.o test-b.o test-b-mod.o test-c.o test-c-mod.o], + [test-fooable.o main.o])) AT_CHECK([./main], [0], [Test:C foo called Test:B foo called Test:A foo called