This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bug in dg.exp prevents the usage of dg magic comments in the test suite


On Mon, Jan 03, 2005 at 03:30:34PM +0100, Björn Haase wrote:
> Hi,
> 
> when studying the proper use of dg magic comments, I have stepped over a bug 
> in the dg harness. In my opinion it is only by accident that this bug has not 
> crashed the test suite completely. 
>
> It seems that there has been a conversion from an "old" to a "new"  dg 
> framework. Some of the key procedures, however, seem still to assume that 
> variables are still having the content they used to have in the "old" 
> framework.
> E.g. one variable ${dg-do-what} used to be a list of two elements where 
> element #1 contained a string "F" "P" "N" reflecting whether the test is 
> supposed to pass, fail or skipped. Presently, however, this list has 3 
> members and the respective string is element #2!
> The proc that is used for the majority of the testsuite test cases (proc 
> dg-test in the file dg.exp of the dejagnu library) however still uses element 
> #1 of ${dg-do-what} for finding out what to do with the test case.

What kind of failures do you see?  Element 0 of dg-do-what is
preprocess/compile/run/whatever, element 1 is ""/S/N, and element
2 is P/F; these are used consistently in dg.exp.

> I therefore had to realize, that many of the magic comments within the test 
> cases do not work as intended for this reason. E.g. all of the magic comments 
> that are supposed to exclude testcases from compilation for the 6811 and 6812 
> targets do no longer work.

Which tests are these?  By "magic comments" do you mean the dg- directives
that appear within comments in the test file?

> You will find enclosed a patch that needs to be applied to dg.exp.
> 
> Difficult thing is: 
> The patch needs to be applied outside of the gcc source tree, i.e. within the 
> dejagnu sources. If I now start adapting the testsuite for being useful for 
> the avr target, it possibly might make the test suite crash for all the other 
> targets unless the one who is running the tests has also fixed the bug in the 
> dejagnu harness.
> 
> Any idea how to proceed?

First of all, Andreas had good comments about submitting a DejaGnu patch.

Secondly, the GCC project doesn't like to require a new version of some
other product (DejaGnu, in this case) unless there is a compelling reason
for it.

Thirdly, the patch does two things, not just the one described in your
mail; it also adds new functionality.  That new functionality is
already covered by dg-skip-if, with "*" for the first option list and
"" for the second.

Finally, it's not clear that there's a bug at all.

Janis


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]