Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/build/v2/test/explicit.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 (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and
4#  distribute this software is granted provided this copyright notice appears in
5#  all copies. This software is provided "as is" without express or implied
6#  warranty, and with no claim as to its suitability for any purpose.
7
8#  This file is template for Boost.Build tests. It creates a simple
9#  project that builds one exe from one source, and checks that the exe
10#  is really created.
11from BoostBuild import Tester, List
12
13t = Tester()
14
15t.write("project-root.jam", "")
16t.write("Jamfile", """
17
18exe hello : hello.cpp ;
19exe hello2 : hello.cpp ;
20
21explicit hello2 ;
22""")
23t.write("hello.cpp", """
24int main()
25{
26    return 0;
27}
28
29""")
30
31t.run_build_system()
32t.ignore("*.tds")
33t.expect_addition(List("bin/$toolset/debug/hello") * [".exe", ".obj"])
34t.expect_nothing_more()
35
36t.run_build_system("hello2")
37t.expect_addition("bin/$toolset/debug/hello2.exe")
38
39t.rm(".")
40
41
42# Test that 'explicit' used in a helper rule applies to the current project,
43# and not to the Jamfile where the helper rule is defined.
44t.write("Jamroot", """
45rule myinstall ( name : target )
46{
47    install $(name)-bin : $(target) ;
48    explicit $(name)-bin ;
49    alias $(name) : $(name)-bin ;
50}
51""")
52
53t.write("sub/a.cpp", """
54""")
55
56t.write("sub/Jamfile", """
57myinstall dist : a.cpp ;
58""")
59
60t.run_build_system(subdir="sub")
61t.expect_addition("sub/dist-bin/a.cpp")
62
63t.rm("sub/dist-bin")
64
65t.write("sub/Jamfile", """
66myinstall dist : a.cpp ;
67explicit dist ;
68
69""")
70
71t.run_build_system(subdir="sub")
72t.expect_nothing_more()
73
74
75t.cleanup()
Note: See TracBrowser for help on using the repository browser.