From: "jerry gay" <[EMAIL PROTECTED]> Date: Sat, 28 Jul 2007 08:35:01 -0700
On 7/28/07, Bob Rogers <[EMAIL PROTECTED]> wrote: > As a step in that direction, is there an easy way to find out which > coding standards tests should be applied to a given source file? Some > have "c_*" names, which makes it seem pretty obvious . . . until you > consider *.pmc and *.ops files, which are "sorta C." > > I am asking because I just sat down to write a > M-x parrot-check-coding-standards command for Emacs, but realized that I > didn't know which tests to run. I could read the test code and hardwire > a mapping, but that would be wicked fragile. Is a naming convention > sufficient, or would we need a metacomment in the test file? Parrot::Distribution offers a number of subroutines which allow one to specify which subset of parrot files you wish to select for testing. this is built into the tests, and if everything is working as it should (and i believe it is,) it means that calling the proper function from this distribution will provide the proper subset of files (e.g. c_language_files.) I want to go in the other direction, i.e. what tests should I apply for a specific C source file, along the lines of the attached patch. It needs doc, of course, and the correctness of %tests_from_source_category is debatable, but that's the general idea. Beyond that, it would be nice if the tests themselves output something close to the standard "grep -n" output, i.e. "file:line:" at the start of each "hit" line. That way, if run under Emacs, the resulting output buffer could be put into grep-mode, which would make it easy to visit these "hits." Finally, it would be really nice if this could be run automatically from Emacs every time I save a Parrot source file. But it would have to run faster for that to work. > P.S. I have been having problems with getting parrot-porters to accept > my posts, so I don't expect this to appear on the list. received just fine :) Huh!? How could it be that you get a copy from the list and not me? I seem to be getting everybody else's posts . . . -- Bob