AT_BANNER([Script tests])
+AT_SETUP([bake-config.awk])
+AT_KEYWORDS([bake-config awk script scripts])
+
+AT_DATA([cfg.h],
+[[#define hello world
+/* #undef HAVE_STUFF */
+#define HAVE_OTHER_STUFF 1
+/* #undef HAVE_CRAZY_STUFF */
+]])
+
+AT_DATA([lib.h],
+[[#if HAVE_STUFF
+# define foo hello__
+#elif HAVE_CRAZY_STUFF
+# define foo hello
+#elif HAVE_OTHER_STUFF
+# define foo __hello
+#endif
+]])
+
+AT_CHECK([$AWK -f "$srcdir/scripts/bake-config.awk" cfg.h lib.h], [0],
+[[#if 0 /* HAVE_STUFF */
+# define foo hello__
+#elif 0 /* HAVE_CRAZY_STUFF */
+# define foo world /* hello */
+#elif 1 /* HAVE_OTHER_STUFF */
+# define foo __hello
+#endif
+]])
+
+AT_CLEANUP
+
m4_define([TEST_GEN_OPTIONS],
[AT_KEYWORDS([gen-options awk script scripts])dnl
AT_DATA([m4_default([$2], [options.def])], [$1])