2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-14 00:32:11 +00:00
Files
build/test/project_test4.py
Vladimir Prus 2d57d47b45 Work on BB14: allow target suffixes to depend
on build properties.

* new/builtin.jam
    Introduce "os" feature.

* new/gcc.jam
    Make object suffix "o" on all platforms.

* new/property.jam
    (property-map): New class.

* new/type.jam
    (.suffixes): Global propety-map instance, to
	keep properties->suffix mapping.
    (set-generated-target-suffix): New rule
    (generated-target-suffix): New argument
	'properties'.

* new/virtual-target.jam
    (abstract-file-target.actual-name): Pass
	properties to type.generated-target-suffix.

* test/project_test4.py
    Don't specify expected list of build properties,
    since it's not stable. Check head of error message
    only.


[SVN r16700]
2002-12-25 07:18:34 +00:00

105 lines
2.5 KiB
Python

#!/usr/bin/python
from BoostBuild import Tester
import os
from string import strip, find
t = Tester()
t.set_tree("project-test4")
t.run_build_system()
t.expect_addition("bin/gcc/debug/a.obj")
t.expect_content("bin/gcc/debug/a.obj",
"""gcc/debug/include-everything
a.cpp
""")
t.expect_addition("bin/gcc/debug/a.exe")
t.expect_content("bin/gcc/debug/a.exe",
"gcc/debug/include-everything\n" +
"bin/gcc/debug/a.obj lib/bin/gcc/debug/optimization-on/b.obj\n"
)
t.expect_addition("lib/bin/gcc/debug/optimization-on/b.obj")
t.expect_content("lib/bin/gcc/debug/optimization-on/b.obj",
"""gcc/debug/include-everything/optimization-on
lib/b.cpp
""")
t.expect_addition("bin/gcc/debug/main-target-b.exe/b.exe")
t.expect_content("bin/gcc/debug/main-target-b.exe/b.exe",
"gcc/debug/define-MACROS/include-everything\n" +
"bin/gcc/debug/a.obj\n"
)
t.copy("lib/Jamfile2", "lib/Jamfile")
expected="""error: Requirements for project at 'lib' conflict with parent's.
Explanation: link-incompatible properties <threading>single and <threading>multi
"""
t.run_build_system("--no-error-backtrace", stdout=expected, status=None)
t.copy("lib/Jamfile3", "lib/Jamfile")
t.run_build_system(status=None)
t.fail_test(find(t.stdout(), "warning: skipped build of lib/b.obj with properties") \
!= 0)
# Check that project can be skipped as well
t.copy("Jamfile4", "Jamfile")
expected="""warning: skipping build of project at lib2
"""
t.run_build_system("rtti=on", stdout=expected, status=None)
t.copy("lib2/Jamfile2", "lib2/Jamfile")
expected="""warning: skipping build of project /mylib at lib2
"""
t.run_build_system("rtti=on", stdout=expected, status=None)
# We don't yet make targets depend on Jamfile, so need to start from scratch
# The following test is disabled, because of problems related to
# issue BB10
#t.set_tree("project-test4")
#t.copy("Jamfile2", "Jamfile")
#t.run_build_system()
#t.expect_addition("bin/gcc/debug/a_gcc.obj")
#t.expect_content("bin/gcc/debug/a_gcc.obj",
#"""gcc/debug
#a_gcc.cpp
#""")
#t.expect_content("bin/gcc/debug/a.exe",
#"gcc/debug\n" +
#"bin/gcc/debug/a.obj " +
#"lib/bin/gcc/debug/optimization-on/b.obj " +
#"bin/gcc/debug/a_gcc.obj\n"
#)
# Test that if we specified composite property in target reference,
# everything works OK.
t.copy("lib/Jamfile1", "lib/Jamfile")
t.copy("Jamfile5", "Jamfile")
t.run_build_system()
t.expect_addition("lib/bin/gcc/release/b.obj")
t.expect_content("bin/gcc/debug/a.exe",
"gcc/debug/include-everything\n" +
"bin/gcc/debug/a.obj lib/bin/gcc/release/b.obj\n"
)
t.cleanup()