• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Tribool library
2
3# Copyright (C) 2002-2003 Douglas Gregor
4
5# Use, modification and distribution is subject to the Boost Software License,
6# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7# http://www.boost.org/LICENSE_1_0.txt)
8
9# For more information, see http://www.boost.org/
10
11import path ;
12import os ;
13import regex ;
14import testing ;
15
16local self = logic ;
17
18rule test-expected-failures
19{
20    local all_rules = ;
21    local file ;
22    local tests_path = [ path.make $(BOOST_ROOT)/libs/$(self)/test/compile-fail ] ;
23    for file in [ path.glob-tree $(tests_path) : *.cpp ]
24    {
25        local rel_file = [ path.relative-to $(tests_path) $(file) ] ;
26        local test_name = [ regex.replace [ regex.replace $(rel_file) "/" "-" ] ".cpp" "" ] ;
27        local decl_test_name = cf-$(test_name) ;
28        # ECHO $(rel_file) ;
29        all_rules += [ compile-fail $(file) : : $(decl_test_name) ] ;
30    }
31
32    # ECHO All rules: $(all_rules) ;
33    return $(all_rules) ;
34}
35
36rule test-header-isolation
37{
38    local all_rules = ;
39    local file ;
40    local headers_path = [ path.make $(BOOST_ROOT)/libs/$(self)/include ] ;
41    for file in [ path.glob-tree $(headers_path) : *.hpp ]
42    {
43        local rel_file = [ path.relative-to $(headers_path) $(file) ] ;
44        # Note: The test name starts with '~' in order to group these tests in the test report table, preferably at the end.
45        #       All '/' are replaced with '-' because apparently test scripts have a problem with test names containing slashes.
46        local test_name = [ regex.replace $(rel_file) "/" "-" ] ;
47        local decl_test_name = ~hdr-decl-$(test_name) ;
48        # ECHO $(rel_file) ;
49        all_rules += [ compile compile/decl_header.cpp : <define>"BOOST_TEST_HEADER=$(rel_file)" <dependency>$(file) : $(decl_test_name) ] ;
50    }
51
52    # ECHO All rules: $(all_rules) ;
53    return $(all_rules) ;
54}
55
56  test-suite logic  :
57    [ test-expected-failures ]
58    [ test-header-isolation ]
59    [ run tribool_test.cpp ]
60    [ run tribool_rename_test.cpp ]
61    [ run tribool_io_test.cpp ]
62   ;
63