]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/test/test/Jamfile.v2
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / test / test / Jamfile.v2
index 051acd3e07fbd8c2eb4de32ef9ec6cc814f2df6c..8a7f988dc54022542de3ff81d5293be198930e12 100644 (file)
@@ -9,6 +9,7 @@ import path ;
 import project ;
 import property ;
 import property-set ;
+import regex ;
 import "class" : new ;
 
 import ../../config/checks/config : requires ;
@@ -33,6 +34,8 @@ requirements_boost_test_full_support = [ requires cxx11_variadic_macros cxx11_de
 # requirements for dataset feature
 requirements_datasets = [ requires cxx11_decltype cxx11_hdr_random cxx11_hdr_tuple cxx11_hdr_initializer_list cxx11_variadic_macros cxx11_trailing_result_types cxx11_template_aliases ] ;
 
+# avoiding some broken compilers (seen on Travis)
+local l_gcc_c11_rvalue_full_support = [ predef-require "!BOOST_COMP_GNUC" or "BOOST_COMP_GNUC >= 5.0" ] ;
 
 #_________________________________________________________________________________________________#
 
@@ -55,6 +58,10 @@ rule boost.test-self-test ( test-rule : test-suite : test-name : usage-variant ?
                [ predef-check "BOOST_COMP_GNUC >= 4.3.0" : : <cxxflags>-Wno-variadic-macros ]
                <toolset>clang:<cxxflags>-Wno-c99-extensions
                <toolset>clang:<cxxflags>-Wno-variadic-macros
+               <toolset>clang:<cxxflags>-Werror=address-of-temporary
+               #<toolset>clang:<cxxflags>-Werror=bind-to-temporary-copy
+               <toolset>clang:<cxxflags>-Werror=return-stack-address
+               # <toolset>clang:<cxxflags>-Werror=dangling
 #               <toolset>gcc:<cxxflags>--coverage
                <warnings>all
                $(extra-options)
@@ -126,6 +133,8 @@ test-suite "usage-variants-ts"
   [ boost.test-self-test run : usage-variants-ts : shared-library-test : boost_unit_test_framework/<link>shared ]
   [ boost.test-self-test run : usage-variants-ts : shared-library-custom-init-test : boost_unit_test_framework/<link>shared ]
   [ boost.test-self-test run : usage-variants-ts : shared-library-custom-main-test : boost_unit_test_framework/<link>shared ]
+
+  [ boost.test-self-test run : test-organization-ts : header-only-over-multiple-files : included : : usage-variants-ts/single-header-multiunit-1-test.cpp usage-variants-ts/single-header-multiunit-2-test.cpp ]
 ;
 
 #_________________________________________________________________________________________________#
@@ -138,9 +147,12 @@ test-suite "framework-ts"
   [ boost.test-self-test run : framework-ts : version-uses-module-name : included ]
   [ boost.test-self-test run : framework-ts : test-macro-global-fixture : : baseline-outputs/global-fixtures-test.pattern ]
   [ boost.test-self-test run : framework-ts : message-in-datatestcase-test : : baseline-outputs/messages-in-datasets-test.pattern : : : : $(requirements_datasets) ]
+  [ boost.test-self-test run : framework-ts : decorators-datatestcase-test : : : : : : $(requirements_datasets) ]
+  [ compile-fail framework-ts/master-test-suite-non-copyable-test.cpp ../build//included ]
+  [ boost.test-self-test run : framework-ts : log-count-skipped-test : included : baseline-outputs/log-count-skipped-tests.pattern ]
 
   # ticket 13371: "Use-after-free with --log_sink=file"
-  # this single check is not enough as we should check for various command line options: we make extensive 
+  # this single check is not enough as we should check for various command line options: we make extensive
   # checks in the smoke-tests (see below)
   # [ boost.test-self-test run : framework-ts : check-streams-on-exit : included ]
 ;
@@ -155,6 +167,7 @@ test-suite "writing-test-ts"
   [ boost.test-self-test run : writing-test-ts : dont_print_log_value-test : : : : : : $(requirements_datasets) ]
   [ boost.test-self-test run : writing-test-ts : fp-comparisons-test : : : : : : $(requirements_boost_test_full_support) ]
   [ boost.test-self-test run : writing-test-ts : fp-multiprecision-comparison-test : : : : : : $(requirements_boost_test_full_support) ]
+  [ boost.test-self-test run : writing-test-ts : fp-no-comparison-for-incomplete-types-test ]
   [ boost.test-self-test run : writing-test-ts : fp-relational-operator ]
   [ boost.test-self-test run : writing-test-ts : output_test_stream-test ]
   [ boost.test-self-test run : writing-test-ts : test_tools-test : : baseline-outputs/test_tools-test.pattern : : : : $(requirements_boost_test_full_support) ]
@@ -166,6 +179,11 @@ test-suite "writing-test-ts"
   [ boost.test-self-test run : writing-test-ts : user-defined-types-logging-customization-points ]
   [ boost.test-self-test run : writing-test-ts : test-fixture-detect-setup-teardown ]
   [ boost.test-self-test run : writing-test-ts : test-fixture-detect-setup-teardown-cpp11 : : : : : : [ requires cxx11_decltype cxx11_trailing_result_types ] ]
+  [ boost.test-self-test run : writing-test-ts : test-with-precondition : : : : : : [ requires cxx11_auto_declarations cxx11_lambdas ] ]
+  [ boost.test-self-test run : writing-test-ts : test-timeout : : : : : : [ requires cxx11_hdr_thread cxx11_hdr_chrono ] ]
+  [ boost.test-self-test run-fail : writing-test-ts : test-timeout-fail : : : : : : [ requires cxx11_hdr_thread cxx11_hdr_chrono ] ]
+  [ boost.test-self-test run : writing-test-ts : test-timeout-suite : : : : : : $(requirements_datasets) [ requires cxx11_hdr_thread cxx11_hdr_chrono ] ]
+  [ boost.test-self-test run-fail : writing-test-ts : test-timeout-suite-fail : : : : : : $(requirements_datasets) [ requires cxx11_hdr_thread cxx11_hdr_chrono ] ]
 ;
 
 #_________________________________________________________________________________________________#
@@ -175,6 +193,7 @@ test-suite "test-organization-ts"
   [ boost.test-self-test run : test-organization-ts : parameterized_test-test ]
   [ boost.test-self-test run : test-organization-ts : test_case_template-test ]
   [ boost.test-self-test run : test-organization-ts : test_case_template-with-tuples-test : : : : : : [ requires cxx11_hdr_tuple cxx11_auto_declarations cxx11_variadic_templates ] ]
+  [ boost.test-self-test run : test-organization-ts : test_case_template-with-variadic-typelist : : : : : : [ requires cxx11_hdr_tuple cxx11_auto_declarations cxx11_variadic_templates ] ]
   [ boost.test-self-test run : test-organization-ts : datasets-test : : : [ glob test-organization-ts/datasets-test/*.cpp ] : : : $(requirements_datasets) ]
   [ boost.test-self-test run : test-organization-ts : dataset-variadic_and_move_semantic-test : : : : : : $(requirements_datasets) ]
   [ boost.test-self-test run : test-organization-ts : test_unit-order-test ]
@@ -184,6 +203,9 @@ test-suite "test-organization-ts"
   [ boost.test-self-test run : test-organization-ts : test-tree-management-test ]
   [ boost.test-self-test run : test-organization-ts : test-tree-several-suite-decl ]
   [ boost.test-self-test run : test-organization-ts : test_unit-report-clashing-names ]
+  [ boost.test-self-test run : test-organization-ts : test_unit-several-ts-same-name ]
+  # cannot pass parameters from the command line, another test developed below
+  # [ boost.test-self-test run : test-organization-ts : dataset-master-test-suite-accessible-test : : --param1=1 --param2=2 : : : : $(requirements_datasets) ]
 ;
 
 #_________________________________________________________________________________________________#
@@ -210,6 +232,7 @@ test-suite "execution_monitor-ts"
   [ boost.test-self-test run : execution_monitor-ts : errors-handling-test : : baseline-outputs/errors-handling-test.pattern
                                                                                baseline-outputs/errors-handling-test.pattern2 ]
   [ boost.test-self-test run : execution_monitor-ts : custom-exception-test ]
+  [ boost.test-self-test run : execution_monitor-ts : boost_exception-test ]
 ;
 
 #_________________________________________________________________________________________________#
@@ -302,12 +325,13 @@ rule boost.test-smoke-ts-logger ( test-name-prefix : logger ? : log_or_report ?
                               : : $(requirements) $(conditions-format-sink)  : $(test-name-prefix)-3-$(log_or_report)-format-to-file-$(log_new_style)-all ]
       [ run smoke-ts-included : --run_test=test1/_2
                               : : $(requirements) $(conditions-format) : $(test-name-prefix)-4-$(log_or_report)-format-$(log_new_style)-filter ]
-      
+
       [ run check-streams-on-exit :
                               : : $(requirements) $(conditions-format) : $(test-name-prefix)-5--$(log_or_report)-format--newstyle-$(log_new_style) ]
       [ run check-streams-on-exit :
                               : : $(requirements) $(conditions-format-sink) : $(test-name-prefix)-6--$(log_or_report)-format--newstyle-$(log_new_style)--with-sink ]
-   ;
+
+      ;
 
    return $(to-return) ;
 }
@@ -317,8 +341,16 @@ exe smoke-ts-included : smoke-ts/basic-smoke-test.cpp
 
 exe smoke-ts-included-2 : smoke-ts/basic-smoke-test2.cpp ;
 
+exe smoke-ts-included-3 : smoke-ts/basic-smoke-test3.cpp ;
+
+# for template test case filtering from the command line
+exe smoke-ts-included-4 : smoke-ts/basic-smoke-test4.cpp ;
+
 exe check-streams-on-exit : framework-ts/check-streams-on-exit.cpp ;
 
+exe dataset-master-test-suite-accessible-test : test-organization-ts/dataset-master-test-suite-accessible-test.cpp
+                                              : $(requirements_datasets) ;
+
 alias "smoke-ts"
 :
 [ boost.test-smoke-ts-logger bt-st-txml : XML : log ]
@@ -330,8 +362,108 @@ alias "smoke-ts"
 [ boost.test-smoke-ts-logger bt-st-tjunit : JUNIT : log ]
 [ boost.test-smoke-ts-logger bt-st-tjunit : JUNIT : log : : yes ]
 [ run smoke-ts-included-2 : <testing.arg>\"--run_test=test<*\" : : : bt-st-runtest-with-colons ]
+[ run check-streams-on-exit : --list_content --report_sink=stdout : : $(requirements_datasets) : cla-check-list-content-with-report-sink ]
+[ run check-streams-on-exit : --list_content --report_sink=test.txt : : $(requirements_datasets) : cla-check-list-content-with-report-sink-2 ]
+
+# check being able to pass arguments command line arguments to the dataset generator
+[ run dataset-master-test-suite-accessible-test : -- --param1=1 --param2=2 : : $(requirements_datasets) : dataset-lazy-generator  ]
+
+# several command line parameter checks
 [ run smoke-ts-included : --version : : $(requirements_datasets) : cla-check-print-version ]
-# : $(requirements_datasets)
+[ run smoke-ts-included : -c true : : $(requirements_datasets) : cla-result-code-short ]
+[ run smoke-ts-included : -c false : : $(requirements_datasets) : cla-result-code-short-false ]
+[ run smoke-ts-included : --result_code=true : : $(requirements_datasets) : cla-result-code-long ]
+[ run smoke-ts-included : --result_code=false : : $(requirements_datasets) : cla-result-code-long-false ]
+[ run smoke-ts-included : --no_result_code : : $(requirements_datasets) : cla-result-code-long-false-short ]
+[ run smoke-ts-included : -x no -c --list_content=HRF : : $(requirements_datasets) : cla-mixed-long-short1 ]
+[ run smoke-ts-included : -x -c no --list_content=HRF : : $(requirements_datasets) : cla-mixed-long-short2 ]
+[ run smoke-ts-included : -x -c no --list_content=HRF -- --some-ignored : : $(requirements_datasets) : cla-mixed-long-short3 ]
+
+# those checks are mainly for consistency: we run a very simple thing, pass command line and
+# check behaviour wrt. to the command line arguments
+
+[ run-fail smoke-ts-included-3 : : : : cla-no-args-checking-fail ] # sanity check
+
+# short vs. long arguments with optional value
+[ run-fail smoke-ts-included-3 : --result_code : : : cla-ignore-result-code-long-fail-optional ]
+[ run smoke-ts-included-3 : --result_code=0 : : : cla-ignore-result-code-long-no-fail ]
+[ run-fail smoke-ts-included-3 : --no_result_code=0 : : : cla-ignore-result-code-long-fail-negated-wrong ]
+[ run smoke-ts-included-3 : --no_result_code : : : cla-ignore-result-code-long-no-fail-negated ]
+[ run-fail smoke-ts-included-3 : --result_code=1 : : : cla-ignore-result-code-long-fail ]
+[ run-fail smoke-ts-included-3 : -c : : : cla-ignore-result-code-short-fail-optional ]
+[ run smoke-ts-included-3 : -c no : : : cla-ignore-result-code-short-no-fail ]
+[ run-fail smoke-ts-included-3 : -c yes : : : cla-ignore-result-code-short-fail ]
+
+# short vs. long arguments without optional arguments
+[ run-fail smoke-ts-included-3 : --run_test : : : cla-runtest-long-fail-no-optional ]
+[ run smoke-ts-included-3 : --run_test=case2 : : : cla-runtest-long-no-fail ]
+[ run smoke-ts-included-3 : --run_test=case2 : : : cla-runtest-long-fail1 ]
+[ run-fail smoke-ts-included-3 : --run_test=case2 --run_test=some_suite : : : cla-runtest-repeated-long-fail ]
+[ run-fail smoke-ts-included-3 : --run_test=some_suite/case1  : : : cla-runtest-long-fail2 ]
+[ run-fail smoke-ts-included-3 : -t : : : cla-runtest-short-fail-no-optional ]
+[ run-fail smoke-ts-included-3 : -t some_suite : : : cla-runtest-short-fail1 ]
+[ run-fail smoke-ts-included-3 : -t some_suite/case1 : : : cla-runtest-short-fail2 ]
+[ run smoke-ts-included-3 : -t case2 : : : cla-runtest-short-no-fail ]
+
+# mixed short/long
+[ run-fail smoke-ts-included-3 : --run_test=case2 -t some_suite : : : cla-runtest-repeated-mixed-long-fail1 ]
+[ run-fail smoke-ts-included-3 : -t some_suite --run_test=case2 : : : cla-runtest-repeated-mixed-long-fail2 ]
+[ run smoke-ts-included-3 : --run_test=case2 -t some_suite -c no : : : cla-runtest-repeated-mixed-long-no-fail1 ]
+[ run smoke-ts-included-3 : -t some_suite -c no --run_test=case2 : : : cla-runtest-repeated-mixed-long-no-fail2 ]
+[ run smoke-ts-included-3 : -c no --run_test=case2 -t some_suite : : : cla-runtest-repeated-mixed-long-no-fail3 ]
+[ run-fail smoke-ts-included-3 : --result_code=1 --run_test=case2 -t some_suite : : : cla-runtest-repeated-mixed-long-fail3 ]
+[ run smoke-ts-included-3 : --result_code=0 --run_test=case2 -t some_suite : : : cla-runtest-repeated-mixed-long-fail4 ]
+
+# template test case filtering command line
+[ run-fail smoke-ts-included-4 : : : : cla-template-test-case-sanity-1 ]
+[ run-fail smoke-ts-included-4 : \"--run_test=test<my_struct<int_ float>>\" : : : cla-template-test-case-sanity-2 ]
+[ run smoke-ts-included-4 : \"--run_test=test<my_struct<int_ int>>\" : : : cla-template-test-case-sanity-3 ]
+[ run smoke-ts-included-4 : \"--run_test=test<my_struct<int_ int>>,test<my_struct<float_ float>>\" : : : cla-template-test-case-sanity-4 ]
+[ run-fail smoke-ts-included-4 : \"--run_test=test<my_struct<int_ int>>,test<my_struct<char_ float>>\" : : : cla-template-test-case-sanity-5 ]
+[ run-fail smoke-ts-included-4 : \"--run_test=some_suite/*\" : : : cla-template-test-case-sanity-6 ]
+[ run-fail smoke-ts-included-4 : \"--run_test=some_suite/test<my_struct<float_ int>>\" : : : cla-template-test-case-sanity-7 ]
+[ run-fail smoke-ts-included-4 : \"--run_test=some_suite/test<my_struct<int_ float>>\" : : : cla-template-test-case-sanity-8 ]
+[ run-fail smoke-ts-included-4 : \"--run_test=some_suite/test<my_struct<int_ float>>,test<my_struct<float_ int>>\" : : : cla-template-test-case-sanity-9 ]
+[ run smoke-ts-included-4 : \"--run_test=some_suite/test<my_struct<float_ float>>\" : : : cla-template-test-case-sanity-10 ]
+# test<my_struct<double_ double>> does not exist: error because test tree empty
+[ run-fail smoke-ts-included-4 : \"--run_test=some_suite/test<my_struct<double_ double>>\" : : : cla-template-test-case-sanity-11 ]
+# test<my_struct<double_ double>> does not exist, but this is not reported as error since there is at least one test case running
+[ run smoke-ts-included-4 : \"--run_test=some_suite/test<my_struct<float_ float>>,test<my_struct<double_ double>>\" : : : cla-template-test-case-sanity-12 ]
+[ run smoke-ts-included-4 : \"--run_test=some_suite/test<my_struct<float_ float>>,test<my_struct<char_ char>>\" : : : cla-template-test-case-sanity-13 ]
+[ run smoke-ts-included-4 : \"--run_test=some_suite/test<my_struct<float_ float>>\" \"--run_test=test<my_struct<int_ int>>\" : : : cla-template-test-case-sanity-14 ]
+[ run smoke-ts-included-4 : \"--run_test=some_suite/test<my_struct<float_ float>>,test<my_struct<char_ char>>\" \"--run_test=test<my_struct<int_ int>>\" : : : cla-template-test-case-sanity-15 ]
+;
+
+exe custom-command-line-binary-1 : ../doc/examples/runtime-configuration_1.run-fail.cpp ;
+exe custom-command-line-binary-2 : ../doc/examples/runtime-configuration_2.run-fail.cpp
+                                 : $(requirements_boost_test_full_support) ;
+exe custom-command-line-binary-3 : ../doc/examples/runtime-configuration_3.run-fail.cpp
+                                 : $(requirements_boost_test_full_support) ;
+exe custom-command-line-binary-4 : ../doc/examples/runtime-configuration_4.run-fail.cpp
+                                 : $(requirements_datasets) [ requires cxx11_trailing_result_types cxx11_auto_declarations ] $(l_gcc_c11_rvalue_full_support) ;
+
+alias "custom-command-line-ts"
+:
+# custom command line interface tests
+[ run custom-command-line-binary-1 : -- --specific-param \"'additional value with quotes'\" : : : cla-specific-api1-test-1-1 ]
+[ run custom-command-line-binary-1 : --log_level=all --no_color -- --specific-param \"'additional value with quotes'\" : : : cla-specific-api1-test-1-2 ]
+
+[ run-fail custom-command-line-binary-2 : -- --random-string \"mock_device\" : : $(requirements_boost_test_full_support) : cla-specific-api1-test-2-0 ]
+[ run custom-command-line-binary-2 : -- --device-name \"mock_device\" : : $(requirements_boost_test_full_support) : cla-specific-api1-test-2-1 ]
+[ run custom-command-line-binary-2 : --log_level=all --no_color -- --device-name \"mock_device\" : : $(requirements_boost_test_full_support) : cla-specific-api1-test-2-2 ]
+
+[ run-fail custom-command-line-binary-3 : -- : : $(requirements_boost_test_full_support) : cla-specific-api1-test-3-0 ]
+[ run-fail custom-command-line-binary-3 : -- --create-parametrized : : $(requirements_boost_test_full_support) : cla-specific-api1-test-3-1 ]
+[ run-fail custom-command-line-binary-3 : -- --create-parametrized 3 : : $(requirements_boost_test_full_support) : cla-specific-api1-test-3-2 ]
+[ run custom-command-line-binary-3 : -- --create-parametrized 3 2 : : $(requirements_boost_test_full_support) : cla-specific-api1-test-3-3 ]
+
+[ run-fail custom-command-line-binary-4 : --              : : $(requirements_datasets) [ requires cxx11_trailing_result_types cxx11_auto_declarations ] $(l_gcc_c11_rvalue_full_support) : cla-specific-api1-test-4-0 ]
+[ run-fail custom-command-line-binary-4 : -- --test-file  : : $(requirements_datasets) [ requires cxx11_trailing_result_types cxx11_auto_declarations ] $(l_gcc_c11_rvalue_full_support) : cla-specific-api1-test-4-1 ]
+[ run-fail custom-command-line-binary-4 : -- --test-file  : ../doc/examples/runtime-configuration_4-test-fail.txt : $(requirements_datasets) [ requires cxx11_trailing_result_types cxx11_auto_declarations ] $(l_gcc_c11_rvalue_full_support) : cla-specific-api1-test-4-2 ]
+[ run-fail custom-command-line-binary-4 : --log_level=all --no_color -- --test-file : ../doc/examples/runtime-configuration_4-test-fail.txt : $(requirements_datasets) [ requires cxx11_trailing_result_types cxx11_auto_declarations ] $(l_gcc_c11_rvalue_full_support) : cla-specific-api1-test-4-3 ]
+[ run custom-command-line-binary-4      : -- --test-file  : ../doc/examples/runtime-configuration_4-test.txt : $(requirements_datasets) [ requires cxx11_trailing_result_types cxx11_auto_declarations ] $(l_gcc_c11_rvalue_full_support) : cla-specific-api1-test-4-4 ]
+[ run custom-command-line-binary-4      : --log_level=all --no_color -- --test-file : ../doc/examples/runtime-configuration_4-test.txt : $(requirements_datasets) [ requires cxx11_trailing_result_types cxx11_auto_declarations ] $(l_gcc_c11_rvalue_full_support) : cla-specific-api1-test-4-5 ]
+
 ;
 
 #_________________________________________________________________________________________________#
@@ -349,8 +481,27 @@ alias test
   prg_exec_monitor-ts
   execution_monitor-ts
   doc-examples-ts
+  custom-command-line-ts
 ;
 
 #_________________________________________________________________________________________________#
 
+rule test-selfcontained ( path )
+{
+    for local file in [ path.glob-tree $(path) : *.hpp ]
+    {
+        result += [ compile selfcontained.cpp : $(requirements_datasets) <define>BOOST_HEADER_TEST_NAME=$(file) : [ regex.replace [ path.relative-to $(path) $(file) ] "/" "_" ] ] ;
+    }
+
+    return $(result) ;
+}
+
+# Test for self-contained headers
+alias test_selfcontained_headers : [ test-selfcontained ../include ] ;
+
+
+#_________________________________________________________________________________________________#
+# Tests of the examples
+
+build-project ../example ;
 # EOF