https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116163

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sjames at gcc dot gnu.org

--- Comment #2 from Sam James <sjames at gcc dot gnu.org> ---
(Thank you!)

So far, there's a few classes of problem:
1) Hyphen typos like 'dg-run', 'dg-compile', ...
2) Underscore typos like 'dg_final'
3) Bad ordering of directives (e.g. 'dg-add-options' vs 'dg-options')
4) Missing whitespace like '{ dg-do run}'
5) Tests in wrong directory (either: 1) wrong filename like .C for g++.dg or 2)
sometimes even in a directory where it'll do nothing at all & no other tests
are in there)
6) Tests which are clearly meant to be executable but missing 'dg-do run'

We may want to take a few approaches:
* Add trap directives which mark the test as ERROR if one of them is used
* Script which checks that if a directive is in a file, it's always
before/after another type of directive
* Make dejagnu scream if it encounters an unrecognised directive?
* Make dejagnu scream if it looks _almost_ like a directive but isn't (like the
whitespace case above) (this really depends on how it parses)
* Check in *.exp for certain file suffixes (use glob and error if something
unexpected is matched or w/e)
* Shepherd new tests into .execute/.compile-style suffix directories as some
dirs already do so intent is explicit (not sure how helpful this will be)

Stuff we especially need ideas for:
* re 4) (missing whitespace), this feels easy for the obvious cases but the
others have relied on me grepping various known directives. Should we just keep
a running list of known directives? 
* re 6) (obviously should be executed but no marker), I have no idea how to
handle that (semi-)automatically yet. I've been relying on hacky heuristics
looking for '(__builtin_?){abort,exit}' and so on and reading a *lot* of tests
manually. Sometimes I have to make a judgement call on what people intended.

Am I missing any other categories people can think of? Any ideas on detection
or heuristics?

Reply via email to