2 # Copyright (C) 2006-2009, Parrot Foundation.
7 use lib qw( . lib ../lib ../../lib );
8 use Test::More tests => 1;
9 use Parrot::Distribution;
13 t/codingstd/c_todo.t - checks for "FIXME" and similar notes in C source and headers
18 % prove t/codingstd/c_todo.t
21 % perl t/codingstd/c_todo.t src/foo.c include/parrot/bar.h
25 Checks that no C source or header file in the distribution contains the
34 L<docs/pdds/pdd07_codingstd.pod>
38 my $DIST = Parrot::Distribution->new;
39 my @files = @ARGV ? <@ARGV> : $DIST->get_c_language_files();
43 foreach my $file (@files) {
45 # if we have command line arguments, the file is the full path
46 # otherwise, use the relevant Parrot:: path method
47 my $path = @ARGV ? $file : $file->path;
49 open my $fh, '<', $path
50 or die "Cannot open '$path' for reading: $!\n";
53 next unless /(FIXME|XXX|TODO)/;
55 push @fixme, "file '$path', line $.: $1\n";
56 $failed_files{$path}++;
61 my $num_failed_files = scalar keys %failed_files;
63 local $TODO = scalar(@fixme) . ' todos remain';
65 ok( !scalar(@fixme), 'FIXME strings' )
66 or diag( "FIXME strings found in "
70 . " files:\n@fixme" );
75 # cperl-indent-level: 4
78 # vim: expandtab shiftwidth=4: