X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=t%2Fax%2Fam-test-lib.sh;h=26e58ef04410deb3ef87d97231640497e2534b9b;hb=ec163633dd590bfdbd8d7fd147492081018507f7;hp=5c918db4051e56a66444962fdf4e85ba32251a8b;hpb=4d56c0f3b5973e386c3e5f0fb2367d2fff00bf71;p=platform%2Fupstream%2Fautomake.git diff --git a/t/ax/am-test-lib.sh b/t/ax/am-test-lib.sh index 5c918db..26e58ef 100644 --- a/t/ax/am-test-lib.sh +++ b/t/ax/am-test-lib.sh @@ -43,18 +43,16 @@ unset __MKLVL__ MAKE_JOBS_FIFO # For BSD make. unset DMAKE_CHILD DMAKE_DEF_PRINTED DMAKE_MAX_JOBS # For Solaris dmake. # Unset verbosity flag. unset V -# Also unset variables that will let "make -e install" divert -# files into unwanted directories. +# Also unset variables that might influence "make install". unset DESTDIR unset prefix exec_prefix bindir datarootdir datadir docdir dvidir unset htmldir includedir infodir libdir libexecdir localedir mandir unset oldincludedir pdfdir psdir sbindir sharedstatedir sysconfdir -# Unset variables that might change the "make distcheck" behaviour. +# Unset variables that might influence "make distcheck". unset DISTCHECK_CONFIGURE_FLAGS AM_DISTCHECK_CONFIGURE_FLAGS # Used by install rules for info files. unset AM_UPDATE_INFO_DIR -# The tests call "make -e" but we do not want $srcdir from the environment -# to override the definition from the Makefile. +# We don't want to use the $srcdir value exported by the test driver. unset srcdir # Also unset variables that control our test driver. While not # conceptually independent, they cause some changed semantics we @@ -184,25 +182,28 @@ is_valid_varname () # run_make () { - am__make_redirect= + am__make_redirect_stdout=no + am__make_redirect_stderr=no + am__make_redirect_stdall=no am__make_flags= - # Follow-up code might want to analyse these, so don't make them as - # private, nor unset them later. - am_make_rc_exp=0 - am_make_rc_got=0 + am__make_rc_exp=0 + # Follow-up code might want to analyse this, so mark is as + # publicly accessible (no double undesrscore). + am_make_rc=0 # Parse options for this function. while test $# -gt 0; do case $1 in - -e) am_make_rc_exp=$2; shift;; - -O) am__make_redirect="$am__make_redirect >stdout";; - -E) am__make_redirect="$am__make_redirect 2>stderr";; - -M) am__make_redirect=">output 2>&1";; + -e) am__make_rc_exp=$2; shift;; + -O) am__make_redirect_stdout=yes;; + -E) am__make_redirect_stderr=yes;; + -M) am__make_redirect_stdall=yes;; --) shift; break;; *) break;; esac shift done + # Use append mode here to avoid dropping output. See automake bug#11413 if using_gmake; then # We can trust GNU make to correctly pass macro definitions given # on the command line down to sub-make invocations, and this allow @@ -247,31 +248,55 @@ run_make () unset am__make_flags fi - eval "\$MAKE${am__make_redirect}"' ${1+"$@"}' || am_make_rc_got=$? + # In redirecting make output below, use append mode, to avoid + # dropping output. See automake bug#11413 for details. + # The exit status of 253 is a more-or-less random choice, to + # help us catch possible errors in redirections and error out + # accordingly. + ( + : exec $MAKE ${1+"$@"} # Display traces for future command. + set +x # We need to remove them now, not to pollute redirected stderr. + if test $am__make_redirect_stdall = yes; then + : > output && exec 1>>output 2>&1 || exit 253 + else + if test $am__make_redirect_stdout = yes; then + : > stdout && exec 1>>stdout || exit 253 + fi + if test $am__make_redirect_stderr = yes; then + : > stderr && exec 2>>stderr || exit 253 + fi + fi + exec $MAKE ${1+"$@"} + ) || am_make_rc=$? - case $am__make_redirect in - *output*) cat output;; - *stderr*stdout*) cat stdout && cat stderr >&2;; - *stdout*stderr*) cat stdout && cat stderr >&2;; - *stdout*) cat stdout;; - *stderr*) cat stderr >&2;; - esac \ - || fatal_ "displaying make output" + if test $am_make_rc -eq 253; then + fatal_ "run_make: problems in redirecting make output" + fi + + if test $am__make_redirect_stdall = yes; then + cat output || fatal_ "displaying make output" + else + if test $am__make_redirect_stdout = yes; then + cat stdout || fatal_ "displaying make output" + fi + if test $am__make_redirect_stderr = yes; then + cat stderr >&2 || fatal_ "displaying make output" + fi + fi - case $am_make_rc_exp in + case $am__make_rc_exp in IGNORE) : Ignore exit status ;; FAIL) - test $am_make_rc_got -gt 0 || return 1 + test $am_make_rc -gt 0 || return 1 ;; *) - test $am_make_rc_exp -ge 0 && test $am_make_rc_exp -le 255 \ - || fatal_ "invalid expected exit status: '$am_make_rc_exp'" - test $am_make_rc_exp -eq $am_make_rc_got || return 1 + test $am__make_rc_exp -ge 0 && test $am__make_rc_exp -le 255 \ + || fatal_ "invalid expected exit status: '$am__make_rc_exp'" + test $am_make_rc -eq $am__make_rc_exp || return 1 ;; esac - unset am__make_redirect } # AUTOMAKE_run [-e STATUS] [-d DESCRIPTION] [--] [AUTOMAKE-ARGS...] @@ -483,6 +508,36 @@ am__useless_vpath_rebuild="" yl_distcheck () { useless_vpath_rebuild || run_make distcheck ${1+"$@"}; } +null_install () +{ + for am__v in nulldirs destdir instdir; do + if ! eval 'test -n "$'$am__v'"'; then + fatal_ "null_install() invoked with \$$am__v unset" + fi + done + unset am__v + case $#,$1 in + 0,) + am__inst='install';; + 1,-t|1,--texi) + am__inst='install install-html install-dvi install-ps install-pdf';; + *) + fatal_ "null_install(): invalid usage";; + esac + run_make $nulldirs $am__inst + test ! -e "$instdir" + run_make $nulldirs $am__inst DESTDIR="$destdir" + test ! -e "$instdir" + test ! -e "$destdir" + run_make -M $nulldirs uninstall + # Creative quoting below to please maintainer-check. + grep 'rm'' ' output && exit 1 + run_make -M $nulldirs uninstall DESTDIR="$destdir" + # Creative quoting below to please maintainer-check. + grep 'rm'' ' output && exit 1 + : # For 'set -e'. +} + # count_test_results total=N pass=N fail=N xpass=N xfail=N skip=N error=N # ----------------------------------------------------------------------- # Check that a testsuite run driven by the parallel-tests harness has @@ -706,6 +761,11 @@ require_tool () case $1 in cc|c++|fortran|fortran77) require_compiler_ $1;; + -c-o) + if test x"$AM_TESTSUITE_SIMULATING_NO_CC_C_O" = x"yes"; then + skip_all_ "need a C compiler that grasps -c and -o together" + fi + ;; xsi-lib-shell) if test x"$am_test_prefer_config_shell" = x"yes"; then require_xsi "$SHELL" @@ -728,7 +788,11 @@ require_tool () # in the environment "by hand" before calling the testsuite. export CC CPPFLAGS echo "$me: running $CC -?" - $CC -? || skip_all_ "Microsoft C compiler '$CC' not available" + # The IRAF package (http://iraf.noao.edu/) contains a 'cl' program + # which is interactive, and which could cause the testsuite to hang + # if its standard input is not redirected. See automake bug#14707. + $CC -?