org: Add link to the Python notebooks.
Fixes #100. * doc/org/tut.org: Link to the notebook. * src/sanity/ipynb.test: New test, to make sure we do not forget to document ipython notebook when we add some. * src/sanity/Makefile.am: Add it and run it. * NEWS: Mention it.
This commit is contained in:
parent
868cabe4f6
commit
21ff2d0415
4 changed files with 118 additions and 9 deletions
|
|
@ -1,6 +1,6 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
## Copyright (C) 2010, 2011, 2012, 2013, 2014 Laboratoire de Recherche
|
||||
## et Développement de l'Epita (LRDE).
|
||||
## Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire de
|
||||
## Recherche et Développement de l'Epita (LRDE).
|
||||
## Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
## département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
## et Marie Curie.
|
||||
|
|
@ -37,6 +37,10 @@ check-readme:
|
|||
top_srcdir='$(top_srcdir)' \
|
||||
$(PERL) $(srcdir)/readme.test
|
||||
|
||||
check-ipynb:
|
||||
top_srcdir='$(top_srcdir)' \
|
||||
$(PERL) $(srcdir)/ipynb.test
|
||||
|
||||
check-includes:
|
||||
CXX='$(CXX)' \
|
||||
CPPFLAGS='$(AM_CPPFLAGS) $(CPPFLAGS) $(DEFS)' \
|
||||
|
|
@ -45,10 +49,8 @@ check-includes:
|
|||
TOPBUILD='$(top_builddir)' \
|
||||
$(SHELL) $(srcdir)/includes.test $(TESTHEADER)
|
||||
|
||||
.PHONY: check-80columns check-style check-readme check-includes
|
||||
check-local: check-80columns check-style check-readme check-includes
|
||||
|
||||
|
||||
.PHONY: check-80columns check-style check-readme check-includes check-ipynb
|
||||
check-local: check-80columns check-style check-readme check-includes check-ipynb
|
||||
|
||||
# Ensure we have not forgotten to include an header.
|
||||
check-installed-includes:
|
||||
|
|
@ -68,4 +70,10 @@ check-installed-private:
|
|||
installcheck-local: check-installed-includes check-installed-private
|
||||
|
||||
CLEANFILES = failures incltest.*
|
||||
EXTRA_DIST = includes.test 80columns.test style.test readme.test private.test
|
||||
EXTRA_DIST = \
|
||||
80columns.test \
|
||||
includes.test \
|
||||
ipynb.test \
|
||||
private.test \
|
||||
readme.test \
|
||||
style.test
|
||||
|
|
|
|||
76
src/sanity/ipynb.test
Executable file
76
src/sanity/ipynb.test
Executable file
|
|
@ -0,0 +1,76 @@
|
|||
#! /usr/bin/perl -w
|
||||
# -*- cperl; coding: utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2010, 2015 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 3 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# 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.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
local $\ = "\n";
|
||||
my $top_srcdir = $ENV{top_srcdir} || "../../";
|
||||
my $top_srcdir_len = length($top_srcdir) + 1;
|
||||
|
||||
my $tut = "$top_srcdir/doc/org/tut.org";
|
||||
my $dir = "$top_srcdir/wrap/python/tests";
|
||||
unless (-f $tut)
|
||||
{
|
||||
print STDERR "$tut not found";
|
||||
exit 2;
|
||||
}
|
||||
|
||||
open(FD, "$tut") or die "$!: cannot open $tut";
|
||||
my $exit_status = 0;
|
||||
my %seen;
|
||||
while (<FD>)
|
||||
{
|
||||
if (m:\]\[([\w-]+\.ipynb)\]\]:)
|
||||
{
|
||||
# print "$1 documented";
|
||||
$seen{$1} = 1;
|
||||
unless (-f "$dir/$1")
|
||||
{
|
||||
print STDERR "notebook mentioned in tut.org does not exist";
|
||||
$exit_status = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
close(FD);
|
||||
|
||||
open(FD, "$dir/Makefile.am") or die $!;
|
||||
while (<FD>)
|
||||
{
|
||||
if (m:\s([\w-]+\.ipynb):)
|
||||
{
|
||||
# print "$1 exist";
|
||||
unless (exists $seen{$1})
|
||||
{
|
||||
print STDERR "notebook $1 is not mentioned in tut.org";
|
||||
$exit_status = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
close(FD);
|
||||
|
||||
exit $exit_status;
|
||||
Loading…
Add table
Add a link
Reference in a new issue