• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Boost.Assign library
2#
3#  Copyright Thorsten Ottosen 2003-2005. Use, modification and
4#  distribution is subject to the Boost Software License, Version
5#  1.0. (See accompanying file LICENSE_1_0.txt or copy at
6#  http://www.boost.org/LICENSE_1_0.txt)
7#
8# For more information, see http://www.boost.org/libs/assign/
9#
10
11import path ;
12import regex ;
13
14rule assign-test ( name )
15{
16    return [
17        run $(name).cpp /boost/test//boost_unit_test_framework/<link>static ]
18        ;
19}
20
21# this rule enumerates through all the headers and ensures
22# that inclusion of the header by itself is sufficient to
23# compile successfully, proving the header does not depend
24# on any other headers to be included first - adapted from
25# logic in the winapi test bjam script
26rule test_headers
27{
28    local all_rules = ;
29    local file ;
30    local headers_path = [ path.make $(BOOST_ROOT)/libs/assign/include/boost/assign ] ;
31    for file in [ path.glob-tree $(headers_path) : *.hpp : assign ]
32    {
33        local rel_file = [ path.relative-to $(headers_path) $(file) ] ;
34        # Note: The test name starts with '~' in order to group these tests in the test report table, preferably at the end.
35        #       All '/' are replaced with '-' because apparently test scripts have a problem with test names containing slashes.
36        local test_name = [ regex.replace $(rel_file) "/" "-" ] ;
37        local decl_test_name = ~hdr-decl-$(test_name) ;
38        # ECHO $(rel_file) ;
39        all_rules += [ compile compile/decl_header.cpp : <define>"BOOST_ASSIGN_TEST_HEADER=$(rel_file)" <dependency>$(file) : $(decl_test_name) ] ;
40    }
41
42    local tests_path = [ path.make $(BOOST_ROOT)/libs/assign/test/compile-fail ] ;
43    for file in [ path.glob-tree $(tests_path) : *.cpp ]
44    {
45        local rel_file = [ path.relative-to $(tests_path) $(file) ] ;
46        local test_name = [ regex.replace [ regex.replace $(rel_file) "/" "-" ] ".cpp" "" ] ;
47        local decl_test_name = cf-$(test_name) ;
48        # ECHO $(rel_file) ;
49        all_rules += [ compile-fail $(file) : : $(decl_test_name) ] ;
50    }
51
52    # ECHO All rules: $(all_rules) ;
53    return $(all_rules) ;
54}
55
56
57test-suite assign :
58    [ test_headers ]
59    [ assign-test basic ]
60    [ assign-test std ]
61    [ assign-test array ]
62    [ assign-test list_of ]
63    [ assign-test ptr_list_of ]
64    [ assign-test static_list_of ]
65    [ assign-test tuple_list_of ]
66    [ assign-test list_inserter ]
67    [ assign-test ptr_list_inserter ]
68    [ assign-test ptr_map_inserter ]
69    [ assign-test list_of_workaround ]
70    [ assign-test email_example ]
71    [ assign-test my_vector_example ]
72    [ assign-test multi_index_container ]
73    ;
74
75
76