From 06f0fe1d40a58f6ba651b68caa04c179942c8068 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sun, 24 Jan 2010 14:56:43 +0100 Subject: [PATCH] Check that all directories are documented. * src/sanity/readme.test: For each AC_OUTPUT Makefile, check that the directory is documented in README. Also skip non distributed directories in readme.test. * README: Fit on 80 columns. --- ChangeLog | 8 ++++++ README | 2 +- src/sanity/readme.test | 55 +++++++++++++++++++++++++++++++++++++----- 3 files changed, 58 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index da9c95489..284b8f62f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2010-01-24 Alexandre Duret-Lutz + Check that all directories are documented. + + * src/sanity/readme.test: For each AC_OUTPUT Makefile, check that + the directory is documented in README. Also skip non distributed + directories in readme.test. + * README: Fit on 80 columns. + +2010-01-24 Alexandre Duret-Lutz * README: Typo. 2010-01-24 Alexandre Duret-Lutz diff --git a/README b/README index e7eb4eb88..6dce86120 100644 --- a/README +++ b/README @@ -114,7 +114,7 @@ src/ Sources for libspot. sanity/ Sanity tests for the whole project. doc/ Documentation for libspot. spot.html/ HTML reference manual. - spot.latex/ Sources for the PDF manual. (Not distributed, can be rebuilt.) + spot.latex/ Sources for the PDF manual. (Not distributed, can be rebuilt.) spotref.pdf PDF reference manual. bench/ Benchmarks for ... emptchk/ ... emptiness-check algorithms, diff --git a/src/sanity/readme.test b/src/sanity/readme.test index 553ee9489..89e10e2ce 100755 --- a/src/sanity/readme.test +++ b/src/sanity/readme.test @@ -1,15 +1,38 @@ #! /usr/bin/perl -w # -*- cperl -*- - -# Check that all the directories in the README exist. +# +# Copyright (C) 2010 Laboratoire de Recherche et Développement de +# l'Epita (LRDE). +# +# This file is part of Spot, a model checking library. +# +# Spot is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Spot is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +# License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Spot; see the file COPYING. If not, write to the Free +# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# +# Check that all the directories documented in README exist, and that +# all directories listed in configure.ac are documented. +# # Also has an option --list to print directories which are -# documented in the README. +# documented. use strict; use warnings; local $\ = "\n"; my $top_srcdir = $ENV{top_srcdir} || "../../"; +my $top_srcdir_len = length($top_srcdir) + 1; my $list_mode = ($#ARGV != -1 && $ARGV[0] eq "--list"); unless (-f "$top_srcdir/README") @@ -18,12 +41,17 @@ unless (-f "$top_srcdir/README") exit 2; } -open(FD, "$top_srcdir/README"); +open(FD, "$top_srcdir/README") + or die "$!: cannot open $top_srcdir/README"; my @directory = (); my $exit_status = 0; +my %documenteddirs; + while () { + # Skip non-distributed directories. + next if /Not distributed/i; # We consider Third party software? # last if (/^Third party software$/); next unless (m{^(\s*)(\S+/)\s+}); @@ -37,15 +65,17 @@ while () # Use globbing on the filename. for my $directory (glob("$top_srcdir/$filename")) { + my $striped = substr($directory, $top_srcdir_len); + $documenteddirs{$striped} = 1; if ($list_mode) { - print "$directory"; + print "$striped"; } else { unless (-d $directory || -f $directory) { - print STDERR "$directory does not exist."; + print STDERR "$directory mentioned in README does not exist."; $exit_status = 1; } } @@ -54,4 +84,17 @@ while () close(FD); +open(FD, "$top_srcdir/configure.ac") + or die "$!: cannot open $top_srcdir/configure.ac"; +while () +{ + next unless m{\s*(\S+/)Makefile}; + unless (exists $documenteddirs{$1}) + { + print STDERR "$1 directory undocumented in README."; + $exit_status = 1; + } +} +close(FD); + exit $exit_status;