# Boost regression-testing Jamfile
#  (C) Copyright David Abrahams 2002. Permission to copy, use, modify, sell and
#  distribute this software is granted provided this copyright notice appears in
#  all copies. This software is provided "as is" without express or implied
#  warranty, and with no claim as to its suitability for any purpose.

subproject status ;

# bring in the rules for testing
SEARCH on testing.jam = $(BOOST_BUILD_PATH) ;
include testing.jam ;

# Note that the Compiler Status Report HTML generator scans
# these rule invocations to find test type. That program is
# pretty stupid and needs help, including test names (if supplied)
# which are unambiguous, not the same as a .cpp file name, and
# preceded and followed by a space. 

{
    # look in BOOST_ROOT for sources first, just in this Jamfile
    local SEARCH_SOURCE = $(BOOST_ROOT) $(SEARCH_SOURCE) ;
    
    test-suite "bind"
        : [ run libs/bind/bind_test.cpp ]
          [ run libs/bind/bind_test.cpp ]
          [ run libs/bind/mem_fn_test.cpp ]
          [ run libs/bind/mem_fn_void_test.cpp ]
        ;

    test-suite config
        : [ run libs/config/test/config_test.cpp 
                : #args
                : #input-files
                : #requirements
                <threading>multi
          ]
           [ run libs/config/test/config_info.cpp ]
           [ run libs/config/test/limits_test.cpp ]
        ;

    run libs/any/any_test.cpp ;

    run libs/array/array1.cpp ;

    test-suite concept_check
        : [ compile libs/concept_check/concept_check_test.cpp ]
          [ compile libs/concept_check/class_concept_check_test.cpp ]
          [ link-fail libs/concept_check/concept_check_fail_expected.cpp ]
          [ link-fail libs/concept_check/class_concept_fail_expected.cpp ]
        ;

    test-suite conversion
        : [ run libs/conversion/cast_test.cpp ]
          [ run libs/conversion/lexical_cast_test.cpp ]
        ;

    run libs/crc/crc_test.cpp ;

    run libs/function/test/function_test.cpp ;

    run libs/functional/function_test.cpp ;

    run libs/graph/test/graph.cpp ;


    test-suite integer
        : [ run libs/integer/cstdint_test.cpp ]
          [ run libs/integer/integer_test.cpp ]
          [ run libs/integer/integer_traits_test.cpp ]
        ;

    run 
      libs/io/test/ios_state_test.cpp   # sources
      : # args
      : # input-files
      : <runtime-link>static # requirements (static runtime required by Metrowerks)
      ;

    test-suite lambda
        : [ run libs/lambda/test/bind_tests_simple.cpp ]
          [ run libs/lambda/test/bind_tests_advanced.cpp ]
          [ run libs/lambda/test/bind_tests_simple_f_refs.cpp ]
          [ run libs/lambda/test/bll_and_function.cpp ]
          [ run libs/lambda/test/cast_test.cpp ]
          [ run libs/lambda/test/constructor_tests.cpp ]
          [ run libs/lambda/test/control_structures.cpp ]
          [ run libs/lambda/test/exception_test.cpp ]
          [ run libs/lambda/test/extending_rt_traits.cpp ]
          [ run libs/lambda/test/is_instance_of_test.cpp ]
          [ run libs/lambda/test/member_pointer_test.cpp ]
          [ run libs/lambda/test/operator_tests_simple.cpp ]
          [ run libs/lambda/test/phoenix_control_structures.cpp ]
          [ run libs/lambda/test/switch_construct.cpp ]
        ;

    test-suite math
        : [ run libs/math/test/common_factor_test.cpp ]
          [ run libs/math/octonion/octonion_test.cpp ]
          [ run libs/math/quaternion/quaternion_test.cpp ]
          [ run libs/math/special_functions/special_functions_test.cpp ]
        ;

    run libs/pool/test/test_pool_alloc.cpp ;

    test-suite rational
        : [ run libs/rational/rational_example.cpp ]
          [ run libs/rational/rational_test.cpp ]
        ;

    test-suite random
        : [ run libs/random/random_test.cpp ]
          [ run libs/random/random_demo.cpp ]
        ;

    run libs/utility/ref_test.cpp ;

    {
            local test-dir = $(BOOST_ROOT)$(SLASH)libs$(SLASH)regex$(SLASH)test$(SLASH)regress$(SLASH) ;

            local test-files = $(test-dir)tests.txt
            # dwa -- not sure if this is generally applicable
            #  $(test-dir)test1252.txt
            ;

        test-suite regex
        : [ run libs/regex/test/regress/parse.cpp libs/regex/test/regress/regress.cpp libs/regex/test/regress/tests.cpp
                    <lib>../libs/regex/build/boost_regex$(SUFLIB) 
           : 
                    $(test-files)
           : 
           : 
                    <define>BOOST_REGEX_NO_LIB=1
                    <define>BOOST_REGEX_STATIC_LINK=1
           :
                    regress ]

            [ run libs/regex/test/regress/parse.cpp libs/regex/test/regress/regress.cpp libs/regex/test/regress/tests.cpp
                    <lib>../libs/regex/build/boost_regex$(SUFLIB) 
            : 
                    $(test-files)
            : 
            : 
                    <define>BOOST_REGEX_NO_LIB=1
                    <define>TEST_UNICODE=1
                    <define>BOOST_REGEX_STATIC_LINK=1
            :
                    wregress ]

            [ run libs/regex/test/c_compiler_checks/posix_api_check.c
                    <lib>../libs/regex/build/boost_regex$(SUFLIB) 
            : 
            : 
            : 
                    <define>BOOST_REGEX_NO_LIB=1
                    <define>BOOST_REGEX_STATIC_LINK=1
            :
                    posix_api_check_c ]

            [ run libs/regex/test/c_compiler_checks/wide_posix_api_check.c
                    <lib>../libs/regex/build/boost_regex$(SUFLIB) 
            : 
            : 
            : 
                    <define>BOOST_REGEX_NO_LIB=1
                    <define>BOOST_REGEX_STATIC_LINK=1
            :
                    wide_posix_api_check_c ]

            [ run libs/regex/test/c_compiler_checks/posix_api_check.cpp
                    <lib>../libs/regex/build/boost_regex$(SUFLIB) 
            : 
            : 
            : 
                    <define>BOOST_REGEX_NO_LIB=1
                    <define>BOOST_REGEX_STATIC_LINK=1
            ]

            [ run libs/regex/test/c_compiler_checks/wide_posix_api_check.cpp
                    <lib>../libs/regex/build/boost_regex$(SUFLIB) 
            : 
            : 
            : 
                    <define>BOOST_REGEX_NO_LIB=1
                    <define>BOOST_REGEX_STATIC_LINK=1
            ]

     ;

    }


    run libs/smart_ptr/smart_ptr_test.cpp ;

    test-suite static_assert
        : [ compile libs/static_assert/static_assert_test.cpp ]
          [ compile-fail libs/static_assert/static_assert_test_fail_1.cpp ]
          [ compile-fail libs/static_assert/static_assert_test_fail_2.cpp ]
          [ compile-fail libs/static_assert/static_assert_test_fail_3.cpp ]
          [ compile-fail libs/static_assert/static_assert_test_fail_4.cpp ]
          [ compile-fail libs/static_assert/static_assert_test_fail_5.cpp ]
          [ compile-fail libs/static_assert/static_assert_test_fail_6.cpp ]
          [ compile-fail libs/static_assert/static_assert_test_fail_7.cpp ]
          [ link-fail libs/static_assert/static_assert_test_fail_8.cpp ]
        ;

    run libs/test/example/test_tools_example.cpp ;

    run-fail libs/test/test/test_tools_fail2.cpp ;

    {
        local threadmon ;
        if $(NT)
        {
            threadmon = <dll>../libs/thread/build/boost_threadmon ;
        }

        test-suite threads
          : [
            run libs/thread/test/test_thread.cpp
              <lib>../libs/thread/build/boost_thread 
              $(threadmon)
                : #args
                : #input-files
                : #requirements
                <threading>multi
          ]
            ;
    }


    compile libs/timer/timer_test.cpp ;

    test-suite tokenizer
        : [ run libs/tokenizer/examples.cpp ]
          [ run libs/tokenizer/simple_example_1.cpp ]
          [ run libs/tokenizer/simple_example_2.cpp ]
          [ run libs/tokenizer/simple_example_3.cpp ]
          [ run libs/tokenizer/simple_example_4.cpp ]
          [ run libs/tokenizer/simple_example_5.cpp ]
        ;

    test-suite type_traits
        : [ run libs/type_traits/tests/alignment_test.cpp ]
          [ run libs/type_traits/tests/arithmetic_traits_test.cpp ]
          [ run libs/type_traits/tests/composite_traits_test.cpp ]
          [ run libs/type_traits/tests/cv_traits_test.cpp ]
          [ run libs/type_traits/tests/is_function_test.cpp ]
          [ run libs/type_traits/tests/is_convertible_test.cpp ]
          [ run libs/type_traits/tests/is_same_test.cpp ]
          [ run libs/type_traits/tests/object_type_traits_test.cpp ]
          [ run libs/type_traits/tests/transform_traits_test.cpp ]
        ;

    run libs/utility/call_traits_test.cpp : -u ;

    compile-fail libs/utility/checked_delete_test.cpp ;

    run libs/utility/compressed_pair_test.cpp : -u ;

    test-suite iterator_adaptors
        : [ run libs/utility/counting_iterator_test.cpp : # args
            : # input files
            : # requirements

            # borland warns incorrectly in this case, so often that
            # successful compilation is prevented.
            <borland><*><cxxflags>"-w-8091 -w-8092"
          ]

          [ run libs/utility/iterator_adaptor_test.cpp ] 
          [ compile-fail libs/utility/iter_adaptor_fail_expected1.cpp ] 
          [ compile-fail libs/utility/iter_adaptor_fail_expected2.cpp ]
          [ run libs/utility/transform_iterator_test.cpp ]
          [ run libs/utility/indirect_iterator_test.cpp ]
          [ run libs/utility/iter_traits_gen_test.cpp ]

          [ run libs/utility/iterator_adaptor_examples.cpp ]
          [ run libs/utility/counting_iterator_example.cpp ]
          [ run libs/utility/filter_iterator_example.cpp ]
          [ run libs/utility/fun_out_iter_example.cpp ]
          [ run libs/utility/indirect_iterator_example.cpp ]
          [ run libs/utility/projection_iterator_example.cpp ]
          [ run libs/utility/reverse_iterator_example.cpp ]
          [ run libs/utility/transform_iterator_example.cpp ]
        ;    

    run libs/utility/iterator_traits_test.cpp ;

    run libs/utility/iterators_test.cpp ;

    compile-fail libs/utility/noncopyable_test.cpp ;

    run libs/utility/numeric_traits_test.cpp ;

    run libs/utility/operators_test.cpp ;

    run libs/utility/tie_example.cpp ;

    run libs/utility/binary_search_test.cpp ;

    test-suite multi_array
        : [ run libs/multi_array/test/constructors.cpp ]
          [ run libs/multi_array/test/access.cpp ]
          [ run libs/multi_array/test/compare.cpp ]
          [ run libs/multi_array/test/iterators.cpp ]
          [ run libs/multi_array/test/slice.cpp ]
          [ run libs/multi_array/test/assign.cpp ]
          [ run libs/multi_array/test/index_bases.cpp ]
          [ run libs/multi_array/test/storage_order.cpp ]
          [ run libs/multi_array/test/reshape.cpp ]
          [ run libs/multi_array/test/range1.cpp  ]
          [ run libs/multi_array/test/idxgen1.cpp ]
          [ run libs/multi_array/test/stl_interaction.cpp ]
          [ compile libs/multi_array/test/concept_checks.cpp ]
          [ compile-fail libs/multi_array/test/fail_cbracket.cpp ]
          [ compile-fail libs/multi_array/test/fail_cdata.cpp ]
          [ compile-fail libs/multi_array/test/fail_citerator.cpp ]
          [ compile-fail libs/multi_array/test/fail_cparen.cpp ]
          [ compile-fail libs/multi_array/test/fail_criterator.cpp ]
          [ compile-fail libs/multi_array/test/fail_csubarray.cpp ]
          [ compile-fail libs/multi_array/test/fail_csubarray2.cpp ]
          [ compile-fail libs/multi_array/test/fail_csubarray3.cpp ]
          [ compile-fail libs/multi_array/test/fail_cview.cpp ]
          [ compile-fail libs/multi_array/test/fail_cview2.cpp ]
          [ compile-fail libs/multi_array/test/fail_cview3.cpp ]
          [ compile-fail libs/multi_array/test/fail_ref_cbracket.cpp ]
          [ compile-fail libs/multi_array/test/fail_ref_cdata.cpp ]
          [ compile-fail libs/multi_array/test/fail_ref_citerator.cpp ]
          [ compile-fail libs/multi_array/test/fail_ref_cparen.cpp ]
          [ compile-fail libs/multi_array/test/fail_ref_criterator.cpp ]
          [ compile-fail libs/multi_array/test/fail_ref_csubarray.cpp ]
          [ compile-fail libs/multi_array/test/fail_ref_csubarray2.cpp ]
          [ compile-fail libs/multi_array/test/fail_ref_csubarray3.cpp ]
          [ compile-fail libs/multi_array/test/fail_ref_cview.cpp ]
          [ compile-fail libs/multi_array/test/fail_ref_cview2.cpp ]
          [ compile-fail libs/multi_array/test/fail_ref_cview3.cpp ]
        ;
}
