Patch to fixinc/inclhack.def *_quotes_def select pattern too strict
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Fri Jun 16 14:15:00 GMT 2000
> From: Bruce Korb <bkorb@sco.COM>
>
> "Kaveh R. Ghazi" wrote:
> > > IFF you augment the test, too. :-)
> > > I'll get around to fixing up the test results in a couple weeks.
> > > - Bruce
> >
> > I'll happily do that, but how would you like me to augment the test?
> >
> > The problem is that the CTRL test_text already has both single and
> > multi argument macros which masked the problem in the select pattern.
> > The pattern matched just one of the macros and that was enough to run
> > the c_fix on both.
> >
> > It might be a design flaw in the testsuite's ability to validate
> > select patterns, unless there is a way to run the select pattern on
> > just one macro of the test_text at a time. (?)
>
> It should fix all the broken entries found.
Running "make check" currently works, even on single argument macros.
But it does so *by accident*.
> If it misses any, it should be caught via visual inspection
> before the results are added into the expected output tree.
It doesn't miss any *in the test_text*.
> Therefore, the MUMBLEd entry below should be seen as
>
> #define MUMBLE_CTRL(n) ((n<<8)+MUMBLE_ID)
>
> in the correct result file. It should work just fine.
>
> > test_text = "#define BSD43_CTRL(n, x) (('n'<<8)+x)\n"
> + "#define MUMBLE_CTRL(n) (('n'<<8)+MUMBLE_ID)\n"
Right, the CTRL test_text already contains an entriy like this:
test_text = "#define BSD43_CTRL(n, x) (('n'<<8)+x)\n"
"#define _CTRL(c) ('c'&037)";
The old select pattern matched on the BSD43_CTRL and passed them both
on to the c_fix, which ended up fixing both.
On Sunos, only the _CTRL(c) variation appears in one of the headers.
Without a multi-argument macro to match the select pattern, it gets
bypassed.
So in short "make check" fixed both cases in the test_text. But
fixincl run on headers with only single argument CTRL macros won't
work.
Since the test_text already has a single argument CTRL macro, and it
gets fixed, I don't know what more to add to it. What we'd need to do
is to somehow test each the individual macro and make sure the select
pattern recognizes the macros seperately. I don't know how to do that
in your framework.
> But also, yes, there may be cases where tests must be performed
> on completely separate files. In those cases, a secondary (or more)
> "test_text" entry will exercise some untested code :-).
> See the "check.tpl" file.
The "check.tpl" file is complete gobbledygook to me.
I tried taking the existing two cases in the test_text for
ctrl_quotes_def into two test_text entries for that fix. E.g.:
--- inclhack.def~ Fri Jun 16 17:00:28 2000
+++ inclhack.def Fri Jun 16 17:07:48 2000
@@ -891,8 +891,8 @@ fix = {
select = "define[ \t]+[A-Z0-9_]+CTRL\\([a-zA-Z],";
c_fix = char_macro_def;
c_fix_arg = "CTRL";
- test_text = "#define BSD43_CTRL(n, x) (('n'<<8)+x)\n"
- "#define _CTRL(c) ('c'&037)";
+ test_text = "#define BSD43_CTRL(n, x) (('n'<<8)+x)\n";
+ test_text = "#define _CTRL(c) ('c'&037)";
};
fix = {
But when I run "make check", I get:
> autogen -T ../../../egcs-CVS20000615/gcc/fixinc/check.tpl
> ../../../egcs-CVS20000615/gcc/fixinc/inclhack.def
> autogen Expression error in
> ../../../egcs-CVS20000615/gcc/fixinc/check.tpl on line 58
> invalid expression Cannot find function: A-Z
> make: *** [check] Error 1
So I cannot understand what you want me to do. I went ahead and
checked in the patch. If there still is additional test_text you want
me to add, please help me understand better why you think so. IMO, we
don't need more entries, we need a way to operate the select pattern
on each entry individually. If there already is a way to do that
please point out specifically how cause I don't see it.
Thanks,
--Kaveh
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Qwest Internet Solutions
More information about the Gcc-patches
mailing list