]> git.draconx.ca Git - dxcommon.git/blobdiff - tests/scripts.at
fix-gnulib: Ensure header rules create output directory.
[dxcommon.git] / tests / scripts.at
index b49a94dad6b3cad48005af18100b200db0d4d4f4..4a838077250eaa6c5a6c8be1e433cbc0acbc3837 100644 (file)
@@ -589,9 +589,13 @@ test_fix_gnulib () {
   $PERL -f "$srcdir/scripts/fix-gnulib.pl" "$@"
 }
 test_gnulib_mk () {
-  echo; sed -n -f - "$srcdir/tests/data/gnulib.mk" <<EOF
-/^## begin gnulib module $1/,/^## end   gnulib module $1/p
+  echo;
+  for arg
+  do
+    sed -n -f - "$srcdir/tests/data/gnulib.mk" <<EOF
+/^## begin gnulib module $arg/,/^## end   gnulib module $arg/p
 EOF
+  done
 }
 m4_divert_pop([PREPARE_TESTS])
 
@@ -628,6 +632,59 @@ sed -n -e '/^## begin gnulib/,/^## end   gnulib/p' \
 
 AT_CLEANUP
 
+AT_SETUP([fix-gnulib.pl warning removal])
+
+AT_DATA([test.mk.in], [[
+## test begin
+noinst_LTLIBRARIES += libgnu.la
+libgnu_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAG_GNULIB_WARNINGS)
+noinst_LIBRARIES += libgnu.a
+libgnu_a_CFLAGS = $(AM_CFLAGS) $(GL_CFLAG_GNULIB_WARNINGS)
+## test end
+]])
+AT_CHECK([test_fix_gnulib -i test.mk.in -o test.mk || exit
+sed -n '/^## test begin/,/^## test end/p' test.mk], [0], [## test begin
+EXTRA_LTLIBRARIES += libgnu.la
+EXTRA_LIBRARIES += libgnu.a
+## test end
+])
+
+AT_CLEANUP
+
+AT_SETUP([fix-gnulib.pl header directory creation])
+
+AT_DATA([extract.sed],
+[[/AM_V_GEN/b ok
+/gl_V_at/b ok
+s/:.*/:/
+h
+b
+:ok
+s/'//g
+x
+G
+p
+n
+s/[)].*/)/
+p
+]])
+
+test_gnulib_mk alloca-opt sys_types stddef >test.mk.in
+AT_CHECK([test_fix_gnulib -i test.mk.in -o test.mk || exit
+sed -n -f extract.sed test.mk], [0],
+[[lib/alloca.h:
+       $(AM_V_GEN)$(MKDIR_P) lib
+       $(AM_V_at)
+lib/sys/types.h:
+       $(AM_V_GEN)$(MKDIR_P) lib/sys
+       $(AM_V_at)
+lib/stddef.h:
+       $(AM_V_GEN)$(MKDIR_P) lib
+       $(AM_V_at)
+]])
+
+AT_CLEANUP
+
 dnl TEST_FIND_AUTOMAKE_VER([to-check], [test-action])
 dnl
 dnl For each whitespace-separated version token in to-check, check if we can