sanity: catch undocumented named properties
* tests/sanity/namedprop.test: New file. * tests/Makefile.am: Add it. * doc/org/concepts.org: Add documentation for degen-levels and simulated-states.
This commit is contained in:
parent
97f3efabe3
commit
93969758ee
3 changed files with 56 additions and 0 deletions
|
|
@ -1128,6 +1128,8 @@ Here is a list of named properties currently used inside Spot:
|
|||
| ~highlight-edges~ | ~std::map<unsigned, unsigned>~ | map of (edge number, color number) for highlighting the output |
|
||||
| ~highlight-states~ | ~std::map<unsigned, unsigned>~ | map of (state number, color number) for highlighting the output |
|
||||
| ~incomplete-states~ | ~std::set<unsigned>~ | set of states numbers that should be displayed as incomplete (used internally by ~print_dot()~ when truncating large automata) |
|
||||
| ~degen-levels~ | ~std::vector<unsigned>~ | level associated to each state by the degenaralization algorithm |
|
||||
| ~simulated-states~ | ~std::vector<unsigned>~ | map states of the original automaton to states if the current automaton in the result of simulation-based reductions |
|
||||
|
||||
Objects referenced via named properties are automatically destroyed
|
||||
when the automaton is destroyed, but this can be altered by passing a
|
||||
|
|
|
|||
|
|
@ -420,6 +420,7 @@ TESTS_sanity = \
|
|||
sanity/bin.test \
|
||||
sanity/includes.test \
|
||||
sanity/ipynb.pl \
|
||||
sanity/namedprop.test \
|
||||
sanity/private.test \
|
||||
sanity/readme.pl \
|
||||
sanity/style.test
|
||||
|
|
|
|||
53
tests/sanity/namedprop.test
Executable file
53
tests/sanity/namedprop.test
Executable file
|
|
@ -0,0 +1,53 @@
|
|||
#! /bin/sh
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2017 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/>.
|
||||
|
||||
|
||||
# We used to loop over more directories before the source tree was
|
||||
# rearranged. So there is only one left today, but we keep the loop
|
||||
# in case we want to add more in the future.
|
||||
|
||||
set +x
|
||||
|
||||
DOC=doc/org/concepts.org
|
||||
|
||||
rm -f namedprop.log
|
||||
|
||||
TOP=${srcdir-.}/../..
|
||||
for dir in "$TOP/spot" "$TOP/bin" "$TOP/tests"; do
|
||||
find "$dir" \( -name "${1-*}.hh" \
|
||||
-o -name "${1-*}.hxx" \
|
||||
-o -name "${1-*}.cc" \
|
||||
-o -name "${1-*}.test" \) \
|
||||
-a -not -path '*.dir/*' \
|
||||
-a -type f -a -print
|
||||
done |
|
||||
xargs sed -n 's/.*get_named_prop<.*>("\([^"]*\)").*/\1/p
|
||||
s/.*set_named_prop("\([^"]*\)",.*/\1/p' |
|
||||
sort | uniq |
|
||||
while read prop; do
|
||||
if ! grep -q "$prop" "$TOP/$DOC"; then
|
||||
echo "* $prop" >>namedprop.log
|
||||
fi
|
||||
done
|
||||
if test -f namedprop.log; then
|
||||
echo "The following named properties are not documented in $ORG:"
|
||||
cat namedprop.log
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue