Re: PATCH: More improvements for DejaGnu internal unit tests

Ben Elliston <[email protected]>
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <20181207104947.GA28610@bapbop>
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

_______________________________________________
DejaGnu mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/dejagnu
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEFS8+rdM1/2KWERKFZ9rcPj90NkkFAlwKUEkACgkQZ9rcPj90
NkkRZhAAmSaDOeKR5qq//a7Lf1epYse6lAbYXdS/EhLifQ7uF/RtoplcxsBipkYe
8E3r4wJfshXFMsLgCePup+dmSheEsJvnz/JI2VShM3K1da616lS5u1FADYjVb7VY
ogH9iqQdzT9NmQ1YTnufPNtnmFJfkbUarmm7TVmlpKbstWao406zBtP3WbdsWPCZ
Eow71AmSPOgzMpEY3HqchUqe7c3Ob4VG+EuPN3x0YyGKXOL6BDQVx8ONJxuW6gSL
7VWRbhN+vThNilCP3JXE9CDbq0k4X7ENCS2edUMqZNvHx4+5BOxAML4txbfoM6GM
IbYHhQghH8VbSHuYJtu75QxwNHmv0+/GINHMByt4+cLzMTPsKVDFIEDnORcKMHEh
8O/qjNqtkukarWjDNAmFC+F93qqrdNEusxC0+1ONxYaQvDDFIVlMU59u11/5N54m
p88svHsWgzg0D004lCBohMkvhp1fVByPDC8beLu7M3MacxGZ8JzExQ68kWtZA6fK
05kth2cvpgthCiwG+ftke4YlFB5c+edfeMyd7kawxypBUEj8anTHpJX2xi0m9qfN
iCFZOjORQJEL8gP1/6G5ks7/PNo6Tgq7yeoPH60yw4xIC1g2KEIG8cYyUwpRkoM0
0oJDbM0vNhr1UvSXf6H8tQ+vAORoUHxhol/l/Cd0fFWMHcF6BL0=
=SL2v
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.