]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/quickbook/test/quickbook-testing.jam
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / tools / quickbook / test / quickbook-testing.jam
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
9 import feature ;
10 import generators ;
11 import modules ;
12 import project ;
13 import targets ;
14 import testing ;
15 import toolset ;
16 import type ;
17
18 feature.feature quickbook-testing.quickbook-command : : free dependency ;
19 feature.feature <quickbook-test-define> : : free ;
20 feature.feature <quickbook-test-include> : : free path ;
21 feature.feature <quickbook-xinclude-base> : : free ;
22
23 type.register QUICKBOOK_INPUT : quickbook ;
24 type.register QUICKBOOK_OUTPUT ;
25
26 generators.register-standard quickbook-testing.process-quickbook : QUICKBOOK_INPUT : QUICKBOOK_OUTPUT ;
27
28 ################################################################################
29 #
30 # quickbook-test - generates a test for quickbook itself. A quickbook-test is
31 # actually made up of two tests:
32 # $(target-name).boostbook :
33 # generate boostbook from $(input) or $(target-name).quickbook
34 #
35 # $(target-name):
36 # compare generated boostbook to $(reference-output) or
37 # $(input).gold or $(target-name).gold
38 #
39 rule quickbook-test ( target-name : input ? : reference-output ? : requirements * )
40 {
41 input ?= $(target-name).quickbook ;
42 reference-output ?= $(input:S=.gold) ;
43
44 local project = [ project.current ] ;
45
46 local boost-root = [ modules.peek : BOOST_ROOT ] ;
47
48 local t1 =
49 [ targets.create-typed-target QUICKBOOK_OUTPUT
50 : $(project)
51 : $(target-name).boostbook
52 : $(input)
53 : $(requirements)
54 <location-prefix>$(target-name).test
55 <quickbook-testing.quickbook-command>$(boost-root)/tools/quickbook/src//quickbook
56 ] ;
57
58 local t2 =
59 [ targets.create-typed-target RUN
60 : $(project)
61 : $(target-name)
62 : $(boost-root)/tools/quickbook/test/src/text_diff.cpp
63 : $(requirements)
64 <location-prefix>$(target-name).test2
65 <testing.input-file>$(reference-output)
66 <testing.input-file>$(target-name).boostbook
67 <preserve-test-targets>on
68 ]
69 ;
70
71 local all-tests = [ modules.peek testing : .all-tests ] ;
72 all-tests += $(t2) ;
73 modules.poke testing : .all-tests : $(all-tests) ;
74
75 return $(t1) $(t2) ;
76 }
77
78 rule quickbook-fail-test ( target-name : input ? : requirements * )
79 {
80 input ?= $(target-name).quickbook ;
81
82 local project = [ project.current ] ;
83
84 local boost-root = [ modules.peek : BOOST_ROOT ] ;
85
86 local t =
87 [ targets.create-typed-target RUN_FAIL
88 : $(project)
89 : $(target-name)
90 : $(boost-root)/tools/quickbook/src//quickbook
91 : $(requirements)
92 <testing.input-file>$(input)
93 <preserve-test-targets>on
94 <dependency>$(input)
95 ]
96 ;
97
98 local all-tests = [ modules.peek testing : .all-tests ] ;
99 all-tests += $(t) ;
100 modules.poke testing : .all-tests : $(all-tests) ;
101
102 return $(t) ;
103 }
104
105 rule quickbook-error-test ( target-name : input ? : requirements * )
106 {
107 input ?= $(target-name).quickbook ;
108
109 local project = [ project.current ] ;
110
111 local boost-root = [ modules.peek : BOOST_ROOT ] ;
112
113 local t =
114 [ targets.create-typed-target RUN
115 : $(project)
116 : $(target-name)
117 : $(boost-root)/tools/quickbook/src//quickbook
118 : $(requirements)
119 <testing.input-file>$(input)
120 <testing.arg>--expect-errors
121 <preserve-test-targets>on
122 <dependency>$(input)
123 ]
124 ;
125
126 local all-tests = [ modules.peek testing : .all-tests ] ;
127 all-tests += $(t) ;
128 modules.poke testing : .all-tests : $(all-tests) ;
129
130 return $(t) ;
131 }
132
133 ################################################################################
134 toolset.flags quickbook-testing.process-quickbook quickbook-command <quickbook-testing.quickbook-command> ;
135 toolset.flags quickbook-testing.process-quickbook QB-DEFINES <quickbook-test-define> ;
136 toolset.flags quickbook-testing.process-quickbook XINCLUDE <quickbook-xinclude-base> ;
137 toolset.flags quickbook-testing.process-quickbook INCLUDES <quickbook-test-include> ;
138
139 rule process-quickbook ( target : source : properties * )
140 {
141 DEPENDS $(target) : [ on $(target) return $(quickbook-command) ] ;
142 }
143
144 actions process-quickbook bind quickbook-command
145 {
146 $(quickbook-command) $(>) --output-file=$(<) --debug -D"$(QB-DEFINES)" -I"$(INCLUDES)" --xinclude-base="$(XINCLUDE)"
147 }
148