This is the mail archive of the
frysk@sourceware.org
mailing list for the frysk project.
Re: generating type tests
- From: Andrew Cagney <cagney at redhat dot com>
- To: Stan Cox <scox at redhat dot com>
- Cc: Frysk List <frysk at sourceware dot org>
- Date: Fri, 12 Oct 2007 18:52:56 -0400
- Subject: Re: generating type tests
- References: <1192223570.2947.145.camel@multics.rdu.redhat.com>
My hunch it is trying to do too much - simultaneously acting as both
filter and generator. For instance:
-> structs is created from a brute force table
-> scalars is generated using a for loop
would it be better to separate these steps out, perhaps also having a
separate data file, then this can be implemented as one or more filters.
As things advance, will the types that need to be tested become too
complex for this scripting technique? For instance:
struct foo { int i; } f = { 1 };
struct bar { struct foo* f; struct bar *b;};
struct bar b = { NULL, NULL }
struct bar bp = { &f, &b };
I wonder if letting the user describe the types in C, and output in
comments, and then filter that to generate the tests is better? Vis:
// TEST: bp
// TYPE: struct bar { struct foo *f; struct bar *b}
// VALUE: { 0x.*, 0x.* }
// STYPE: struct bar
is going to be easier to work on. Similarly, chosing simple values may
make it easier.
Andrew