]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/library_order.py
3 # Copyright 2004 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)
7 # Test that on compilers sensitive to library order on linker's command line,
8 # we generate the correct order.
13 t
= BoostBuild
.Tester(use_test_config
=False)
15 t
.write("main.cpp", """\
39 # The order of libraries in 'main' is crafted so that we get an error unless we
40 # do something about the order ourselves.
41 t
.write("jamroot.jam", """\
42 exe main : main.cpp libd libc libb liba ;
44 lib libc : c.cpp : <link>static <use>libd ;
45 lib libb : b.cpp : <use>libc ;
46 lib liba : a.cpp : <use>libb ;
49 t
.run_build_system(["-d2"])
50 t
.expect_addition("bin/$toolset/debug/main.exe")
53 # Test the order between searched libraries.
54 t
.write("jamroot.jam", """\
55 exe main : main.cpp png z ;
56 lib png : z : <name>png ;
60 t
.run_build_system(["-a", "-n", "-d+2"])
61 t
.fail_test(t
.stdout().find("png") > t
.stdout().find("zzz"))
63 t
.write("jamroot.jam", """\
64 exe main : main.cpp png z ;
65 lib png : : <name>png ;
66 lib z : png : <name>zzz ;
69 t
.run_build_system(["-a", "-n", "-d+2"])
70 t
.fail_test(t
.stdout().find("png") < t
.stdout().find("zzz"))
73 # Test the order between prebuilt libraries.
74 t
.write("first.a", "")
75 t
.write("second.a", "")
76 t
.write("jamroot.jam", """\
77 exe main : main.cpp first second ;
78 lib first : second : <file>first.a ;
79 lib second : : <file>second.a ;
82 t
.run_build_system(["-a", "-n", "-d+2"])
83 t
.fail_test(t
.stdout().find("first") > t
.stdout().find("second"))
85 t
.write("jamroot.jam", """
86 exe main : main.cpp first second ;
87 lib first : : <file>first.a ;
88 lib second : first : <file>second.a ;
91 t
.run_build_system(["-a", "-n", "-d+2"])
92 t
.fail_test(t
.stdout().find("first") < t
.stdout().find("second"))