dejagnu
[Top][All Lists]
Advanced

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

Re: PATCH: More improvements for DejaGnu internal unit tests


From: Ben Elliston
Subject: Re: PATCH: More improvements for DejaGnu internal unit tests
Date: Fri, 7 Dec 2018 21:49:50 +1100
User-agent: Mutt/1.9.4 (2018-02-28)

On Fri, Dec 07, 2018 at 12:03:21AM -0600, Jacob Bachmeyer wrote:

> This patch adds two procedures for use with the run_tests procedure
> in default_procs.tcl and adjusts the DejaGnu internal unit tests to
> actually use run_tests where applicable.  The new procedures allow
> run_tests to verify return values against regexps and to verify
> boolean return values.  The use of [subst {...}] as the parameter to
> run_tests allows variable and command substitutions to be performed
> on the list of tests in the calling context.

Thanks. This is excellent work. I had to make one small change to this
part of your patch:

> +run_tests [subst {
> +    { lib_pat_test getdirs
> +     {[file join ${srcdir} runtest.all]}
> +     [file join ${srcdir} runtest.all topdir]
> +     "getdirs toplevel, no arguments" }
> +    { lib_pat_test getdirs
> +     {[file join ${srcdir} runtest.all] "top*"}
> +     [file join ${srcdir} runtest.all topdir]
> +     "getdirs toplevel, one subdir" }
> +    { lib_pat_test getdirs
> +     {[file join ${srcdir} runtest.all topdir]}
> +     "*topdir*subdir1*topdir*subdir2"
> +     "getdirs toplevel, two subdirs" }
> +}]

The 'two subdirs' test was failing because, on my system anyway,
getdirs was returning the two subdirectories in opposite order to the
order expected in the test case. The Tcl man page for 'glob' confirms
that the glob order is not guaranteed.

Cheers,
Ben

Attachment: signature.asc
Description: PGP signature


reply via email to

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