From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- .../tools/quickbook/test/quickbook-testing.jam | 185 +++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 src/boost/tools/quickbook/test/quickbook-testing.jam (limited to 'src/boost/tools/quickbook/test/quickbook-testing.jam') diff --git a/src/boost/tools/quickbook/test/quickbook-testing.jam b/src/boost/tools/quickbook/test/quickbook-testing.jam new file mode 100644 index 00000000..a4529497 --- /dev/null +++ b/src/boost/tools/quickbook/test/quickbook-testing.jam @@ -0,0 +1,185 @@ +# +# Copyright (c) 2005 João Abecasis +# +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# + +import feature ; +import generators ; +import modules ; +import project ; +import targets ; +import testing ; +import toolset ; +import type ; + +feature.feature quickbook-testing.quickbook-command : : free dependency ; +feature.feature : : free ; +feature.feature : : free path ; +feature.feature : : free ; + +type.register QUICKBOOK_INPUT : quickbook ; +type.register QUICKBOOK_OUTPUT ; +type.register QUICKBOOK_HTML_OUTPUT ; + +generators.register-standard quickbook-testing.process-quickbook : QUICKBOOK_INPUT : QUICKBOOK_OUTPUT ; +generators.register-standard quickbook-testing.process-quickbook-html : QUICKBOOK_INPUT : QUICKBOOK_HTML_OUTPUT ; + +################################################################################ +# +# quickbook-test - generates a test for quickbook itself. A quickbook-test is +# actually made up of two tests: +# $(target-name).boostbook : +# generate boostbook from $(input) or $(target-name).quickbook +# +# $(target-name): +# compare generated boostbook to $(reference-output) or +# $(input).gold or $(target-name).gold +# +rule quickbook-test ( target-name : input ? : reference-output ? : requirements * ) +{ + input ?= $(target-name).quickbook ; + reference-output ?= $(input:S=.gold) ; + reference-output-html = $(input:S=.gold-html) ; + + local project = [ project.current ] ; + + local boost-root = [ modules.peek : BOOST_ROOT ] ; + + local t1 = + [ targets.create-typed-target QUICKBOOK_OUTPUT + : $(project) + : $(target-name).boostbook + : $(input) + : $(requirements) + $(target-name).test + $(boost-root)/tools/quickbook/src//quickbook + ] ; + + local t2 = + [ targets.create-typed-target RUN + : $(project) + : $(target-name) + : $(boost-root)/tools/quickbook/test/src/text_diff.cpp + : $(requirements) + $(target-name).test2 + $(reference-output) + $(target-name).boostbook + on + ] ; + + local t1-html = + [ targets.create-typed-target QUICKBOOK_HTML_OUTPUT + : $(project) + : $(target-name).html + : $(input) + : $(requirements) + $(target-name).test-html + $(boost-root)/tools/quickbook/src//quickbook + ] ; + + local t2-html = + [ targets.create-typed-target RUN + : $(project) + : $(target-name)-compare-html + : $(boost-root)/tools/quickbook/test/src/text_diff.cpp + : $(requirements) + $(target-name).test-html + $(reference-output-html) + $(target-name).html + on + ] ; + + local all-tests = [ modules.peek testing : .all-tests ] ; + all-tests += $(t2) $(t2-html) ; + modules.poke testing : .all-tests : $(all-tests) ; + + return $(t1) $(t2) $(t1-html) $(t2-html) ; +} + +rule quickbook-fail-test ( target-name : input ? : requirements * ) +{ + input ?= $(target-name).quickbook ; + + local project = [ project.current ] ; + + local boost-root = [ modules.peek : BOOST_ROOT ] ; + + local t = + [ targets.create-typed-target RUN_FAIL + : $(project) + : $(target-name) + : $(boost-root)/tools/quickbook/src//quickbook + : $(requirements) + $(input) + on + $(input) + ] + ; + + local all-tests = [ modules.peek testing : .all-tests ] ; + all-tests += $(t) ; + modules.poke testing : .all-tests : $(all-tests) ; + + return $(t) ; +} + +rule quickbook-error-test ( target-name : input ? : requirements * ) +{ + input ?= $(target-name).quickbook ; + + local project = [ project.current ] ; + + local boost-root = [ modules.peek : BOOST_ROOT ] ; + + local t = + [ targets.create-typed-target RUN + : $(project) + : $(target-name) + : $(boost-root)/tools/quickbook/src//quickbook + : $(requirements) + $(input) + --expect-errors + on + $(input) + ] + ; + + local all-tests = [ modules.peek testing : .all-tests ] ; + all-tests += $(t) ; + modules.poke testing : .all-tests : $(all-tests) ; + + return $(t) ; +} + +################################################################################ +toolset.flags quickbook-testing.process-quickbook quickbook-command ; +toolset.flags quickbook-testing.process-quickbook QB-DEFINES ; +toolset.flags quickbook-testing.process-quickbook XINCLUDE ; +toolset.flags quickbook-testing.process-quickbook INCLUDES ; +toolset.flags quickbook-testing.process-quickbook-html quickbook-command ; +toolset.flags quickbook-testing.process-quickbook-html QB-DEFINES ; +toolset.flags quickbook-testing.process-quickbook-html XINCLUDE ; +toolset.flags quickbook-testing.process-quickbook-html INCLUDES ; + +rule process-quickbook ( target : source : properties * ) +{ + DEPENDS $(target) : [ on $(target) return $(quickbook-command) ] ; +} + +actions process-quickbook bind quickbook-command +{ + $(quickbook-command) $(>) --output-file=$(<) --debug -D"$(QB-DEFINES)" -I"$(INCLUDES)" --xinclude-base="$(XINCLUDE)" +} + +rule process-quickbook-html ( target : source : properties * ) +{ + DEPENDS $(target) : [ on $(target) return $(quickbook-command) ] ; +} + +actions process-quickbook-html bind quickbook-command +{ + $(quickbook-command) $(>) --output-format=onehtml --output-file=$(<) --debug -D"$(QB-DEFINES)" -I"$(INCLUDES)" --xinclude-base="$(XINCLUDE)" +} -- cgit v1.2.3