dnl Copyright © 2019 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. AT_SETUP([test.gob compilation]) AT_CHECK([gob2 "$abs_top_srcdir/t/test.gob"]) AT_CHECK([$HAVE_GTK2 || exit 77]) TEST_COMPILE_GOBJECT([$GTK_CFLAGS test-object.c], [0], [], [ignore]) AT_CLEANUP AT_SETUP([test.gob C++ compilation]) AT_CHECK([gob2 --for-cpp "$abs_top_srcdir/t/test.gob"]) AT_CHECK([$HAVE_GTK2 || exit 77]) TEST_COMPILEXX_GOBJECT([$GTK_CFLAGS test-object.cc], [0], [], [ignore]) AT_CLEANUP AT_SETUP([str.gob]) AT_DATA([main.c], [[#include "str.h" int main(void) { g_type_init (); int the_answer = 42; char *stupid_pointer = "ug"; /* This works fine. */ Str *test_good = (Str *) (str_new ("%d", the_answer)); test_good = test_good; /* This gets a warning thanks to our function attribute. */ Str *test_bad = (Str *) (str_new ("%d", stupid_pointer)); test_bad = test_bad; return 0; } ]]) str_gob=$abs_top_srcdir/t/str.gob AT_CHECK([gob2 "$str_gob"]) TEST_COMPILE_GOBJECT([str.c], [0], [], [stderr]) mv stderr str_stderr # Check for correct diagnostic messages on the target lines... AT_CHECK([awk '/want a string/ { print NR }' "$str_gob" >str_lines]) total=0 exec 3