# Copyright (c) 2018 Mateusz Loskot <mateusz@loskot.net>
# Copyright Klemens David Morgenstern, Hans P. Dembinski 2016-2017
#
# 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)

import os ;
import regex ;
import testing ;
import ../../config/checks/config : requires ;

path-constant THIS_PATH : . ;

local XML_PATH ;

if [ os.on-windows ]
{
  XML_PATH = [ regex.replace "$(THIS_PATH)\\" "\\\\" "\\\\\\\\" ] ;
}
else {
  XML_PATH = "$(THIS_PATH)/" ;
}

project
    : requirements
    <include>$(THIS_PATH)
    <define>XML_PATH=\\\"$(XML_PATH)\\\"
    [ requires
      cxx14_constexpr cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx11_user_defined_literals
      # list could go on...
    ]
    <threading>multi
    ;

test-suite minimal :
    [ run algorithm_project_test.cpp ]
    [ run algorithm_reduce_test.cpp ]
    [ run algorithm_sum_test.cpp ]
    [ run axis_category_test.cpp ]
    [ run axis_integer_test.cpp ]
    [ run axis_option_test.cpp ]
    [ run axis_regular_test.cpp ]
    [ run axis_size.cpp ]
    [ run axis_traits_test.cpp ]
    [ run axis_variable_test.cpp ]
    [ run axis_variant_test.cpp ]
    [ run boost_accumulators_support_test.cpp  ]
    [ run boost_range_support_test.cpp ]
    [ run boost_units_support_test.cpp ]
    [ run detail_test.cpp ]
    [ run histogram_dynamic_test.cpp ]
    [ run histogram_growing_test.cpp ]
    [ run histogram_mixed_test.cpp ]
    [ run histogram_operators_test.cpp ]
    [ run histogram_test.cpp ]
    [ run indexed_test.cpp ]
    [ run internal_accumulators_test.cpp ]
    [ run linearize_test.cpp ]
    [ run meta_test.cpp ]
    [ run storage_adaptor_test.cpp ]
    [ run unlimited_storage_test.cpp ]
    [ run utility_test.cpp ]
    ;

# has additional requirements only available on develop branch
test-suite deduction_guides : [ run deduction_guides_test.cpp ] ;

alias libserial : /boost/serialization//boost_serialization : <link>static ;

test-suite serial :
    [ run storage_adaptor_serialization_test.cpp libserial ]
    [ run histogram_serialization_test.cpp libserial ]
    [ run unlimited_storage_serialization_test.cpp libserial ]
    ;

test-suite all : minimal serial ;

explicit minimal ;
explicit libserial ;
explicit serial ;
explicit accumulator ;
explicit deduction_guides ;
