summaryrefslogtreecommitdiff
path: root/tools/build/test/static_and_shared_library.py
blob: da010a241f5a386ee5473fed900208babc69d112 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/python

# Copyright 2002, 2003 Dave Abrahams
# Copyright 2002, 2003, 2005 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)

import BoostBuild

t = BoostBuild.Tester(use_test_config=False)
t.write("jamroot.jam", "")
t.write("lib/c.cpp", "int bar() { return 0; }\n")
t.write("lib/jamfile.jam", """\
static-lib auxilliary1 : c.cpp ;
lib auxilliary2 : c.cpp ;
""")

def reset():
    t.rm("lib/bin")

t.run_build_system(subdir='lib')
t.expect_addition("lib/bin/$toolset/debug*/" * BoostBuild.List("c.obj "
    "auxilliary1.lib auxilliary2.dll"))
t.expect_nothing_more()

reset()
t.run_build_system(["link=shared"], subdir="lib")
t.expect_addition("lib/bin/$toolset/debug*/" * BoostBuild.List("c.obj "
    "auxilliary1.lib auxilliary2.dll"))
t.expect_nothing_more()

reset()
t.run_build_system(["link=static"], subdir="lib")
t.expect_addition("lib/bin/$toolset/debug/link-static*/" * BoostBuild.List(
    "c.obj auxilliary1.lib auxilliary2.lib"))
t.expect_nothing_more()

t.cleanup()