Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
# Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
# Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
# Copyright (c) 2009-2018 Mateusz Loskot, London, UK.
#
# This file was modified by Oracle on 2017, 2018.
# Modifications copyright (c) 2017-2018 Oracle and/or its affiliates.
Expand All @@ -28,6 +28,13 @@ project boost-geometry-test
<define>BOOST_NO_AUTO_PTR # disable the deprecated std::auto_ptr support in SmartPtr and Core
;

# Rest self-contained headers on-demand only to avoid build timeouts on CI services.
# The CI environment is common for Travis CI, AppVeyor, CircleCI, etc.
if ! [ os.environ CI ] || [ os.environ TEST_HEADERS ]
{
build-project self_contained_headers ;
}

# Run minimal testset
test-suite boost-geometry-minimal
:
Expand All @@ -53,3 +60,4 @@ build-project util ;
build-project views ;

}

65 changes: 65 additions & 0 deletions test/self_contained_headers/Jamfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Boost.Geometry (aka GGL, Generic Geometry Library)
#
# Copyright (c) 2018 Mateusz Loskot <[email protected]>
#
# Use, modification and distribution is subject to the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

import os ;
import path ;
import regex ;

rule generate_self_contained_headers ( headers_subpath )
{
# This rule is based on script copied from similar rule in Boost.GIL
# On CI services, test the self-contained headers on-demand only to avoid build timeouts
# CI environment is common for Travis CI, AppVeyor, CircleCI, etc.
# For example:
# if ! [ os.environ CI ] || [ os.environ TEST_HEADERS ] {
# alias self_contained_headers : [ generate_self_contained_headers ] ;
# }

local targets ;

# NOTE: All '/' in test names are replaced with '-' because apparently
# test scripts have a problem with test names containing slashes.

local top_headers_path = [ path.make $(BOOST_ROOT)/libs/geometry/include/boost/geometry ] ;

for local file in [ path.glob-tree $(top_headers_path)/$(headers_subpath) : *.hpp ]
{
local rel_file = [ path.relative-to $(top_headers_path) $(file) ] ;
local target_name = [ regex.replace self-contained/$(rel_file) "/" "-" ] ;
targets += [
compile $(BOOST_ROOT)/libs/geometry/test/self_contained_headers/main.cpp
: <define>"BOOST_GEOMETRY_TEST_HEADER=$(rel_file)" <dependency>$(file)
: $(target_name)
] ;
}

return $(targets) ;
}

# TODO: Review sorting to get as close as possible from general to specific

# Core
alias core : [ generate_self_contained_headers core ] ;
alias util : [ generate_self_contained_headers util ] ;
alias policies : [ generate_self_contained_headers policies ] ;
alias geometries : [ generate_self_contained_headers geometries ] ;
alias concepts : [ generate_self_contained_headers concepts ] ;
alias arithmetic : [ generate_self_contained_headers arithmetic ] ;
alias formulas : [ generate_self_contained_headers formulas ] ;
alias iterators : [ generate_self_contained_headers iterators ] ;
alias strategies : [ generate_self_contained_headers strategies ] ;
alias srs : [ generate_self_contained_headers srs ] ;
alias algorithms : [ generate_self_contained_headers algorithms ] ;
alias views : [ generate_self_contained_headers views ] ;
alias index : [ generate_self_contained_headers index ] ;

# Extensions
alias ext_algebra : [ generate_self_contained_headers extensions/algebra ] ;
alias ext_algorithms : [ generate_self_contained_headers extensions/algorithms ] ;
alias ext_index : [ generate_self_contained_headers extensions/index ] ;
alias ext_gis : [ generate_self_contained_headers extensions/gis ] ;
19 changes: 19 additions & 0 deletions test/self_contained_headers/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// Copyright (c) 2018 Mateusz Loskot <[email protected]>
// Copyright (c) 2007-2015 Andrey Semashev
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

// This file contains a test boilerplate for checking that every public header
// is self-contained and does not have any missing #include-s.

#define BOOST_GEOMETRY_TEST_INCLUDE_HEADER() <boost/geometry/BOOST_GEOMETRY_TEST_HEADER>

#include BOOST_GEOMETRY_TEST_INCLUDE_HEADER()

int main()
{
return 0;
}