#==============================================================================
#   Copyright (c) 2001-2013 Joel de Guzman
#   Copyright (c) 2001-2012 Hartmut Kaiser
#   Copyright (c)      2011 Bryce Lelbach
#
#   Use, modification and distribution is 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 rules for testing
import testing ;
import modules ;
import feature ;

###############################################################################
project spirit_test
    : requirements
        <include>.
        <toolset>gcc:<cxxflags>-std=c++1y
        <toolset>gcc:<cxxflags>-ftemplate-depth-512
        <toolset>clang:<cxxflags>-std=c++1y
        <toolset>clang:<cxxflags>-ftemplate-depth-512
        <toolset>darwin:<cxxflags>-std=c++1y
        <toolset>darwin:<cxxflags>-ftemplate-depth-512
    :
    :
    ;

tests = ;

rule run ( sources + : args * : input-files * : requirements * : target-name ? :  default-build * )
{
    target-name ?= $(sources[1]:D=:S=) ;
    tests += [ testing.run $(sources) : $(args)
      : $(input-files) : $(requirements) : $(target-name)-p3 : $(default-build) ] ;
}

rule compile ( sources + : requirements * : target-name ? )
{
    target-name ?= $(sources[1]:D=:S=) ;
    tests += [ testing.compile $(sources) : $(requirements) : $(target-name)-p3 ] ;
}

rule compile-fail ( sources + : requirements * : target-name ? )
{
    target-name ?= $(sources[1]:D=:S=) ;
    tests += [ testing.compile-fail $(sources) : $(requirements) : $(target-name)-p3 ] ;
}

###############################################################################

{
    ###########################################################################
    test-suite spirit_v3/qi :

     [ run actions.cpp          : : : : x3_actions ]
     [ run alternative.cpp      : : : : x3_alternative ]
     [ run and_predicate.cpp    : : : : x3_and_predicate ]
     [ run any_parser.cpp    : : : : x3_any_parser ]
     [ run attr.cpp             : : : : x3_attr ]
     [ run binary.cpp           : : : : x3_binary ]
     [ run bool.cpp             : : : : x3_bool ]
     [ run char1.cpp            : : : : x3_char1 ]
     [ run char_class.cpp       : : : : x3_char_class ]
     [ run debug.cpp            : : : : x3_debug ]
     [ run difference.cpp       : : : : x3_difference ]
     [ run eoi.cpp              : : : : x3_eoi ]
     [ run eol.cpp              : : : : x3_eol ]
     [ run eps.cpp              : : : : x3_eps ]
     [ run expect.cpp           : : : : x3_expect ]
     [ run int1.cpp             : : : : x3_int1 ]
     [ run kleene.cpp           : : : : x3_kleene ]
     [ run lexeme.cpp           : : : : x3_lexeme ]
     [ run lit1.cpp             : : : : x3_lit1 ]
     [ run lit2.cpp             : : : : x3_lit2 ]
     [ run list.cpp             : : : : x3_list ]
     [ run matches.cpp          : : : : x3_matches ]
     [ run no_case.cpp          : : : : x3_no_case ]
     [ run no_skip.cpp          : : : : x3_no_skip ]
     [ run not_predicate.cpp    : : : : x3_not_predicate ]
     [ run optional.cpp         : : : : x3_optional ]
     [ run plus.cpp             : : : : x3_plus ]
     [ run with.cpp             : : : : x3_with ]

     [ run raw.cpp              : : : : x3_raw ]
     [ run real1.cpp            : : : : x3_real1 ]
     [ run real2.cpp            : : : : x3_real2 ]
     [ run real3.cpp            : : : : x3_real3 ]
     [ run real4.cpp            : : : : x3_real4 ]
     [ run rule1.cpp            : : : : x3_rule1 ]
     [ run rule2.cpp            : : : : x3_rule2 ]
     [ run rule3.cpp            : : : : x3_rule3 ]
     [ run rule4.cpp            : : : : x3_rule4 ]
     [ run sequence.cpp         : : : : x3_sequence ]
     [ run skip.cpp             : : : : x3_skip ]
     [ run symbols1.cpp         : : : : x3_symbols1 ]
     [ run symbols2.cpp         : : : : x3_symbols2 ]
     [ run symbols3.cpp         : : : : x3_symbols3 ]
     [ run tst.cpp
       $(BOOST_ROOT)/libs/system/build//boost_system
                                   : : : : x3_tst ]
     [ run uint1.cpp            : : : : x3_uint1 ]
     [ run uint_radix.cpp       : : : : x3_uint_radix ]

     [ run confix.cpp           : : : : x3_confix ]
     [ run repeat.cpp           : : : : x3_repeat ]
     [ run seek.cpp             : : : : x3_seek ]

     [ run x3_variant.cpp       : : : : x3_variant ]

    ;
}
