From 1ed48303b1c6f7a086a60b3b99bfafc25fbde3aa Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Fri, 24 Jun 2011 10:14:30 +0200 Subject: [PATCH] tests: make 'subst-no-trailing-empty-line.test' more robust * tests/subst-no-trailing-empty-line.test: Strengthen existing checks, to try more scenarios and be slightly stricter in some grepping checks. --- ChangeLog | 7 +++++++ tests/subst-no-trailing-empty-line.test | 18 +++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 37f029c75..26e43d393 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-06-24 Stefano Lattarini + + tests: make 'subst-no-trailing-empty-line.test' more robust + * tests/subst-no-trailing-empty-line.test: Strengthen existing + checks, to try more scenarios and be slightly stricter in some + grepping checks. + 2011-06-24 Stefano Lattarini tests: fix an incomplete comment diff --git a/tests/subst-no-trailing-empty-line.test b/tests/subst-no-trailing-empty-line.test index a970174ca..c638b5428 100755 --- a/tests/subst-no-trailing-empty-line.test +++ b/tests/subst-no-trailing-empty-line.test @@ -47,8 +47,11 @@ AUTOMAKE_OPTIONS = no-dependencies CC = false EXEEXT = +## The "x" and "zardoz" strings and the use of '+=' are there to ensure +## that these variables get rewritten by Automake. noinst_PROGRAMS = x @$v1@ @$v2@ @$v3@ -bin_PROGRAMS = @A@ mu @$v2@ @$v3@ +bin_PROGRAMS = @A@ +bin_PROGRAMS += @$v1@ @$v2@ @$v3@ check_PROGRAMS = zardoz \$(noinst_PROGRAMS) ## Required whenever there are @substituted@ values in the @@ -67,13 +70,14 @@ $AUTOMAKE # For debugging. $EGREP -n 'ABCD|am__empty' Makefile.in # Sanity check. -test `$EGREP -c "^[ $tab]*@$v2@ @$v3@[ $tab]*$bs?$" Makefile.in` -eq 2 +test `$EGREP -c "^[ $tab]*@$v2@ @$v3@[ $tab]*$bs?$" Makefile.in` -eq 3 ./configure { - sed -n '/^noinst_PROGRAMS =/,/[^\\]$/p' Makefile - sed -n '/^bin_PROGRAMS =/,/[^\\]$/p' Makefile - sed -n '/^check_PROGRAMS =/,/[^\\]$/p' Makefile + sed -n '/^noinst_PROGRAMS *=/,/[^\\]$/p' Makefile + sed -n '/^bin_PROGRAMS *=/,/[^\\]$/p' Makefile + sed -n '/^check_PROGRAMS *=/,/[^\\]$/p' Makefile + sed -n '/^am__EXEEXT.*=/,/[^\\]$/p' Makefile } >t-programs cat t-programs grep '^ *$' t-programs && Exit 1 @@ -81,13 +85,13 @@ grep '^ *$' t-programs && Exit 1 $MAKE print-programs >stdout || { cat stdout; Exit 1; } cat stdout grep '^BEG1: x :END1$' stdout -grep '^BEG2: mu :END2$' stdout +grep '^BEG2: :END2$' stdout grep '^BEG3: zardoz x :END3$' stdout am__empty=X $MAKE -e print-programs >stdout || { cat stdout; Exit 1; } cat stdout grep '^BEG1: x X :END1$' stdout -grep '^BEG2: mu X :END2$' stdout +grep '^BEG2: X :END2$' stdout grep '^BEG3: zardoz x X :END3$' stdout : -- 2.47.2