Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/build/v2/test/absolute_sources.py @ 32

Last change on this file since 32 was 29, checked in by landauf, 17 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, 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)
6
7# Test that sources with absolute names are handled OK.
8
9from BoostBuild import Tester
10t = Tester()
11
12t.write("project-root.jam", """
13path-constant TOP : . ;
14""")
15t.write("Jamfile", """
16local pwd = [ PWD ] ;
17ECHO $(pwd) XXXXX ;
18exe hello : $(pwd)/hello.cpp $(TOP)/empty.cpp ;
19""")
20t.write("hello.cpp", "int main() { return 0; }\n")
21t.write("empty.cpp", "\n")
22
23t.run_build_system()
24t.expect_addition("bin/$toolset/debug/hello.exe")
25
26# Test a contrived case. There, absolute name is used in
27# standalone project (not Jamfile). Moreover, the target with
28# absolute name is returned by 'alias' and used from other project.
29t.write("a.cpp", """
30int main()
31{
32    return 0;
33}
34
35""")
36
37t.write("Jamfile", """
38exe a : /standalone//a ;
39""")
40
41t.write("project-root.jam", """
42import standalone ;
43""")
44
45t.write("standalone.jam", """
46import project ;
47
48project.initialize $(__name__) ;
49project standalone ;
50
51local pwd = [ PWD ] ;
52
53alias a : $(pwd)/a.cpp ;
54
55""")
56t.run_build_system()
57t.expect_addition("bin/$toolset/debug/a.exe")
58
59# Test absolute path in target ids
60t.rm(".")
61t.write("d1/project-root.jam", "")
62t.write("d1/Jamfile", """
63exe a : a.cpp ;
64""")
65t.write("d1/a.cpp", """
66int main() { return 0; }
67""")
68t.write("d2/project-root.jam", "")
69t.write("d2/Jamfile", """
70local pwd = [ PWD ] ;
71alias x : $(pwd)/../d1//a ;
72""")
73
74t.run_build_system(subdir="d2")
75t.expect_addition("d1/bin/$toolset/debug/a.exe")
76
77t.cleanup()
Note: See TracBrowser for help on using the repository browser.