# (C) Copyright 2010: Tim Blechmann
# Distributed under 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 testing ;
import path ;
import regex ;

project
    : source-location .
    : requirements
        <threading>multi
        <hardcode-dll-paths>true
        <library>/boost/sync//boost_sync
        <library>/boost/system//boost_system
        <library>/boost/thread//boost_thread
        <library>/boost/date_time//boost_date_time
        <library>/boost/test//boost_unit_test_framework
    ;


rule test_all
{
   local all_rules = ;

   for local fileb in [ glob run/*.cpp ]
   {
      local test_id = [ MATCH "(.+)\.cpp" : [ path.basename $(fileb) ] ] ;
      # ECHO $(test_id) ;

      all_rules += [ run $(fileb)
      : # additional args
      : # test-files
      : # requirements
          <define>BOOST_TEST_MODULE=$(test_id)
      ] ;
   }

    return $(all_rules) ;
}

test-suite sync : [ test_all r ] : <threading>multi ;
