2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 13:22:11 +00:00
Files
build/test/default_build.py
Vladimir Prus 5aeb1de191 Cleanups. Default build improvements related to BB10.
* new/targets.jam
    (main-target.default-build): New field.
    (main-target.add-alternative): Don't allow default-build for
       second and subsequence alternatives. Record default build
       from the first one.
    (main-target.generate): Expand build request.
    (main-target.generate-really): New rule, extracted from 'generate'.
    (basic-target.default-build): New rule.
    (basic-target.generate): Don't expand default build.

* test/BoostBuild.py
  Allow to suppress passing toolset when calling run_build_system.
  Some Python 2.1 compatibility fixes.

* test/alternatives.py
  More tests.

* test/default_build.py
  More tests.


[SVN r17683]
2003-02-28 06:36:39 +00:00

62 lines
1.3 KiB
Python

#!/usr/bin/python
# Test that default build clause actually has any effect.
from BoostBuild import Tester
t = Tester(pass_toolset=0)
t.write("project-root.jam", "import gcc ;")
t.write("Jamfile", "exe a : a.cpp : : debug release ;")
t.write("a.cpp", "int main() { return 0; }\n")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a.exe")
t.expect_addition("bin/$toolset/release/a.exe")
# Test that we can declare default build only in the first
# alternative
t.write("Jamfile", """
exe a : a.cpp : : debug release ;
exe a : b.cpp : : debug release ;
""")
expected="""error: default build can be specified only in first alternative
main target is ./a
"""
t.run_build_system("--no-error-backtrace", status=1, stdout=expected)
# Now try a harder example: default build which contains <define>
# should cause <define> to be present when "b" is compiled.
# This happens only of "build-project b" is placed first.
t.write("Jamfile", """
project
: default-build <define>FOO
;
build-project a ;
build-project b ;
""")
t.write("a/Jamfile", """
exe a : a.cpp ../b/b ;
""")
t.write("a/a.cpp", """
void foo();
int main() { foo(); }
""")
t.write("b/Jamfile", """
lib b : b.cpp ;
""")
t.write("b/b.cpp", """
#ifdef FOO
void foo() {}
#endif
""")
# Uncomment when BB10 is resolved.
#t.run_build_system()
t.cleanup()