2
0
mirror of https://github.com/boostorg/build.git synced 2026-01-19 16:12:14 +00:00
Files
build/test/default_features.py
Nikita Kniazev fcaafb3593 python3 shebang (#258)
* python3 shebang
* CI: execute python scripts via shebang
2023-04-17 09:19:00 -05:00

51 lines
971 B
Python

#!/usr/bin/env python3
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
# Test that features with default values are always present in build properties
# of any target.
import BoostBuild
t = BoostBuild.Tester(use_test_config=False)
# Declare *non-propagated* feature foo.
t.write("jamroot.jam", """
import feature : feature ;
feature foo : on off ;
""")
# Note that '<foo>on' will not be propagated to 'd/l'.
t.write("jamfile.jam", """
exe hello : hello.cpp d//l ;
""")
t.write("hello.cpp", """
#ifdef _WIN32
__declspec(dllimport)
#endif
void foo();
int main() { foo(); }
""")
t.write("d/jamfile.jam", """
lib l : l.cpp : <foo>on:<define>FOO ;
""")
t.write("d/l.cpp", """
#ifdef _WIN32
__declspec(dllexport)
#endif
#ifdef FOO
void foo() {}
#endif
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug*/hello.exe")
t.cleanup()