Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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