2 # Copyright (c) 2005 João Abecasis
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)
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 ;
23 type.register QUICKBOOK_INPUT : quickbook ;
24 type.register QUICKBOOK_OUTPUT ;
26 generators.register-standard quickbook-testing.process-quickbook : QUICKBOOK_INPUT : QUICKBOOK_OUTPUT ;
28 ################################################################################
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
36 # compare generated boostbook to $(reference-output) or
37 # $(input).gold or $(target-name).gold
39 rule quickbook-test ( target-name : input ? : reference-output ? : requirements * )
41 input ?= $(target-name).quickbook ;
42 reference-output ?= $(input:S=.gold) ;
44 local project = [ project.current ] ;
46 local boost-root = [ modules.peek : BOOST_ROOT ] ;
49 [ targets.create-typed-target QUICKBOOK_OUTPUT
51 : $(target-name).boostbook
54 <location-prefix>$(target-name).test
55 <quickbook-testing.quickbook-command>$(boost-root)/tools/quickbook/src//quickbook
59 [ targets.create-typed-target RUN
62 : $(boost-root)/tools/quickbook/test/src/text_diff.cpp
64 <location-prefix>$(target-name).test2
65 <testing.input-file>$(reference-output)
66 <testing.input-file>$(target-name).boostbook
67 <preserve-test-targets>on
71 local all-tests = [ modules.peek testing : .all-tests ] ;
73 modules.poke testing : .all-tests : $(all-tests) ;
78 rule quickbook-fail-test ( target-name : input ? : requirements * )
80 input ?= $(target-name).quickbook ;
82 local project = [ project.current ] ;
84 local boost-root = [ modules.peek : BOOST_ROOT ] ;
87 [ targets.create-typed-target RUN_FAIL
90 : $(boost-root)/tools/quickbook/src//quickbook
92 <testing.input-file>$(input)
93 <preserve-test-targets>on
98 local all-tests = [ modules.peek testing : .all-tests ] ;
100 modules.poke testing : .all-tests : $(all-tests) ;
105 rule quickbook-error-test ( target-name : input ? : requirements * )
107 input ?= $(target-name).quickbook ;
109 local project = [ project.current ] ;
111 local boost-root = [ modules.peek : BOOST_ROOT ] ;
114 [ targets.create-typed-target RUN
117 : $(boost-root)/tools/quickbook/src//quickbook
119 <testing.input-file>$(input)
120 <testing.arg>--expect-errors
121 <preserve-test-targets>on
126 local all-tests = [ modules.peek testing : .all-tests ] ;
128 modules.poke testing : .all-tests : $(all-tests) ;
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> ;
139 rule process-quickbook ( target : source : properties * )
141 DEPENDS $(target) : [ on $(target) return $(quickbook-command) ] ;
144 actions process-quickbook bind quickbook-command
146 $(quickbook-command) $(>) --output-file=$(<) --debug -D"$(QB-DEFINES)" -I"$(INCLUDES)" --xinclude-base="$(XINCLUDE)"