Commit 0ab8dc06 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

install back the safety check of includes.test

Compilation of each header file alone, as a safety check, was removed
when introducing "#pragma once" because we did not have to check for
possible double inclusion.  However we still need to compile each
header to make sure they are self-contained.

* tests/sanity/includes.test: Compile each header.
* tests/run.in: Export various compiler and directory flags.
* spot/twaalgos/emptiness_stats.hh, spot/misc/mspool.hh,
spot/misc/fixpool.hh: Include <spot/misc/common.hh>.
* spot/misc/common.hh: Include <cassert>.
* NEWS: Mention the fixed headers.
parent 3d726fcc
...@@ -24,6 +24,10 @@ New in spot 2.2.1.dev (Not yet released) ...@@ -24,6 +24,10 @@ New in spot 2.2.1.dev (Not yet released)
everything that was not Inf was Fin. These errors are now everything that was not Inf was Fin. These errors are now
diagnosed. diagnosed.
* Some of the installed headers (spot/misc/fixpool.hh,
spot/misc/mspool.hh, spot/twaalgos/emptiness_stats.hh) were not
self-contained.
New in spot 2.2.1 (2016-11-21) New in spot 2.2.1 (2016-11-21)
Bug fix: Bug fix:
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <cstdlib> #include <cstdlib>
#include <stdexcept> #include <stdexcept>
#include <cassert>
#pragma once #pragma once
......
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
#pragma once #pragma once
#include <spot/misc/common.hh>
#include <new> #include <new>
#include <cstddef> #include <cstddef>
#include <cstdlib> #include <cstdlib>
#include <cassert>
namespace spot namespace spot
{ {
......
...@@ -19,11 +19,11 @@ ...@@ -19,11 +19,11 @@
#pragma once #pragma once
#include <spot/misc/common.hh>
#include <spot/misc/hash.hh>
#include <new> #include <new>
#include <cstddef> #include <cstddef>
#include <cstdlib> #include <cstdlib>
#include <cassert>
#include <spot/misc/hash.hh>
namespace spot namespace spot
{ {
......
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
#pragma once #pragma once
#include <cassert> #include <spot/misc/common.hh>
#include <map>
#include <spot/misc/ltstr.hh> #include <spot/misc/ltstr.hh>
#include <map>
namespace spot namespace spot
{ {
......
...@@ -52,6 +52,15 @@ srcdir="@srcdir@" ...@@ -52,6 +52,15 @@ srcdir="@srcdir@"
# want to inherit parameters likes -std=c11 -fvisibility=hidden # want to inherit parameters likes -std=c11 -fvisibility=hidden
CFLAGS= CFLAGS=
export CFLAGS export CFLAGS
CXX='@CXX@'
export CXX
CXXFLAGS='@CXXFLAGS@'
export CXXFLAGS
top_builddir='@abs_top_builddir@'
export top_builddir
top_srcdir='@abs_top_srcdir@'
export top_srcdir
case $1 in case $1 in
*/*) */*)
......
...@@ -27,7 +27,6 @@ set -e ...@@ -27,7 +27,6 @@ set -e
rm -f failures.inc rm -f failures.inc
INCDIR=${srcdir-.}/../../spot INCDIR=${srcdir-.}/../../spot
for file in `find "$INCDIR" \( -name "${1-*}.hh" \ for file in `find "$INCDIR" \( -name "${1-*}.hh" \
...@@ -36,21 +35,30 @@ for file in `find "$INCDIR" \( -name "${1-*}.hh" \ ...@@ -36,21 +35,30 @@ for file in `find "$INCDIR" \( -name "${1-*}.hh" \
if head -n 100 "$INCDIR/$file" | grep -q "[ ]*#.*pragma.* once\$"; then if head -n 100 "$INCDIR/$file" | grep -q "[ ]*#.*pragma.* once\$"; then
: :
elif grep -q 'GNU Bison 2\.6' "$INCDIR/$file"; then elif grep -q 'made by GNU Bison' "$INCDIR/$file"; then
# Bison 2.6, 2.6.1, 2.6.2 have a bug where position.hh # Those are not public headers, so we do not care
# include <iosfwd> instead of <iostream>.
continue continue
elif grep -q 'GNU Bison' "$INCDIR/$file"; then
:
else else
echo "Missing, or incorrect include guard." >&2 echo "Missing, or incorrect include guard." >&2
echo "FAIL: $file" echo "FAIL: $file"
echo " $file" >> failures.inc echo " $file" >> failures.inc
continue continue
fi fi
echo "PASS: $file"
echo "#include <spot/$file>" >incltest.cc
if $CXX $CPPFLAGS -DSKIP_DEPRECATED_WARNING $CXXFLAGS \
-I$top_builddir -I$top_srcdir -I$top_srcdir/buddy/src \
-c incltest.cc; then
echo "PASS: $file"
else
echo "FAIL: $file"
echo " $file" >> failures.inc
fi
done done
rm -f incltest.cc incltest.o
if test -f failures.inc; then if test -f failures.inc; then
echo "Failed files:" echo "Failed files:"
cat failures.inc cat failures.inc
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment