Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/tools/build/v2/test/chain.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.1 KB
Line 
1#!/usr/bin/python
2
3# This tests that
4# 1) the 'make' correctly assigns types to produced targets
5# 2) than if 'make' create targets of type CPP, they are
6# correctly used (there was a bug with it).
7
8from BoostBuild import Tester
9t = Tester()
10
11# In order to correctly link this app, 'b.cpp', created by 'make'
12# rule, should be compiled.
13t.write("project-root.jam", "import gcc ;")
14t.write("Jamfile", r'''
15rule create ( dst : src * : properties * )
16{
17    # hack to echo a space under NT
18    setup on $(dst) = "set x=int main(){ return 0; }" ;
19}
20
21import modules ;
22if [ modules.peek : NT ]
23{
24    actions create
25    {
26        $(setup)
27        echo %x% > $(<)
28    }
29}
30else
31{
32    actions create
33    {
34        echo "int main(){ return 0; }" > $(<)
35    }
36}
37
38IMPORT $(__name__) : create : : create ;
39
40exe a : l dummy.cpp ;
41
42# needs to be static lib for Windows - main cannot appear in DLL
43static-lib l : a.cpp b.cpp ;
44
45make b.cpp : : create ;
46
47''')
48t.write("a.cpp", "")
49t.write("dummy.cpp", "// msvc needs at least one object file\n")
50
51t.run_build_system()
52
53t.expect_addition("bin/$toolset/debug/a.exe")
54
55t.cleanup()
Note: See TracBrowser for help on using the repository browser.