summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/geometry/test/headers
diff options
context:
space:
mode:
Diffstat (limited to 'src/boost/libs/geometry/test/headers')
-rw-r--r--src/boost/libs/geometry/test/headers/Jamfile61
-rw-r--r--src/boost/libs/geometry/test/headers/main.cpp19
2 files changed, 80 insertions, 0 deletions
diff --git a/src/boost/libs/geometry/test/headers/Jamfile b/src/boost/libs/geometry/test/headers/Jamfile
new file mode 100644
index 00000000..4f245dd4
--- /dev/null
+++ b/src/boost/libs/geometry/test/headers/Jamfile
@@ -0,0 +1,61 @@
+# 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
+
+# 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 ] ;
+# Even though index is a separate submodule test headers here
+alias index : [ generate_self_contained_headers index ] ;
diff --git a/src/boost/libs/geometry/test/headers/main.cpp b/src/boost/libs/geometry/test/headers/main.cpp
new file mode 100644
index 00000000..c4ba9779
--- /dev/null
+++ b/src/boost/libs/geometry/test/headers/main.cpp
@@ -0,0 +1,19 @@
+//
+// Copyright (c) 2018 Mateusz Loskot <mateusz@loskot.net>
+// 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;
+}