AM_TAP_LOG_DRIVER_FLAGS = --merge
-EXTRA_DIST = ChangeLog-old
+EXTRA_DIST = is ChangeLog-old
TESTS = ## Will be updated later.
#! /bin/sh
-# Copyright (C) 1996, 2001, 2002, 2010, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 1996, 2001, 2002, 2010, 2011, 2012 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
EXTRA_DIST = $(t:=.test)
.PHONY: test
test:
- test x'$(EXTRA_DIST)' = x'a.test b.test c.test'
+ is $(EXTRA_DIST) == a.test b.test c.test
END
$ACLOCAL
#! /bin/sh
-# Copyright (C) 2004, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2011, 2012 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
VAR += val2 # com2
endif COND2
+.PHONY: test
test:
- test "`echo $(VAR)`" = 'valA valB val1 valC val2'
+ is $(VAR) == valA valB val1 valC val2
EOF
$ACLOCAL
#! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2011, 2012 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
.PHONY: test1 test2
test1:
- test faz.la = $(foo_DEPENDENCIES)
+ is faz.la == $(foo_DEPENDENCIES)
test2:
- test -z "`echo $(foo_DEPENDENCIES)`"
+ is "" == $(foo_DEPENDENCIES)
END
: > config.guess
#! /bin/sh
-# Copyright (C) 2001, 2002, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2011, 2012 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
.PHONY: test
test:
- test "`echo $(hell_SOURCES) $(hell_OBJECTS)`" = "foo.c foo.o"
+ is $(hell_SOURCES) $(hell_OBJECTS) == foo.c foo.o
END
$ACLOCAL
#! /bin/sh
-# Copyright (C) 2001, 2002, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2011, 2012 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
.PHONY: test
test:
- test x"`echo $(helldl_SOURCES) $(helldl_OBJECTS)`" = \
- x"dlmain.c foo.c dlmain.obj foo.obj"
+ is $(helldl_SOURCES) $(helldl_OBJECTS) == \
+ dlmain.c foo.c dlmain.obj foo.obj
bin_PROGRAMS = helldl
END
#! /bin/sh
-# Copyright (C) 2001, 2002, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2011, 2012 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
helldl_SOURCES = $(var3:.c=1.c) $(var4:.c=2.c)
-got = `echo $(helldl_SOURCES) $(helldl_OBJECTS)`
-
.PHONY: test
test:
- test x"$(exp)" = x"$(got)"
+ is $(exp) == $(helldl_SOURCES) $(helldl_OBJECTS)
END
$ACLOCAL
$AUTOMAKE -a -i
CONDITION1=true CONDITION2=true ./configure
-exp='dlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o' $MAKE -e test
+$MAKE test exp='dlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o'
CONDITION1=true CONDITION2=false ./configure
-exp='dlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o' $MAKE -e test
+$MAKE test exp='dlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o'
CONDITION1=false CONDITION2=true ./configure
-exp='dlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o' $MAKE -e test
+$MAKE test exp='dlmaina1.c dlmainb2.c dlmaina1.o dlmainb2.o'
CONDITION1=false CONDITION2=false ./configure
-exp='dlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o' $MAKE -e test
+$MAKE test exp='dlmainb1.c dlmaina2.c dlmainb1.o dlmaina2.o'
:
#! /bin/sh
-# Copyright (C) 2002, 2003, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2011, 2012 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
.PHONY: test
test:
- test "`echo $(targ_OBJECTS)`" = "one.oo two.oo three.oo three2.oo"
+ is $(targ_OBJECTS) == one.oo two.oo three.oo three2.oo
END
$ACLOCAL
#!/bin/sh
-# Copyright (C) 2003, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2011, 2012 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
.PHONY: test1 test2
test1:
- test "`echo $(a_DEPENDENCIES)`" = "c0.o c1.o"
+ is $(a_DEPENDENCIES) == c0.o c1.o
test2:
- test "`echo $(a_DEPENDENCIES)`" = "c0.o c2.o c3.la"
+ is $(a_DEPENDENCIES) == c0.o c2.o c3.la
EOF
$ACLOCAL
#!/bin/sh
-# Copyright (C) 2003, 2006, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006, 2011, 2012 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
a_LDADD = $(BAR)
endif
-got = `echo $(a_DEPENDENCIES)`
test:
- test "$(exp)" = "$(got)"
+ is $(exp) == $(a_DEPENDENCIES)
.PHONY: test
EOF
$AUTOMAKE
./configure
-exp='foo.o nonsense.a' $MAKE -e test
+$MAKE test exp='foo.o nonsense.a'
./configure two=yes three=
-exp='bar.o' $MAKE -e test
+$MAKE test exp='bar.o'
./configure two=yes three=yes
-exp='baz.o' $MAKE -e test
+$MAKE test exp='baz.o'
:
#!/bin/sh
-# Copyright (C) 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2011, 2012 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
.PHONY: test
test:
- test "`echo $(SUBDIRS)`" = 'a b c d e f g h iXYZ jZYX'
+ is $(SUBDIRS) == a b c d e f g h iXYZ jZYX
EOF
mkdir a b c d e f g h iXYZ jZYX
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2010, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 1998, 2001, 2002, 2010, 2011, 2012 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
targ_SOURCES = main.c $(OPT1) $(OPT2)
-got = `echo $(targ_OBJECTS)`
-
.PHONY: test
test:
- test x"$(exp)" = x"$(got)"
+ is $(exp) == $(targ_OBJECTS)
END
$ACLOCAL
$AUTOCONF
CONDITION1=true CONDITION2=true ./configure
-exp='main.o one.o two.o' $MAKE -e test
+$MAKE test exp='main.o one.o two.o'
CONDITION1=true CONDITION2=false ./configure
-exp='main.o one.o' $MAKE -e test
+$MAKE test exp='main.o one.o'
CONDITION1=false CONDITION2=true ./configure
-exp='main.o two.o' $MAKE -e test
+$MAKE test exp='main.o two.o'
CONDITION1=false CONDITION2=false ./configure
-exp='main.o' $MAKE -e test
+$MAKE test exp='main.o'
:
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2010, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 1998, 2001, 2002, 2010, 2011, 2012 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
a b c d e f g h:
touch $@
-.PHONY: print-data
-print-data:
- echo BEG: $(help_DATA) :END
+.PHONY: test
+test:
+ is $(help_DATA) == a b c d e f g h
END
rm -rf autom4te*.cache
echo AC_OUTPUT >> configure.in
+touch aclocal.m4 # Avoid unnecessary firing the remake rules.
$AUTOCONF
$AUTOMAKE Makefile
./configure --prefix="`pwd`/_inst"
-$MAKE print-data >stdout || { cat stdout; Exit 1; }
-cat stdout
-grep '^BEG: a b c d e f g h :END$' stdout
+$MAKE test
$MAKE install
for x in a b c d e f g h; do
#! /bin/sh
-# Copyright (C) 2003, 2006, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006, 2010, 2011, 2012 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
# Make sure $(EXEEXT) is appended to programs and to tests that are
# programs, but not to @substitutions@.
-required=cc
. ./defs || Exit 1
cat >> configure.in << 'END'
AM_CONDITIONAL([COND], [test -n "$cond"])
AC_SUBST([programs], ['prg1$(EXEEXT) prg2$(EXEEXT)'])
-AC_PROG_CC
+AC_SUBST([CC], [whocares])
AC_OUTPUT
END
cat > Makefile.am << 'END'
-EXEEXT = .bin
+AUTOMAKE_OPTIONS = no-dependencies
+EXEEXT = .x
if COND
BAR = bar
DEP = bar
EXTRA_PROGRAMS = prg1 prg2 prg3
TESTS = prg1 prg3 prg4 $(BAZ)
-print-bin:
- @echo BEG: $(bin_PROGRAMS) :END
-print-extra:
- @echo BEG: $(EXTRA_PROGRAMS) :END
-print-tests:
- @echo BEG: $(TESTS) :END
-print-barbaz:
- @echo BEG: $(BAR) $(BAZ) :END
+.PHONY: test-cond test-nocond
+test-nocond:
+ is $(bin_PROGRAMS) == prg1.x prg2.x prg1.x prg2.x prg3.x
+ is $(EXTRA_PROGRAMS) == prg1.x prg2.x prg3.x
+ is $(TESTS) == prg1.x prg3.x prg4
+test-cond:
+ is $(bin_PROGRAMS) == prg1.x prg2.x prg1.x prg2.x prg3.x bar.x baz.x
+ is $(EXTRA_PROGRAMS) == prg1.x prg2.x prg3.x
+ is $(TESTS) == prg1.x prg3.x prg4 baz.x bar.x
+ is $(BAR) $(BAZ) == bar baz bar
END
$ACLOCAL
$AUTOCONF
$AUTOMAKE --add-missing --copy
+
./configure
-$MAKE print-bin > output
-cat output
-$FGREP 'prg1.bin prg2.bin prg1.bin prg2.bin prg3.bin' output
-$MAKE print-extra > output
-cat output
-$FGREP 'prg1.bin prg2.bin prg3.bin' output
-$MAKE print-tests > output
-cat output
-$FGREP 'prg1.bin prg3.bin prg4' output
+$MAKE test-nocond
./configure cond=yes
-$MAKE print-bin > output
-cat output
-$FGREP 'prg1.bin prg2.bin prg1.bin prg2.bin prg3.bin bar.bin baz.bin' output
-$MAKE print-tests > output
-cat output
-$FGREP 'prg1.bin prg3.bin prg4 baz.bin bar.bin' output
-$MAKE print-barbaz > output
-cat output
-$FGREP 'bar baz bar' output
+$MAKE test-cond
# Only two am__EXEEXT_* variables are needed here: one for BAR, and one
# BAZ. The latter must use the former.
test 2 = `grep '__EXEEXT_. =' Makefile.in | wc -l`
grep 'am__EXEEXT_2 = .*am__EXEEXT_1' Makefile.in
+
+:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
+
+# Test that two whitespace-separated lists are equal.
+# Assumes the two lists are passed on the command line separated by
+# a '==' string.
+# This script is useful to test equality of lists in makefile rules,
+# in the face of variables defined through line-continuations,
+# automake rewrites and expansions of empty variables.
+
+set -e
+set -u
+
+# Initialize before unsetting, for shells (like older bash or Solaris
+# ksh) that fail to unset variables that are already unset.
+exp= got=; unset exp got
+seen_eqeq=no
+while test $# -gt 0; do
+ if test x"$1" = x"=="; then
+ if test $seen_eqeq = no; then
+ seen_eqeq=yes
+ else
+ echo "$0: more than one '==' argument seen on command line" >&2
+ exit 2
+ fi
+ else
+ if test $seen_eqeq = no; then
+ got=${got+"$got "}$1
+ else
+ exp=${exp+"$exp "}$1
+ fi
+ fi
+ shift
+done
+
+if test $seen_eqeq = no; then
+ echo "$0: no '==' argument seen on command line" >&2
+ exit 2
+fi
+
+test x"${exp-}" = x"${got-}"
.PHONY: test
test:
- test '$(foo_OBJECTS)' = 'foo.fasl'
- test '$(zardoz_OBJECTS)' = 'mu1.fasl mu2.fasl'
+ is $(foo_OBJECTS) == foo.fasl
+ is $(zardoz_OBJECTS) == mu1.fasl mu2.fasl
END
$ACLOCAL
#! /bin/sh
-# Copyright (C) 2003, 2006, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006, 2011, 2012 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
.PHONY: test
test:
- test '$(check_PROGRAMS)' = a.bin
- test '$(bin_PROGRAMS)' = 'b.bin c'
- test '$(noinst_PROGRAMS)' = 'zardoz.bin maude.bin'
+ is $(check_PROGRAMS) == a.bin
+ is $(bin_PROGRAMS) == b.bin c
+ is $(noinst_PROGRAMS) == zardoz.bin maude.bin
END
$ACLOCAL
#! /bin/sh
-# Copyright (C) 2003, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2010, 2011, 2012 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
# Test for bug in variable substitution references, where
# undefined variables break later substitutions.
-required=cc
. ./defs || Exit 1
cat >> configure.in << 'END'
-AC_PROG_CC
+AC_SUBST([CC], [whocares])
AC_OUTPUT
END
cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = no-dependencies
foo = foo.a foo.b $(doesnt_exist)
bar = bar.a bar.b
foo_SOURCES = $(var2)
OBJEXT = obj
-echorule:
- @echo BEG: $(foo_OBJECTS) :END
+.PHONY: test
+test:
+ is $(foo_OBJECTS) == foo1.obj foo4.obj bar3.obj bar4.obj
END
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
./configure
-$MAKE echorule >output || { cat output; Exit 1; }
-cat output
-$FGREP 'BEG: foo1.obj foo4.obj bar3.obj bar4.obj :END' output
+$MAKE test
:
# pattern is null.
# Report from Richard Boulton.
-required=cc
. ./defs || Exit 1
cat >> configure.in << 'END'
-AC_PROG_CC
+AC_SUBST([CC], [whocares])
AC_OUTPUT
END
-cat > hello.c << 'END'
-END
+: > hello.c
cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = no-dependencies
var1 = dlmain
var2 = $(var1:=.)
helldl_SOURCES = $(var2:=c)
bin_PROGRAMS = helldl
-got:
- @echo $(helldl_SOURCES) $(helldl_OBJECTS) >got
+.PHONY: test
+test:
+ is $(helldl_SOURCES) $(helldl_OBJECTS) == dlmain.c dlmain.$(OBJEXT)
END
$ACLOCAL
$AUTOMAKE -a
./configure
-
-objext=`sed -n -e 's/^OBJEXT = //p' < Makefile`
-echo dlmain.c dlmain.$objext >exp
-$MAKE got
-cat got
-diff exp got
+$MAKE test
# This is unrelated to the rest of this test. But while we are
# at it, make sure we don't use am__helldl_SOURCES_DIST here, since
#! /bin/sh
-# Copyright (C) 2011 Free Software Foundation, Inc.
+# Copyright (C) 2011, 2012 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
TESTS = foo.sh mu.test foo.test foo.bar
.PHONY: verify
verify:
- test "`echo $(TEST_LOGS)`" = 'foo.log mu.log foo.log foo.log'
+ is $(TEST_LOGS) == foo.log mu.log foo.log foo.log
END
$ACLOCAL