[test] Move tests of extensions headers to extensions/test directory.

This commit is contained in:
Adam Wulkiewicz 2018-11-27 21:17:16 +01:00
parent d271fde65f
commit 6af84a3a49
2 changed files with 51 additions and 6 deletions

View File

@ -0,0 +1,50 @@
# Boost.Geometry (aka GGL, Generic Geometry Library)
#
# Copyright (c) 2018 Mateusz Loskot <mateusz@loskot.net>
#
# 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 h/$(rel_file) "/" "-" ] ;
local target_name = [ regex.replace $(target_name) "\.hpp" "" ] ;
targets += [
compile $(BOOST_ROOT)/libs/geometry/test/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
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 ] ;

View File

@ -57,10 +57,5 @@ 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 ] ;
# Even though index is a separate submodule test headers here
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 ] ;