build/test/project_root_rule.py
Steven Watanabe ee613a6a28 Implement feature relevance.
* New feature <relevant> which is automatically deduced in most cases.
* Features which are not relevant do not affect target paths and
  do not prevent merging of virtual targets.
* generators.jam: generator.run always returns usage-requirements
  to allow usage-requirements in non-top-level generators.  This
  is necessary because we're using usage-requirements to track
  relevance from flags.
* New rule toolset.uses-features to specify features that the rule
  checks manually, instead of using toolset.flags.  In the future,
  we should consider restricting the properties actually passed,
  to detect errors.
* Adjust tests to handle the new paths (verified by inspection).
* Add temporary option --ignore-relevance to consider all features relevant
  to aid migration.
* New rule property.evaluate-conditional-relevance which helps tracking
  relevance in <conditional>.
* Widely scattered changes to use the new interfaces.
2018-01-13 09:13:49 -07:00

35 lines
750 B
Python

#!/usr/bin/python
# Copyright (C) Vladimir Prus 2005.
# 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)
# Tests that we can declare a rule in Jamroot that will be can be called in
# child Jamfile to declare a target. Specifically test for use of 'glob' in that
# rule.
import BoostBuild
t = BoostBuild.Tester(use_test_config=False)
t.write("jamroot.jam", """
project : requirements <link>static ;
rule my-lib ( name ) { lib $(name) : [ glob *.cpp ] ; }
""")
t.write("sub/a.cpp", """
""")
t.write("sub/jamfile.jam", """
my-lib foo ;
""")
t.run_build_system(subdir="sub")
t.expect_addition("sub/bin/$toolset/debug*/foo.lib")
t.cleanup()