From: Daiki Ueno Date: Thu, 25 Jul 2013 08:16:01 +0000 (+0900) Subject: tests: allow each test to run individually without 'make' X-Git-Tag: v0.19~186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e5a33062ba09502dbac3c14b6657a7c7faedc96;p=thirdparty%2Fgettext.git tests: allow each test to run individually without 'make' --- diff --git a/gettext-tools/ChangeLog b/gettext-tools/ChangeLog index dbfd99e78..8d0820c32 100644 --- a/gettext-tools/ChangeLog +++ b/gettext-tools/ChangeLog @@ -1,3 +1,10 @@ +2013-07-25 Daiki Ueno + + tests: allow each test to run individually without 'make' + * configure.ac: Replace occurrences of make variables in + tests/init.cfg with shell variables so they can be adjusted in + test scripts. + 2013-07-25 Daiki Ueno tests: fix path adjustment for LTLIBINTL diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index 6941d1f2a..348ba87f5 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -549,7 +549,12 @@ AC_CONFIG_FILES([m4/Makefile]) AC_CONFIG_FILES([tests/Makefile]) -AC_CONFIG_FILES([tests/init.cfg]) +AC_CONFIG_FILES([tests/init.cfg], [changequote(<<,>>) + # Replace occurrences of make variables with shell variables so they + # can be adjusted in test scripts. + sed -e 's|\$(\([^)]*\))|${\1}|g' < tests/init.cfg > tests/init.cfg.tmp + mv tests/init.cfg.tmp tests/init.cfg + changequote([,])]) AC_CONFIG_FILES([gnulib-tests/Makefile]) diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog index 2aec794fc..15eb4f416 100644 --- a/gettext-tools/tests/ChangeLog +++ b/gettext-tools/tests/ChangeLog @@ -1,3 +1,15 @@ +2013-07-25 Daiki Ueno + + tests: allow each test to run individually without 'make' + * Makefile.am (TESTS_ENVIRONMENT): Move required envvar to... + * init.cfg.in: ...here, so each test can run individually. + * lang-c: Guard if top_srcdir is not set. + * lang-c++: Likewise. + * lang-objc: Likewise. + * msgunfmt-tcl-1: Likewise. + * xgettext-1: Likewise. + * xgettext-c-1: Likewise. + 2013-07-25 Daiki Ueno tests: fix path adjustment for LTLIBINTL diff --git a/gettext-tools/tests/Makefile.am b/gettext-tools/tests/Makefile.am index 90d0b47a3..4bd2f3ef2 100644 --- a/gettext-tools/tests/Makefile.am +++ b/gettext-tools/tests/Makefile.am @@ -177,23 +177,6 @@ TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) \ MSGUNFMT="$(CHECKER) msgunfmt" \ MSGUNIQ="$(CHECKER) msguniq" \ RECODE="$(CHECKER) recode" \ - OBJEXT='@OBJEXT@' EXEEXT='@EXEEXT@' \ - CC='@CC@' CFLAGS='@CFLAGS@' \ - CXX='@CXX@' CXXFLAGS='@CXXFLAGS@' \ - CPPFLAGS='@CPPFLAGS@' LDFLAGS='@LDFLAGS@' \ - LTLIBINTL='@LTLIBINTL@' \ - JAVA_CHOICE='@JAVA_CHOICE@' \ - BUILDJAVA='@BUILDJAVA@' \ - TESTJAVA='@TESTJAVA@' \ - CSHARP_CHOICE='@CSHARP_CHOICE@' \ - BUILDCSHARP='@BUILDCSHARP@' \ - TESTCSHARP='@TESTCSHARP@' \ - TESTLIBASPRINTF='@TESTLIBASPRINTF@' \ - GLIBC2='@GLIBC2@' \ - LOCALE_FR='@LOCALE_FR@' \ - LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \ - LOCALE_JA='@LOCALE_JA@' \ - host_os='@host_os@' \ CONFIG_SHELL='$(SHELL)' LOG_COMPILER = $(SHELL) diff --git a/gettext-tools/tests/init.cfg.in b/gettext-tools/tests/init.cfg.in index d12a04ca9..7c71d186a 100644 --- a/gettext-tools/tests/init.cfg.in +++ b/gettext-tools/tests/init.cfg.in @@ -1,4 +1,44 @@ -# Variable needed by LTLIBINTL. +# Variable needed by LIBTOOL and LTLIBINTL. top_builddir=../.. +OBJEXT="@OBJEXT@" +EXEEXT="@EXEEXT@" +CC="@CC@" +CFLAGS="@CFLAGS@" +CXX="@CXX@" +CXXFLAGS="@CXXFLAGS@" +CPPFLAGS="@CPPFLAGS@" +LDFLAGS="@LDFLAGS@" +LIBTOOL="@LIBTOOL@" LTLIBINTL="@LTLIBINTL@" +JAVA_CHOICE="@JAVA_CHOICE@" +BUILDJAVA="@BUILDJAVA@" +TESTJAVA="@TESTJAVA@" +CSHARP_CHOICE="@CSHARP_CHOICE@" +BUILDCSHARP="@BUILDCSHARP@" +TESTCSHARP="@TESTCSHARP@" +TESTLIBASPRINTF="@TESTLIBASPRINTF@" +GLIBC2="@GLIBC2@" +LOCALE_FR="@LOCALE_FR@" +LOCALE_FR_UTF8="@LOCALE_FR_UTF8@" +LOCALE_JA="@LOCALE_JA@" +host_os="@host_os@" + +: ${GETTEXT=tstgettext} +: ${NGETTEXT=tstngettext} +: ${XGETTEXT=xgettext} +: ${MSGATTRIB=msgattrib} +: ${MSGCAT=msgcat} +: ${MSGCMP=msgcmp} +: ${MSGCOMM=msgcomm} +: ${MSGCONV=msgconv} +: ${MSGEN=msgen} +: ${MSGEXEC=msgexec} +: ${MSGFILTER=msgfilter} +: ${MSGFMT=msgfmt} +: ${MSGGREP=msggrep} +: ${MSGINIT=msginit} +: ${MSGMERGE=msgmerge} +: ${MSGUNFMT=msgunfmt} +: ${MSGUNIQ=msguniq} +: ${RECODE=recode} diff --git a/gettext-tools/tests/lang-c b/gettext-tools/tests/lang-c index 5f564f8d0..87cfdcc5c 100755 --- a/gettext-tools/tests/lang-c +++ b/gettext-tools/tests/lang-c @@ -48,7 +48,7 @@ tmpfiles="$tmpfiles l-c-prog.${OBJEXT} l-c-prog${EXEEXT}" # is found in the build directory, regardless of -I options present in # ${CFLAGS} or ${CPPFLAGS}. : ${LIBTOOL=/bin/sh ../../libtool} -${LIBTOOL} --quiet --mode=link ${CC} -I../.. -I../$top_srcdir/gnulib-lib ../../gnulib-lib/libgettextlib.la -I../../intl ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o l-c-prog prog.c ${LTLIBINTL} \ +${LIBTOOL} --quiet --mode=link ${CC} -I../.. -I../${top_srcdir=..}/gnulib-lib ../../gnulib-lib/libgettextlib.la -I../../intl ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o l-c-prog prog.c ${LTLIBINTL} \ || exit 1 tmpfiles="$tmpfiles l-c-prog.tmp l-c-prog.pot" diff --git a/gettext-tools/tests/lang-c++ b/gettext-tools/tests/lang-c++ index 5be141afe..0b18b1ea7 100755 --- a/gettext-tools/tests/lang-c++ +++ b/gettext-tools/tests/lang-c++ @@ -66,7 +66,7 @@ tmpfiles="$tmpfiles l-c++-prog.${OBJEXT} l-c++-prog${EXEEXT}" # Put the -I flags before ${CXXFLAGS} ${CPPFLAGS}, to make sure that libintl.h # is found in the build directory, regardless of -I options present in # ${CXXFLAGS} or ${CPPFLAGS}. -${CXX} -I../.. -I../../../gettext-runtime/libasprintf -I../$top_srcdir/gnulib-lib -I../../intl ${CXXFLAGS} ${CPPFLAGS} -c l-c++-prog.cc \ +${CXX} -I../.. -I../../../gettext-runtime/libasprintf -I../${top_srcdir=..}/gnulib-lib -I../../intl ${CXXFLAGS} ${CPPFLAGS} -c l-c++-prog.cc \ || exit 1 # Remove the -Wl,--disable-auto-import option here that is added by # woe32-dll.m4. Cygwin 1.7.2 does not support it in C++ mode: It gives diff --git a/gettext-tools/tests/lang-objc b/gettext-tools/tests/lang-objc index cc5524a07..ec13cef95 100755 --- a/gettext-tools/tests/lang-objc +++ b/gettext-tools/tests/lang-objc @@ -64,7 +64,7 @@ tmpfiles="$tmpfiles l-objc-prog.${OBJEXT} l-objc-prog${EXEEXT}" # is found in the build directory, regardless of -I options present in # ${CFLAGS} or ${CPPFLAGS}. : ${LIBTOOL=/bin/sh ../../libtool} -${LIBTOOL} --quiet --mode=link ${CC} -I../.. -I../$top_srcdir/gnulib-lib ../../gnulib-lib/libgettextlib.la -I../../intl ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o l-objc-prog prog.m ${LTLIBINTL} \ +${LIBTOOL} --quiet --mode=link ${CC} -I../.. -I../${top_srcdir=..}/gnulib-lib ../../gnulib-lib/libgettextlib.la -I../../intl ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o l-objc-prog prog.m ${LTLIBINTL} \ || exit 1 tmpfiles="$tmpfiles l-objc-prog.tmp l-objc-prog.pot" diff --git a/gettext-tools/tests/msgunfmt-tcl-1 b/gettext-tools/tests/msgunfmt-tcl-1 index 65a239e3b..4f91b85ba 100755 --- a/gettext-tools/tests/msgunfmt-tcl-1 +++ b/gettext-tools/tests/msgunfmt-tcl-1 @@ -49,7 +49,7 @@ ${MSGFMT} --tcl -d mu-tcl-1-msgs -l fr mu-tcl-1-fr.po || exit 1 tmpfiles="$tmpfiles mu-tcl-1-prog.out" : ${MSGUNFMT=msgunfmt} -GETTEXTDATADIR=../${top_srcdir}/src \ +GETTEXTDATADIR=../${top_srcdir=..}/src \ ${MSGUNFMT} --tcl -d mu-tcl-1-msgs -l fr -o mu-tcl-1-prog.out || exit 1 tmpfiles="$tmpfiles mu-tcl-1-prog.ok" diff --git a/gettext-tools/tests/xgettext-1 b/gettext-tools/tests/xgettext-1 index 64e501891..0c4c9c514 100755 --- a/gettext-tools/tests/xgettext-1 +++ b/gettext-tools/tests/xgettext-1 @@ -12,8 +12,8 @@ tmpfiles="$tmpfiles zero-domain.po xg-test1.err" rm -f zero-domain.po : ${XGETTEXT=xgettext} LC_MESSAGES=C LC_ALL= \ -${XGETTEXT} -k_ -d zero-domain -x ../$top_srcdir/po/gettext-tools.pot \ - ../$top_srcdir/src/xgettext.c >xg-test1.err 2>&1 +${XGETTEXT} -k_ -d zero-domain -x ../${top_srcdir=..}/po/gettext-tools.pot \ + ../${top_srcdir=..}/src/xgettext.c >xg-test1.err 2>&1 result=$? cat xg-test1.err | grep -v 'warning: Charset' | grep -v '^ ' test $result = 0 || { rm -fr $tmpfiles; exit 1; } diff --git a/gettext-tools/tests/xgettext-c-1 b/gettext-tools/tests/xgettext-c-1 index f129b99af..11cf9607b 100755 --- a/gettext-tools/tests/xgettext-c-1 +++ b/gettext-tools/tests/xgettext-c-1 @@ -11,7 +11,7 @@ trap 'rm -fr $tmpfiles' 1 2 3 15 tmpfiles="$tmpfiles xg-c-1.tmp.po xg-c-1.po" : ${XGETTEXT=xgettext} ${XGETTEXT} -d xg-c-1.tmp -k_ --omit-header --no-location \ - ../$top_srcdir/src/xgettext.c ../$top_srcdir/src/msgfmt.c + ../${top_srcdir=..}/src/xgettext.c ../${top_srcdir=..}/src/msgfmt.c test $? = 0 || { rm -fr $tmpfiles; exit 1; } LC_ALL=C tr -d '\r' < xg-c-1.tmp.po > xg-c-1.po test $? = 0 || { rm -fr $tmpfiles; exit 1; }