First Mails to GNU project(DejaGnu) Maillist

目录 开源

A suggestion on DejaGnu testing framework. Today’s Topics:

1. Why not add tests order control to Dejagnu, I find a way.
(wenbo.yang@simplnano.com)
2. Re: Why not add tests order control to Dejagnu, I find a way.
(Stefan Reinauer)
3. Re: Why not add tests order control to Dejagnu, I find a way.
(wenbo.yang@simplnano.com)

----------------------------------------------------------------------

Message: 1
Date: Thu, 14 Dec 2006 12:28:18 +0800
From: <wenbo.yang@simplnano.com>
Subject: Why not add tests order control to Dejagnu, I find a way.
To: <dejagnu@gnu.org>
Cc: bje@gnu.org, rob@welcomehome.org
Message-ID: <002201c71f38$4ade22d0$7e01a8c0@parttime01pc>
Content-Type: text/plain; charset="gb2312"

My work needs to test some cases before others, but I found Dejagnu didn’t support it. It tests cases according to their directory order only. So I modified runtest.exp to achieve my tests order control. My code is not very mature, but it is a way. So I think this feature is valueable to some people of special requests, why not add it to Dejagnu framework?

Explanation of my method:

If there exists file "priority.seq" in test source directory, test cases specified in that file will be done first and orderly. After done them, others should be done. Here is an example content of "priority.seq":

third/third.exp
./second/second.exp
./first/first.exp

Bellow are changes in "runtest.exp", my version is 1.4.99:

diff runtest.exp original_src/runtest.exp

1791,1834d1790
<
< # If exist priority.seq, read it to priorities list orderly.
< if { [file exists $srcdir/priority.seq] } {
< set sequence_file [open $srcdir/priority.seq RDONLY]
< foreach line [split [read $sequence_file]
] {
< if { [file exists $srcdir/$line ] } {
< lappend priorities $line
< } else {
< warning "$srcdir/$line does not exist. Please check $srcdir/priority.seq for error entries."
< }
< }
< close $sequence_file
< }
<
< # Run these *.exp files in priorities list first.
< if { $priorities != "" } {
< foreach test_name $priorities {
< if { ${ignoretests} != "" } {
< if { 0 <= [lsearch ${ignoretests} [file tail ${test_name}]]} {
< continue
< }
< }
<
< # set subdir to the tail of the dirname after $srcdir,
< # for the driver files that want it. XXX this is silly.
< # drivers should get a single var, not "$srcdir/$subdir"
< set subdir [file dirname $test_name]
< set p [expr {[string length $srcdir] - 1}]
< while {0 < $p && [string index $srcdir $p] == "/"} {
< incr p -1
< }
< if {[string range $subdir 0 $p] == $srcdir} {
< set subdir [string range $subdir [expr {$p + 1}] end]
< regsub "^/" $subdir "" subdir
< }
<
< # XXX not the right thing to do.
< set runtests [list [file tail $test_name] ""]
<
< runtest $test_name
< lappend ignoretests [file tail $test_name]
< }
< }
<

Wenbo Yang
2006-12-14
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.gnu.org/pipermail/dejagnu/attachments/20061214/420181aa/attachment.html

------------------------------

Message: 2
Date: Thu, 14 Dec 2006 10:36:07 +0100
From: Stefan Reinauer <stepan@coresystems.de>
Subject: Re: Why not add tests order control to Dejagnu, I find a way.
To: wenbo.yang@simplnano.com
Cc: dejagnu@gnu.org, bje@gnu.org, rob@welcomehome.org
Message-ID: <20061214093607.GA21407@coresystems.de>
Content-Type: text/plain; charset=utf-8

* wenbo.yang@simplnano.com <wenbo.yang@simplnano.com> [061214 05:28]:
> My work needs to test some cases before others, but I found Dejagnu didn’t
> support it. It tests cases according to their directory order only. So
> I modified runtest.exp to achieve my tests order control. My code is not very
> mature, but it is a way. So I think this feature is valueable to some people of
>

This sounds interesting! To work around this "shortcoming" I was writing
all tests that require sequential execution into a single file. Another
method might be to call files and directories 01_*, 02_* ...

--
coresystems GmbH â?¢ Brahmsstr. 16 â?¢ D-79104 Freiburg i. Br.
Tel.: +49 761 7668825 â?¢ Fax: +49 761 7664613
Email: info@coresystems.de â?¢ http://www.coresystems.de/

------------------------------

Message: 3
Date: Thu, 14 Dec 2006 18:31:15 +0800
From: <wenbo.yang@simplnano.com>
Subject: Re: Why not add tests order control to Dejagnu, I find a way.
To: "Stefan Reinauer" <stepan@coresystems.de>
Cc: dejagnu@gnu.org, bje@gnu.org, rob@welcomehome.org
Message-ID: <005201c71f6b$0c5aafa0$7e01a8c0@parttime01pc>
Content-Type: text/plain; charset="utf-8"

But even if you call files and directories by sequential numbers, you can not test it crossingly( I do not know if this word is proper.)
I mean, take a case for example. You have a directory tree like that:

01_xx/01_yy/01.exp
01_xx/02_zz/02.exp
02_aa/01_bb/03.exp
02_aa/02_cc/04.exp

You now have a sequence: 01.exp,02.exp,03.exp,04.exp. But mybe at one point you have follow another order 03.exp,01.exp,04.exp,02.exp. You must change the whole directory tree, at most times, it is not really you want.

So if you have a file specified the priority with no dependence on directory, you can do what you wish just by changing some entries. It is why I said this feature is valueable for some people like you and me. A lot of no sense working should be avoided.

Wenbo Yang

SimpLight Nanoelectronics, LTD.
Email: wenbo.yang@simplnano.com
------------------------------

_______________________________________________
DejaGnu mailing list
DejaGnu@gnu.org
http://lists.gnu.org/mailman/listinfo/dejagnu

End of DejaGnu Digest, Vol 43, Issue 2
**************************************

Copyright © 2005-2006 Solrex Yang. Under GFDL.

长按识别二维码关注《边际效应》
长按识别二维码关注《边际效应》

暂无评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注