1 dnl Copyright © 2019 Nick Bowler
2 dnl License GPLv2+: GNU General Public License version 2 or any later version.
3 dnl This is free software: you are free to change and redistribute it.
4 dnl There is NO WARRANTY, to the extent permitted by law.
6 AT_SETUP([test.gob compilation])
8 AT_CHECK([gob2 "$abs_top_srcdir/t/test.gob"])
9 AT_CHECK([$HAVE_GTK2 || exit 77])
10 TEST_COMPILE_GOBJECT([$GTK_CFLAGS test-object.c], [0], [], [ignore])
14 AT_SETUP([test.gob C++ compilation])
16 AT_CHECK([gob2 --for-cpp "$abs_top_srcdir/t/test.gob"])
17 AT_CHECK([$HAVE_GTK2 || exit 77])
18 TEST_COMPILEXX_GOBJECT([$GTK_CFLAGS test-object.cc], [0], [], [ignore])
32 char *stupid_pointer = "ug";
34 /* This works fine. */
35 Str *test_good = (Str *) (str_new ("%d", the_answer));
36 test_good = test_good;
38 /* This gets a warning thanks to our function attribute. */
39 Str *test_bad = (Str *) (str_new ("%d", stupid_pointer));
46 str_gob=$abs_top_srcdir/t/str.gob
47 AT_CHECK([gob2 "$str_gob"])
48 TEST_COMPILE_GOBJECT([str.c], [0], [], [stderr])
51 # Check for correct diagnostic messages on the target lines...
52 AT_CHECK([awk '/want a string/ { print NR }' "$str_gob" >str_lines])
56 AS_VAR_ARITH([total], [1 + $total])
57 AT_CHECK([awk -v line="$l" -v file="$str_gob" -NF : \
58 '$1 == file && $2 == line { exit 42 }' str_stderr], [42])
61 AT_CHECK([test x"$total" = x"2"])
63 TEST_COMPILE_GOBJECT([main.c], [0], [], [stderr])
64 AT_CHECK([awk -NF : '$1 == "main.c" && $2 == "15" { exit 42 }' stderr], [42])
66 AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main str.o main.o])