#! /bin/sh # Copyright (C) 2012-2013 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Check that $(am.make.dry-run) works as expected. . test-init.sh plan_ 14 echo AC_OUTPUT >> configure.ac cat > Makefile.am <<'END' all: @echo "Target '$@' should never run" >&2; exit 1; notdry-plain: $(am.make.dry-run) && exit 1; exit 0 notdry-recursive: $(MAKE) notdry-plain dry-plain: +$(am.make.dry-run) || exit 1; echo ok > from-dry-mode dry-recursive: $(MAKE) dry-plain END $ACLOCAL || fatal_ "aclocal failed" $AUTOCONF || fatal_ "autoconf failed" $AUTOMAKE || fatal_ "automake failed" ./configure || fatal_ "configure failed" # ---------------------------------------------------------------------- check_no_dryrun () { for kind in plain recursive; do command_ok_ "wet-run, $kind ($cnt)" $MAKE notdry-$kind ${1+"$@"} done cnt=$(($cnt + 1)) } cnt=1 check_no_dryrun check_no_dryrun -k # Test against a known regression. This was especially heinous, since # make running in normal mode was sometimes mistaken for make running # in dry mode. mkdir n ./--dry-run check_no_dryrun -I n check_no_dryrun -I --dry-run check_no_dryrun -I n -I --dry-run rmdir n ./--dry-run # ---------------------------------------------------------------------- check_dryrun () { for kind in plain recursive; do r=ok $MAKE dry-$kind ${1+"$@"} || r='not ok' test -f from-dry-mode || r='not ok' rm -f from-dry-mode || fatal_ "cleaning up" result_ "$r" "dry-run, $kind ($cnt)" done cnt=$(($cnt + 1)) } cnt=1 check_dryrun -n check_dryrun --dry-run -k # ---------------------------------------------------------------------- :