Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/quickbook/test/quickbook-testing.jam @ 50

Last change on this file since 50 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 2.5 KB
Line 
1#
2#   Copyright (c) 2005 João Abecasis
3#
4#   Distributed under the Boost Software License, Version 1.0. (See
5#   accompanying file LICENSE_1_0.txt or copy at
6#   http://www.boost.org/LICENSE_1_0.txt)
7#
8
9import feature ;
10import generators ;
11import modules ;
12import project ;
13import targets ;
14import testing ;
15import toolset ;
16import type ;
17
18feature.feature quickbook-testing.quickbook-command : : free dependency ;
19
20type.register QUICKBOOK_INPUT : quickbook ;
21type.register QUICKBOOK_OUTPUT ;
22
23generators.register-standard quickbook-testing.process-quickbook : QUICKBOOK_INPUT : QUICKBOOK_OUTPUT ;
24
25################################################################################
26exe line-compare-tool : src/text_diff.cpp ;
27
28#
29#   quickbook-test - generates a test for quickbook itself. A quickbook-test is
30#   actually made up of two tests:
31#           $(target-name).boostbook :
32#               generate boostbook from $(input) or $(target-name).quickbook
33#
34#           $(target-name):
35#               compare generated boostbook to $(reference-output) or
36#               $(input).gold or $(target-name).gold
37#
38rule quickbook-test ( target-name : input ? : reference-output ? : requirements * )
39{
40    input ?= $(target-name).quickbook ;
41    reference-output ?= $(input:S=.gold) ;
42
43    local project = [ project.current ] ;
44
45    local t =
46        [ targets.create-typed-target QUICKBOOK_OUTPUT
47            : $(project)
48            : $(target-name).boostbook
49            : $(input)
50            : $(requirements)
51                <location-prefix>$(target-name).test
52                <quickbook-testing.quickbook-command>..//quickbook
53        ]
54
55        [ targets.create-typed-target RUN
56            : $(project)
57            : $(target-name)
58            : .//line-compare-tool
59            : $(requirements)
60                <location-prefix>$(target-name).test
61                <testing.input-file>$(reference-output)
62                <testing.input-file>$(target-name).boostbook
63        ]
64        ;
65
66    modules.poke testing : .all-tests : \$\(all-tests\) $(t) ;
67
68    return $(t) ;
69}
70
71################################################################################
72toolset.flags quickbook-testing.process-quickbook quickbook-command <quickbook-testing.quickbook-command> ;
73rule process-quickbook ( target : source : properties * )
74{
75    DEPENDS $(target) : [ on $(target) return $(quickbook-command) ] ;
76}
77
78actions process-quickbook bind quickbook-command
79{
80    $(quickbook-command) $(>) --output-file=$(<) --debug
81}
Note: See TracBrowser for help on using the repository browser.