2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-01 20:32:17 +00:00
Files
build/test/default_features.py
Vladimir Prus 8d38ee1b89 Make default values of features really work. Now a feature with
default value will always be present in build properties of all
main targets. The change moves adding default value into main
targets --- it was done at the top level.

* new/build-request.jam
    (expand-no-defaults): No longer local.

* new/build-system.jam
    Use 'build-request.expand-no-defaults', not 'expand'.

* new/feature.jam
    (add-defaults): Tolerate conditional properties
        (e.g <variant>debug:<define>DEBUG)

* new/property-set.jam
    (property-set.add-defaults): New method.

* new/targets.jam
    (basic-target.final-properties): Add defaults.

* test/default_features.py: New test.


[SVN r17753]
2003-03-07 08:45:37 +00:00

51 lines
1011 B
Python

#!/usr/bin/python
# Copyright (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and with no claim as to its suitability for any purpose.
# Test that features with default values are always present
# in build properties of any target.
from BoostBuild import Tester, List
t = Tester()
# Declare *non-propagated* feature foo.
t.write("project-root.jam", """
import feature : feature ;
feature foo : on off ;
""")
# Note that '<foo>on' won't be propagated
# to 'd/l'.
t.write("Jamfile", """
exe hello : hello.cpp d/l ;
""")
t.write("hello.cpp", """
void foo();
int main()
{
foo();
return 1;
}
""")
t.write("d/Jamfile", """
lib l : l.cpp : <foo>on:<define>FOO ;
""")
t.write("l.cpp", """
#ifdef FOO
void foo() {}
#endif
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/hello.exe")
t.cleanup()