# copyright John Maddock 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)

# bring in the rules for testing
import testing ;
import os ;

if [ os.environ CI ]
{
    CI_DEFINES = <define>CI_SUPPRESS_KNOWN_ISSUES=1 ;
}


# type_traits in V1 seem to have two modes: standalone, triggered
# by a command line option, and a regular. For now, just imitate
# regular

project : requirements
   <library>/boost/core//boost_core
   <library>/boost/move//boost_move
   <library>/boost/mpl//boost_mpl

   # default to all warnings on:
   <warnings>all
   # set warnings as errors for those compilers we know we get warning free:
   <toolset>gcc:<cxxflags>-Wextra
   <toolset>gcc:<cxxflags>-Wno-uninitialized
   <toolset>gcc:<cxxflags>-Wno-int-in-bool-context
   <toolset>gcc:<cxxflags>-Wno-bool-operation
   <toolset>gcc:<cxxflags>-Wundef
   <toolset>gcc:<warnings-as-errors>on
   <toolset>intel:<warnings-as-errors>on
   <toolset>sun:<warnings-as-errors>on
   <toolset>msvc:<warnings-as-errors>on
   <include>libs/tt2/light/include
   $(CI_DEFINES)
;

rule all-tests {
     local result ;
     for local source in [ glob *_test*.cpp ]
     {
         result += [ run $(source) ] ;
     }
     for local source in [ glob compile_fail/*.cpp ]
     {
         result += [ compile-fail $(source) ] ;
     }
     #
     # These traits have both intrinsic support, and a std conforming version, test a version with intrinsics disabled for better code coverage:
     #
     for local source in has_nothrow_assign_test has_nothrow_constr_test has_nothrow_copy_test is_nothrow_move_assignable_test is_nothrow_move_constructible_test
     {
         result += [ run $(source).cpp : : : <define>BOOST_TT_DISABLE_INTRINSICS : $(source)_no_intrinsics ] ;
     }
     return $(result) ;
}

test-suite type_traits : [ all-tests ] ;


