Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/build/v2/test/alias.py @ 29

Last change on this file since 29 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.6 KB
Line 
1#!/usr/bin/python
2
3# Copyright 2003 Dave Abrahams
4# Copyright 2003 Vladimir Prus
5# Distributed under the Boost Software License, Version 1.0.
6# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
7
8from BoostBuild import Tester, List
9t = Tester()
10
11# Test that top-level project can affect build dir
12t.write("project-root.jam", "")
13t.write("Jamfile", """
14
15exe a : a.cpp ;
16exe b : b.cpp ;
17exe c : c.cpp ;
18
19alias bin1 : a ;
20alias bin2 : a b ;
21
22alias src : s.cpp ;
23exe hello : hello.cpp src ;
24
25""")
26t.write("a.cpp", "int main() { return 0; }\n")
27t.copy("a.cpp", "b.cpp")
28t.copy("a.cpp", "c.cpp")
29t.copy("a.cpp", "hello.cpp")
30t.write("s.cpp", "")
31
32# Check that targets to which "bin1" refers are updated,
33# and only those.
34t.run_build_system("bin1")
35t.ignore("*.tds")
36t.expect_addition(List("bin/$toolset/debug/") * "a.exe a.obj")
37t.expect_nothing_more()
38
39# Try again with "bin2"
40t.run_build_system("bin2")
41t.ignore("*.tds")
42t.expect_addition(List("bin/$toolset/debug/") * "b.exe b.obj")
43t.expect_nothing_more()
44
45# Try building everything, making sure 'hello' target is
46# created
47t.run_build_system()
48t.ignore("*.tds")
49t.expect_addition("bin/$toolset/debug/hello.exe")
50
51# Regression test.
52# Check if usage requirements are propagated via "alias"
53           
54t.write("l.cpp", """
55void
56#if defined(_WIN32)
57__declspec(dllexport)
58#endif
59foo() {}
60
61""")
62
63t.write("Jamfile", """
64lib l : l.cpp : : : <define>WANT_MAIN ;
65alias la : l ;
66exe main : main.cpp la ;
67""")
68
69t.write("main.cpp", """
70#ifdef WANT_MAIN
71int main() { return 0; }
72#endif
73
74""")
75
76t.write("project-root.jam", "")
77
78t.run_build_system()
79
80t.cleanup()
Note: See TracBrowser for help on using the repository browser.