Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/tools/build/v2/test/alias.py @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

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