Sync from upstream.

This commit is contained in:
Rene Rivera
2024-03-23 13:52:44 -05:00
13 changed files with 139 additions and 180 deletions

View File

@ -80,155 +80,60 @@ lib boost_regex_recursive :
local regress-sources = regress/$(R_SOURCE) ;
test-suite regex
:
[ run regress/$(R_SOURCE) /boost/regex//boost_regex ../build//icu_options
: # command line
: # input files
: # requirements
: regex_regress ]
run regress/$(R_SOURCE) ../build//boost_regex ../build//icu_options
: # command line
: # input files
: # requirements
: regex_regress ;
[ run regress/$(R_SOURCE) /boost/regex//boost_regex
/boost/thread//boost_thread ../build//icu_options
: # command line
: # input files
: # requirements
<define>TEST_THREADS
: regex_regress_threaded ]
run regress/$(R_SOURCE) ../build//boost_regex
/boost/thread//boost_thread ../build//icu_options
: # command line
: # input files
: # requirements
<define>TEST_THREADS
: regex_regress_threaded ;
[ run regress/$(R_SOURCE) /boost/regex//boost_regex
/boost/thread//boost_thread ../build//icu_options
: # command line
: # input files
: # requirements
<define>TEST_THREADS
<define>BOOST_REGEX_MAX_CACHE_BLOCKS=0
: regex_regress_threaded_no_cache ]
[ regex-test posix_api_check : c_compiler_checks/posix_api_check.c ]
[ compile c_compiler_checks/wide_posix_api_check.c
: : wide_posix_api_check_c ]
[ regex-test posix_api_check_cpp : c_compiler_checks/posix_api_check.cpp ]
[ regex-test wide_posix_api_check_cpp
: c_compiler_checks/wide_posix_api_check.cpp ]
[ run pathology/bad_expression_test.cpp : : :
[ check-target-builds ../build//is_legacy_03 : : <source>/boost/regex//boost_regex ]
]
[ run pathology/recursion_test.cpp : : :
[ check-target-builds ../build//is_legacy_03 : : <source>/boost/regex//boost_regex ]
]
[ run named_subexpressions/named_subexpressions_test.cpp : : :
[ check-target-builds ../build//is_legacy_03 : : <source>/boost/regex//boost_regex ]
]
[ run unicode/unicode_iterator_test.cpp : : :
[ check-target-builds ../build//is_legacy_03 : : <source>/boost/regex//boost_regex ]
release <define>TEST_UTF8 : unicode_iterator_test_utf8 ]
[ run unicode/unicode_iterator_test.cpp : : :
[ check-target-builds ../build//is_legacy_03 : : <source>/boost/regex//boost_regex ]
release <define>TEST_UTF16 : unicode_iterator_test_utf16 ]
[ run unicode/unicode_casefold_test.cpp
/boost/regex//boost_regex ../build//icu_options
]
[ run static_mutex/static_mutex_test.cpp
/boost/thread//boost_thread /boost/regex//boost_regex
/boost/timer//boost_timer
: : : <define>BOOST_TIMER_ENABLE_DEPRECATED
]
[ run object_cache/object_cache_test.cpp : : :
[ check-target-builds ../build//is_legacy_03 : : <source>/boost/regex//boost_regex ]
]
[ run config_info/regex_config_info.cpp
/boost/regex//boost_regex/<link>static
: # command line
: # input files
: <test-info>always_show_run_output
<use>/boost/config//testing
]
[ run config_info/regex_config_info.cpp /boost/regex//boost_regex
: # command line
: # input files
: <test-info>always_show_run_output
<use>/boost/config//testing
: regex_dll_config_info
]
[ run collate_info/collate_info.cpp /boost/regex//boost_regex
: : : <test-info>always_show_run_output : test_collate_info ]
[ link concepts/concept_check.cpp :
[ check-target-builds ../build//is_legacy_03 : : <source>/boost/regex//boost_regex ]
]
[ link concepts/concept_check.cpp :
<define>BOOST_REGEX_STANDALONE [ check-target-builds ../build//is_legacy_03 : : <build>no ] : standalone_concept_check
]
[ link concepts/icu_concept_check.cpp :
<define>BOOST_REGEX_STANDALONE [ check-target-builds ../build//is_legacy_03 : : <source>/boost/regex//boost_regex ]
]
[ link concepts/icu_concept_check.cpp :
[ check-target-builds ../build//is_legacy_03 : : <build>no ] : standalone_icu_concept_check
]
[ link concepts/range_concept_check.cpp :
[ check-target-builds ../build//is_legacy_03 : : <source>/boost/regex//boost_regex ]
<source>/boost/range//boost_range
]
[ run concepts/test_bug_11988.cpp : : :
[ check-target-builds ../build//is_legacy_03 : : <source>/boost/regex//boost_regex ]
]
[ run
# sources
captures/captures_test.cpp
../build//icu_options
: # additional args
: # test-files
: # requirements
<source>/boost/array//boost_array
<threading>multi
<define>BOOST_REGEX_MATCH_EXTRA=1
<define>BOOST_REGEX_NO_LIB=1
[ check-target-builds ../build//is_legacy_03 : : <source>/boost/regex//boost_regex ]
: # test name
captures_test
]
[ run regress/$(R_SOURCE) .//boost_regex_recursive
../build//icu_options
: # command line
: # input files
: # requirements
<define>BOOST_REGEX_RECURSIVE=1
<define>BOOST_REGEX_CXX03=1
: regex_regress_recursive ]
[ run regress/$(R_SOURCE) ./noeh_test//boost_regex_noeh
../build//icu_options
: # command line
: # input files
: # requirements
<define>BOOST_NO_EXCEPTIONS=1
<exception-handling>off
<link>static
<runtime-link>shared
: regex_regress_noeh ]
;
run regress/$(R_SOURCE) ../build//boost_regex
/boost/thread//boost_thread ../build//icu_options
: # command line
: # input files
: # requirements
<define>TEST_THREADS
<define>BOOST_REGEX_MAX_CACHE_BLOCKS=0
: regex_regress_threaded_no_cache ;
regex-test posix_api_check : c_compiler_checks/posix_api_check.c ;
compile c_compiler_checks/wide_posix_api_check.c : : wide_posix_api_check_c ;
regex-test posix_api_check_cpp : c_compiler_checks/posix_api_check.cpp ;
regex-test wide_posix_api_check_cpp : c_compiler_checks/wide_posix_api_check.cpp ;
run pathology/bad_expression_test.cpp : : : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] ;
run pathology/recursion_test.cpp : : : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] ;
run named_subexpressions/named_subexpressions_test.cpp : : : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] ;
run unicode/unicode_iterator_test.cpp : : : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] release <define>TEST_UTF8 : unicode_iterator_test_utf8 ;
run unicode/unicode_iterator_test.cpp : : : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] release <define>TEST_UTF16 : unicode_iterator_test_utf16 ;
run unicode/unicode_casefold_test.cpp ../build//boost_regex ../build//icu_options ;
run static_mutex/static_mutex_test.cpp /boost/thread//boost_thread ../build//boost_regex ;
run object_cache/object_cache_test.cpp : : : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] ;
run config_info/regex_config_info.cpp ../build//boost_regex/<link>static : : : <test-info>always_show_run_output ;
run config_info/regex_config_info.cpp ../build//boost_regex : : : <test-info>always_show_run_output : regex_dll_config_info ;
run collate_info/collate_info.cpp ../build//boost_regex : : : <test-info>always_show_run_output : test_collate_info ;
link concepts/concept_check.cpp : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] <toolset>gcc:<cxxflags>-Wno-deprecated-copy ;
link concepts/concept_check.cpp : <define>BOOST_REGEX_STANDALONE [ check-target-builds ../build//is_legacy_03 : : <build>no ] <toolset>gcc:<cxxflags>-Wno-deprecated-copy : standalone_concept_check ;
link concepts/icu_concept_check.cpp : <define>BOOST_REGEX_STANDALONE [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] <toolset>gcc:<cxxflags>-Wno-deprecated-copy ;
link concepts/icu_concept_check.cpp : [ check-target-builds ../build//is_legacy_03 : : <build>no ] <toolset>gcc:<cxxflags>-Wno-deprecated-copy : standalone_icu_concept_check ;
link concepts/range_concept_check.cpp : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] <toolset>gcc:<cxxflags>-Wno-deprecated-copy ;
run concepts/test_bug_11988.cpp : : : [ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] ;
run captures/captures_test.cpp ../build//icu_options : : : <threading>multi <define>BOOST_REGEX_MATCH_EXTRA=1 <define>BOOST_REGEX_NO_LIB=1
[ check-target-builds ../build//is_legacy_03 : : <source>../build//boost_regex ] : captures_test ;
run regress/$(R_SOURCE) .//boost_regex_recursive ../build//icu_options : : : <define>BOOST_REGEX_RECURSIVE=1 <define>BOOST_REGEX_CXX03=1 : regex_regress_recursive ;
run regress/$(R_SOURCE) ./noeh_test//boost_regex_noeh ../build//icu_options : : : <define>BOOST_NO_EXCEPTIONS=1 <exception-handling>off <link>static <runtime-link>shared : regex_regress_noeh ;
compile test_consolidated.cpp ;
build-project ../example ;
# `quick` target (for CI)
run quick.cpp /boost/regex//boost_regex ;
run quick.cpp ../build//boost_regex ;
compile test_warnings.cpp
: <toolset>msvc:<warnings>all <toolset>msvc:<warnings-as-errors>on
<toolset>gcc:<warnings>all <toolset>gcc:<warnings-as-errors>on

View File

@ -51,5 +51,9 @@ void test_alt()
TEST_REGEX_SEARCH("a\nb", grep, "a", match_default, make_array(0, 1, -2, -2));
TEST_REGEX_SEARCH("a\nb", egrep, "b", match_default, make_array(0, 1, -2, -2));
TEST_REGEX_SEARCH("a\nb", egrep, "a", match_default, make_array(0, 1, -2, -2));
// DOS protection:
#ifndef BOOST_REGEX_RECURSIVE
TEST_INVALID_REGEX("(|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||(?0))", perl);
#endif
}

View File

@ -62,6 +62,10 @@ void test_anchors()
#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560)
TEST_REGEX_SEARCH_W(L"^.", boost::regex::extended, L"\x2028 \x2028", match_default, make_array(0, 1, -2, 1, 2, -2, -2));
TEST_REGEX_SEARCH_W(L".$", boost::regex::extended, L" \x2028 \x2028", match_default, make_array(0, 1, -2, 2, 3, -2, 3, 4, -2, -2));
#endif
// DOS attack prevention:
#ifndef BOOST_REGEX_RECURSIVE
TEST_INVALID_REGEX("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", perl);
#endif
}

View File

@ -194,5 +194,9 @@ void test_replace()
TEST_REGEX_REPLACE("(a*)", perl, "aabb", match_default, "{$1}", "{aa}{}b{}b{}");
TEST_REGEX_REPLACE("(a*)", boost::regex::extended, "aabb", match_default, "{$1}", "{aa}{}b{}b{}");
TEST_REGEX_REPLACE("(a*)", boost::regex::extended, "aabb", match_default|match_posix, "{$1}", "{aa}b{}b{}");
#ifndef BOOST_REGEX_RECURSIVE
// DOS protection:
TEST_REGEX_REPLACE("foo", boost::regex::perl, "foobar", match_default|format_all, "(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((", "(((((((((((((((((((((bar");
#endif
}

View File

@ -16,6 +16,8 @@
* DESCRIPTION: test program for boost::static_mutex.
*/
#define BOOST_TIMER_ENABLE_DEPRECATED
#include <boost/regex/pending/static_mutex.hpp>
#include <boost/thread/thread.hpp>
#include <boost/timer.hpp>