From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- src/boost/libs/serialization/util/test.jam | 208 +++++++++++++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 src/boost/libs/serialization/util/test.jam (limited to 'src/boost/libs/serialization/util/test.jam') diff --git a/src/boost/libs/serialization/util/test.jam b/src/boost/libs/serialization/util/test.jam new file mode 100644 index 000000000..4a04c3337 --- /dev/null +++ b/src/boost/libs/serialization/util/test.jam @@ -0,0 +1,208 @@ +# Boost serialization Library utility test Jamfile + +# (C) Copyright Robert Ramey 2002-2004. +# Use, modification, and distribution are 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) +# + +# the file contains Jam rules which are used in both the normal +# boost test, as well as the performance test and comprehensive +# tests. + +# import rules for testing conditional on config file variables +import ../../config/checks/config : requires ; + +BOOST_ARCHIVE_LIST = [ modules.peek : BOOST_ARCHIVE_LIST ] ; + +# these are used to shorten testing while in development. It permits +# testing to be applied to just a particular type of archive +if ! $(BOOST_ARCHIVE_LIST) { + BOOST_ARCHIVE_LIST = + "text_archive.hpp" + "text_warchive.hpp" + "binary_archive.hpp" + "xml_archive.hpp" + "xml_warchive.hpp" + ; + # enable the tests which don't depend on a particular archive + BOOST_SERIALIZATION_TEST = true ; +} + +rule run-template ( test-name : sources * : files * : requirements * ) { + return [ + run + $(sources) + : # command + : #input files + $(files) + : # requirements + # toolset warnings + borland:"-w-8080 -w-8071 -w-8057 -w-8062 -w-8008 -w-0018 -w-8066" + #gcc:all # ? + gcc:"-Wno-unused-variable -Wno-long-long" + # gcc:debug>_STLP_DEBUG + # gcc:debug>_GLIBCXX_DEBUG + darwin:"-Wno-unused-variable -Wno-long-long" + msvc:all # == /W4 + msvc:_SCL_SECURE_NO_WARNINGS + msvc:_SCL_SECURE_NO_DEPRECATE + msvc:_CRT_SECURE_NO_WARNINGS + msvc:_CRT_SECURE_NO_DEPRECATE + msvc:"-wd4996" + clang:debug:"-fsanitize=memory" + # toolset optimizations + gcc:"-ftemplate-depth-255" + clang:"-ftemplate-depth-255" + darwin:"-ftemplate-depth-255" + msvc:"-Gy" + # linking + shared:BOOST_SERIALIZATION_DYN_LINK=1 + shared:BOOST_WSERIALIZATION_DYN_LINK=1 + $(requirements) + : # test name + $(test-name) + ] ; +} + +# Given a name of test, return the 'save' test that must be run +# before the named test, or empty string if there's no such test. +rule dependency-save-test ( test ) +{ + local m = [ MATCH (.*)load(.*) : $(test) ] ; + if $(m) + { + return $(m[1])save$(m[2]) ; + } +} + +# each of the following tests is run with each type of archive +rule run-invoke ( test-name : sources * : files * : requirements * ) +{ + local save-test = [ dependency-save-test $(test-name) ] ; + + local tests ; + tests += [ + run-template $(test-name) + : # sources + $(sources) + ../build//boost_serialization + : # input files + : # requirements + $(requirements) + BOOST_LIB_DIAGNOSTIC=1 + $(save-test) + ] ; + return $(tests) ; +} + +# each of the following tests is run with each type of archive +rule run-winvoke ( test-name : sources * : files * : requirements * ) +{ + local save-test = [ dependency-save-test $(test-name) ] ; + + local tests ; + tests += [ + run-template $(test-name) + : # sources + $(sources) + ../build//boost_serialization + ../build//boost_wserialization + : # input files + : # requirements + $(requirements) + BOOST_LIB_DIAGNOSTIC=1 + # both stlport and msvc6 define iswspace + msvc,stlport:"-force:multiple" + $(save-test) + [ requires std_wstreambuf ] + ] ; + return $(tests) ; +} + +# for tests which don't use library code - usually just headers +rule test-bsl-run-no-lib ( test-name : sources * : requirements * ) +{ + local tests ; + tests += [ + run-template $(test-name) + : # sources + $(test-name).cpp $(sources).cpp + : # input files + : # requirements + $(requirements) + ] ; + return $(tests) ; +} + +# for tests which are run just once rather than for every archive +rule test-bsl-run ( test-name : sources * : libs * : requirements * ) +{ + local tests ; + tests += [ + run-invoke $(test-name) + : # sources + $(test-name).cpp $(sources).cpp $(libs) + : # input files + : # requirements + $(requirements) + ] ; + return $(tests) ; +} + +rule test-bsl-run_archive ( test-name : archive-name : sources * : libs * : requirements * ) { + local tests ; + switch $(archive-name) { + case "*_warchive" : + tests += [ + run-winvoke $(test-name)_$(archive-name) + : # sources + $(sources).cpp $(libs) + : # input files + : # requirements + BOOST_ARCHIVE_TEST=$(archive-name).hpp + $(requirements) + ] ; + case "*" : + tests += [ + run-invoke $(test-name)_$(archive-name) + : # sources + $(sources).cpp $(libs) + : # input files + : # requirements + BOOST_ARCHIVE_TEST=$(archive-name).hpp + $(requirements) + ] ; + } + return $(tests) ; +} + +rule test-bsl-run_files ( test-name : sources * : libs * : requirements * ) { + local tests ; + for local defn in $(BOOST_ARCHIVE_LIST) { + tests += [ + test-bsl-run_archive $(test-name) + : $(defn:LB) + : $(test-name) $(sources) + : $(libs) + : $(requirements) + ] ; + } + return $(tests) ; +} + +rule test-bsl-run_polymorphic_files ( test-name : sources * : libs * : requirements * ) { + local tests ; + for local defn in $(BOOST_ARCHIVE_LIST) { + ECHO polymorphic_$(defn:LB) ; + tests += [ + test-bsl-run_archive $(test-name) + : polymorphic_$(defn:LB) + : $(test-name) $(sources) + : $(libs) + : $(requirements) + ] ; + } + return $(tests) ; +} + -- cgit v1.2.3