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# Regression test: it was possible that due to evaluation of conditional
8# requirements, two different values of non-free features were present in a
9# property set.
10
11import BoostBuild
12
13t = BoostBuild.Tester()
14
15t.write("a.cpp", "")
16
17t.write("jamroot.jam", """
18import feature ;
19import common ;
20
21feature.feature the_feature : false true : propagated ;
22
23rule maker ( targets * : sources * : properties * )
24{
25    if <the_feature>false in $(properties) &&
26        <the_feature>true in $(properties)
27    {
28        EXIT "Oops, two different values of non-free feature" ;
29    }
30    CMD on $(targets) = [ common.file-creation-command ] ;
31}
32
33actions maker
34{
35    $(CMD) $(<) ;
36}
37
38make a : a.cpp : maker : <variant>debug:<the_feature>true ;
39""")
40
41t.run_build_system()
42
43t.cleanup()
44