1#!/usr/local/bin/python3.8
2
3# Copyright 2003 Vladimir Prus
4# Distributed under the Boost Software License, Version 1.0.
5# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
6
7# Test that features with default values are always present in build properties
8# of any target.
9
10import BoostBuild
11
12t = BoostBuild.Tester(use_test_config=False)
13
14# Declare *non-propagated* feature foo.
15t.write("jamroot.jam", """
16import feature : feature ;
17feature foo : on off ;
18""")
19
20# Note that '<foo>on' will not be propagated to 'd/l'.
21t.write("jamfile.jam", """
22exe hello : hello.cpp d//l ;
23""")
24
25t.write("hello.cpp", """
26#ifdef _WIN32
27__declspec(dllimport)
28#endif
29void foo();
30int main() { foo(); }
31""")
32
33t.write("d/jamfile.jam", """
34lib l : l.cpp : <foo>on:<define>FOO ;
35""")
36
37t.write("d/l.cpp", """
38#ifdef _WIN32
39__declspec(dllexport)
40#endif
41#ifdef FOO
42void foo() {}
43#endif
44""")
45
46t.run_build_system()
47
48t.expect_addition("bin/$toolset/debug*/hello.exe")
49
50t.cleanup()
51