2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-17 01:32:12 +00:00
Files
build/test/main_properties.py
Vladimir Prus 1dba353cff Bugfix: virtual target with per-main-target properties can be confused
with ordinary virtual target.

* new/virtual-target.jam
    (abstract-file-target.specific-main-target): New overridable rule.
    (abstract-file-target.actual-name): Use the above.
    (file-target.specific-main-target): Override, using code from
       'compute-extra-path'.
    (file-target.compute-extra-path): Remove
    (file-target.path): Use 'specific-main-target' directly.

* test/main_properties.py: More tests.


[SVN r17480]
2003-02-17 09:10:57 +00:00

43 lines
1005 B
Python

#!/usr/bin/python
# This tests a bug where files were places to a directory corresponding to a main
# target that was using its main target.
from BoostBuild import Tester
t = Tester()
# In order to correctly link this app, 'b.cpp', created by 'make'
# rule, should be compiled.
t.write("project-root.jam", "import gcc ;")
t.write("Jamfile", """
lib b : b.cpp : <define>BAR ;
exe a : a.cpp b ;
""")
t.write("a.cpp", """
void foo();
int main() { foo(); }
""")
t.write("b.cpp", "void foo() {}\n")
t.run_build_system()
t.expect_addition("bin/gcc/debug/main-target-b/b.o")
# This tests another bug: when source file was used by two main targets,
# one without any requirements and another with free requirements, it
# was compiled twice with to the same locaiton.
t.write("Jamfile", """
exe a : a.cpp ;
exe b : a.cpp : <define>FOO ;
""")
t.write("a.cpp", """
int main() {}
""")
t.rm("bin")
t.run_build_system()
t.expect_addition(["bin/gcc/debug/a.o", "bin/gcc/debug/main-target-b/a.o"])
t.cleanup()