Anteru's blog
  • Consulting
  • Research
    • Assisted environment probe placement
    • Assisted texture assignment
    • Error Metrics for Smart Image Refinement
    • High-Quality Shadows for Streaming Terrain Rendering
    • Hybrid Sample-based Surface Rendering
    • Interactive rendering of Giga-Particle Fluid Simulations
    • Quantitative Analysis of Voxel Raytracing Acceleration Structures
    • Real-time Hybrid Hair Rendering
    • Scalable rendering for very large meshes
    • Subpixel Reconstruction Antialiasing
    • Tiled light trees
  • About
  • Archive

Automatic consistency checking

May 24, 2007
  • Programming
approximately 2 minutes to read

Yesterday evening I slapped together a small tool for consistency checking of large codebases. It’s written in a similar spirit as Boost’s inspect tool, just slightly more sophisticated. Written in C#, it allows you to plug in your own checks easily. At the moment, I have a generic RegEx checker (just looks if a regular expression matches) and a line ending checker in my core tests and a bunch of niven specific ones (license, interfaces with struct and not with class, file header, @file comment in header matches file name, include guards are not reused, missing @author, outdated mail addresses). Some example output:

Loading checker from 'Checks'
         .. 'CrLfCheck'
 .. 1 checker loaded
Loading checker from 'nivenChecks'
         .. 'CheckFileHeader'
         .. 'OutdatedMailAnteru'
         .. 'AuthorCheck'
         .. 'IncludeGuards'
         .. 'StructInterfaces'
         .. 'FilenameInHeader'
 .. 6 checker loaded

Extensions:
        'cpp'
        'h'

Running checks for 'archive.h'
 ++ OK  ... 0 failures

...

Running checks for 'core.h'
    Include guards      : Include guard already used
        >> Line: 9: The include guard 'NIV_CORE_H' has been already used
    Interfaces          : Interface defined with 'class'
        >> Line: 17: Interface 'IFileSystem' uses 'class' instead of 'struct'
 -- FAILED  ... 2 failures

...

39 failures (101 files total)

It was written against the .NET Framework 2.0, but it should work with Mono as well. On startup, it loads up your assembly and pulls the checks out of it, so it’s really easy to extend. I’m running it now along with the build to see which files need some attention. By the way, anonymous comments are enabled, so you can tell me what features would you like to see from such a litte helper?

Previous post
Next post

Recent posts

  • Five years of GPU DB
    Posted on 2020-09-27
  • Enabling SSL in your local network
    Posted on 2020-05-17
  • Goodbye, Bitbucket!
    Posted on 2020-03-19
  • QEMU, KVM and trim
    Posted on 2020-01-26
  • Fixing network after Ubuntu 19.04 to 19.10 upgrade
    Posted on 2019-10-26
  • Older posts

Find me on the web

  • GitHub
  • GPU database
  • Projects

Follow me

NIV_Anteru

Contents © 2005-2021 | Anteru | Imprint/Impressum | Privacy policy/Datenschutz