#!/usr/bin/python # Copyright 2018 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) # Test the handling of toolset.add-defaults import BoostBuild t = BoostBuild.Tester(pass_toolset=0, ignore_toolset_requirements=False) t.write('jamroot.jam', ''' import toolset ; import errors ; import feature : feature ; import set ; feature f1 : a b ; feature f2 : c d ; feature f3 : e f ; feature f4 : g h ; feature f5 : i j ; feature f6 : k l m ; rule test-rule ( properties * ) { if a in $(properties) { return d ; } } toolset.add-defaults @test-rule e:h i:l ; rule check-requirements ( target : sources * : properties * ) { local expected = d h m ; local unexpected = c g k l ; local missing = [ set.difference $(expected) : $(properties) ] ; if $(missing) { errors.error $(missing) not present ; } local extra = [ set.intersection $(unexpected) : $(properties) ] ; if $(extra) { errors.error $(extra) present ; } } make test : : @check-requirements : m ; ''') t.run_build_system() t.cleanup()