This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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: testcase for "absolute source" patch


Hello Michael,

here is the new version.

On Tue, Aug 31, 2004 at 11:02:02AM -0400, Michael Chastain wrote:
> . ChangeLog entry

	* gdb.base/openp.c: New testcase.
	* gdb.base/openp.exp: New testcase checking for source, binary
	and compilation directory handling.


> . error checking on calls to remote_exec
> . gdb_suppress_entire_file is rotten and obsolete.
> . the convention for gdb_start and gdb_exit is to assume that the
>   previous test script left a gdb running and to call gdb_exit
>   first, followed by gdb_start.
> . in test_src, drop the semicolons here:
> . don't bother to do "remote_exec host rm $srcfile"

Done.


> . in test_bin, don't move the file back and forth -- just copy
>   the file and then leave the copy in place.  disk space is cheap,
>   and "mv $binfile $bin_dir ... $mv $bin_dir/$binname $binfile"
>   is vulnerable to cascade failures when you call test_bin 13
>   times in a row and one of them might de-synchronize.
>   same with test_src.
> 
>   Or am i missing something and it will screw up some tests if
>   you let the prime copies of $srcfile and $binfile exist
>   all the time?

All tests verify whether gdb finds (doesn't find) the files as expected.
To achieve that, we place them in some specific locations, such as
compilation directory, $PATH, gdb source path ("directory" command),
etc. The files from previous tests could cause false failures for the
tests where gdb is supposed not to find the file (all tests with '-'),
or false passes for the tests where gdb could find the wrong file (e.g.,
in the compilation directory rather than in the source path).

Actually, I hadn't moved the files around as I first started writing the
test; I just had been removing the files before a test if it was
necessary. However, the tests were depending on the state left from the
previous one, thus making the process of modifying and adding new tests
very difficult: to add the 14th test, you have to trace the first 13
ones. That is why I decided to delete all files after each test, thus
making the tests independent of each other. It might seem difficult to
debug at the first glance, but it is easily trackable from the log once
you know that each test expects to find the directory hierarchy in some
"standard" state (created til the line 206, just before the first
test_bin) and has to leave it in the same state. This greatly simplifies
both debugging and maintenance.


With kind regards,
Baurjan.

Attachment: openp.exp
Description: Text document

int main(){return 0;}

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