Commit 7824005d 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 2198543a
......@@ -20,6 +20,10 @@ New in spot 2.2.1.dev (Not yet released)
everything that was not Inf was Fin. These errors are now
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)
Bug fix:
......
......@@ -19,6 +19,7 @@
#include <cstdlib>
#include <stdexcept>
#include <cassert>
#pragma once
......
......@@ -19,10 +19,10 @@
#pragma once
#include <spot/misc/common.hh>
#include <new>
#include <cstddef>
#include <cstdlib>
#include <cassert>
namespace spot
{
......
......@@ -19,11 +19,11 @@
#pragma once
#include <spot/misc/common.hh>
#include <spot/misc/hash.hh>
#include <new>
#include <cstddef>
#include <cstdlib>
#include <cassert>
#include <spot/misc/hash.hh>
namespace spot
{
......
......@@ -22,9 +22,9 @@
#pragma once
#include <cassert>
#include <map>
#include <spot/misc/common.hh>
#include <spot/misc/ltstr.hh>
#include <map>
namespace spot
{
......
......@@ -52,6 +52,15 @@ srcdir="@srcdir@"
# want to inherit parameters likes -std=c11 -fvisibility=hidden
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
*/*)
......
......@@ -27,7 +27,6 @@ set -e
rm -f failures.inc
INCDIR=${srcdir-.}/../../spot
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
:
elif grep -q 'GNU Bison 2\.6' "$INCDIR/$file"; then
# Bison 2.6, 2.6.1, 2.6.2 have a bug where position.hh
# include <iosfwd> instead of <iostream>.
elif grep -q 'made by GNU Bison' "$INCDIR/$file"; then
# Those are not public headers, so we do not care
continue
elif grep -q 'GNU Bison' "$INCDIR/$file"; then
:
else
echo "Missing, or incorrect include guard." >&2
echo "FAIL: $file"
echo " $file" >> failures.inc
continue
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
rm -f incltest.cc incltest.o
if test -f failures.inc; then
echo "Failed files:"
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