[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Test for DejaGnu support that runs DejaGnu [PATCH]

From: Alexandre Duret-Lutz
Subject: Re: Test for DejaGnu support that runs DejaGnu [PATCH]
Date: Mon, 14 Apr 2003 20:59:45 +0200
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.2 (gnu/linux)

>>> "Rich" == Richard Dawe <address@hidden> writes:

 Rich> Hello.
 Rich> Below is a ChangeLog and diff to add a test that runs DejaGnu.

Thanks for working on this.  I've a few improvements to suggest.

 Rich> Perhaps the check for 'runtest' in tests/defs should be a little
 Rich> more strict - perhaps it should grep for some string that
 Rich> 'runtest --version' outputs.

IMHO it's fine as is.  (Except for the locally inconsistent
spacing you used inside the parentheses -- I say "locally",
because this file is globally inconsistent anyway.)


 Rich> +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Rich> +# Boston, MA 02111-1307, USA.
 Rich> +

Each test case has a comment here, explaining what the test checks.

 Rich> +required=runtest
 Rich> +. ./defs || exit 1

Better add `set -e' here, so that the test aborts if $AUTOMAKE
(or any other command) fails.

(tests/README contains a sort of small checklist about such
things -- it's probably incomplete, but it's a start)

 Rich> +cat > hammer << 'END'
 Rich> +echo "Everything looks like a nail to me!"
 Rich> +END

Shouldn't shell scripts start with `#! /bin/sh'?

 Rich> +
 Rich> +chmod ug+x hammer

Is `ug' motivated by some dejagnu requirement?
I'd prefer `chmod +x hammer' for consistency with other tests.


 Rich> +cat > << 'END'
 Rich> +AUTOMAKE_OPTIONS = dejagnu
 Rich> +
 Rich> +DEJATOOL = hammer
 Rich> +END
 Rich> +
 Rich> +mkdir testsuite
 Rich> +mkdir testsuite/hammer.test
 Rich> +
 Rich> +cat > testsuite/hammer.test/hammer.exp << 'END'
 Rich> +set test test
 Rich> +expect {
 Rich> +Everything looks like a nail to me! { pass "$test" }
 Rich> +}
 Rich> +END
 Rich> +
 Rich> +$ACLOCAL
 Rich> +$AUTOMAKE --add-missing
 Rich> +
 Rich> +./configure
 Rich> +
 Rich> +$MAKE check

It would be nice to ensure that dejagnu was actually run by
`$MAKE check'.  Can you see a way to check for this?  Perhaps by
building a file during the dejagnu test case and checking for
this file afterwards?

Also, this seems a good occasion to make sure that dejagnu files
are cleaned appropriately.  There have been some longstanding
bug fixed in this area last year (grep ChangeLog.02 for; they would have been obvious if someone had written
a test case.  Calling `make distcheck' (in addition to `$MAKE
check') is probably a good way to check for cleaning, plus it
will also make sure that files are correctly distributed and
that VPATH builds work.
Alexandre Duret-Lutz

reply via email to

[Prev in Thread] Current Thread [Next in Thread]