@test ?

Events happening in the community are now at Drupal community events on www.drupal.org.
catch's picture

A question which a bunch of people asked at Drupalcon (including me) was how to know which modules and functions have tests (and which don't). This is useful both for computing test coverage and for knowing where to focus efforts as we try to build initial coverage for core.

There are tools which do % of test coverage, but according to the BOF today, they tell you line numbers rather than functions - a useful metric but not perfect.

What I'd propose is we add @test to functions with a pointer to the unit test (and in modules where @file is for functional tests). This will allow both for api.module to show references to tests for function listings (and link directly to them as part of the documentation) - and also make it easy to list functions/modules with and without tests. It'd also work equally well for contrib. Posting it here rather than as an issue since although a couple of people I mentioned this to thought it was a decent idea, I think we'd need to spec it out a little (what to do if a function has 20 different unit tests associated with it for example?). If it's worth doing, it'd be good to get it in as quickly as possible so that we can document test coverage as tests actually get written.

Testing and Quality Assurance

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: