Add headers consistency check

This commit is contained in:
Michael Krasnyk 2016-12-06 16:14:25 +01:00 committed by Patrick Niklaus
parent dc8e6bd8d9
commit 84b618ed1a
10 changed files with 32 additions and 1 deletions

View File

@ -78,7 +78,7 @@ matrix:
compiler: "gcc-6-release-i686"
env: >
TARGET_ARCH='i686' CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse'
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse' CHECK_HEADERS=yes
- os: linux
compiler: "gcc-4.9-release"
@ -170,6 +170,7 @@ install:
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
sudo ldconfig
fi
- if [[ ${CHECK_HEADERS} == yes ]] ; then make check-headers ; fi
- popd
- mkdir example/build && pushd example/build
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}

View File

@ -751,3 +751,21 @@ if (ENABLE_FUZZING)
add_subdirectory(fuzz)
endif ()
## add headers sanity check target that includes all headers independently
set(check_headers_dir "${PROJECT_BINARY_DIR}/check-headers")
file(GLOB_RECURSE headers_to_check
${PROJECT_BINARY_DIR}/*.hpp
${PROJECT_SOURCE_DIR}/include/*.hpp)
foreach(header ${headers_to_check})
get_filename_component(filename ${header} NAME_WE)
set(filename "${check_headers_dir}/${filename}.cpp")
if (NOT EXISTS ${filename})
file(WRITE ${filename} "#include \"${header}\"\n")
endif()
list(APPEND sources ${filename})
endforeach()
add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources})
set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir})

View File

@ -7,6 +7,7 @@
#include "extractor/guidance/turn_instruction.hpp"
#include "extractor/guidance/turn_lane_types.hpp"
#include "extractor/profile_properties.hpp"
#include "storage/shared_datatype.hpp"
#include "util/guidance/bearing_class.hpp"
#include "util/guidance/entry_class.hpp"
#include "util/guidance/turn_lanes.hpp"

View File

@ -3,6 +3,7 @@
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <string>
#include "extractor/guidance/constants.hpp"

View File

@ -8,6 +8,7 @@
#include <boost/assert.hpp>
#include "extractor/guidance/road_classification.hpp"
#include "extractor/guidance/turn_lane_types.hpp"
#include "osrm/coordinate.hpp"
#include <utility>

View File

@ -1,6 +1,8 @@
#ifndef CONTAINER_HPP
#define CONTAINER_HPP
#include <utility>
namespace osrm
{
namespace util

View File

@ -1,6 +1,8 @@
#ifndef DIST_TABLE_WRAPPER_H
#define DIST_TABLE_WRAPPER_H
#include "util/typedefs.hpp"
#include <algorithm>
#include <boost/assert.hpp>
#include <cstddef>

View File

@ -1,3 +1,4 @@
#include "util/fingerprint.hpp"
#include "util/exception.hpp"
#include "util/exception_utils.hpp"

View File

@ -5,6 +5,7 @@
#include <mutex>
#include <string>
#include "util/exception.hpp"
#include "util/json_container.hpp"
#include "util/json_renderer.hpp"
#include "util/log.hpp"

View File

@ -1,9 +1,12 @@
#ifndef OSRM_GEOJSON_DEBUG_POLICY_TOOLKIT_HPP
#define OSRM_GEOJSON_DEBUG_POLICY_TOOLKIT_HPP
#include "extractor/external_memory_node.hpp"
#include "util/coordinate.hpp"
#include "util/json_container.hpp"
#include <algorithm>
#include <iterator>
#include <boost/optional.hpp>