Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/tools/build/v2/test/make_rule.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.2 KB
Line 
1#!/usr/bin/python
2
3# Test the 'make' rule
4
5from BoostBuild import Tester
6from string import find
7
8t = Tester(pass_toolset=1)
9
10t.write("project-root.jam", "")
11t.write("Jamfile", """
12
13rule creator ( string targets * : sources * : * )
14{
15    STRING on $(targets) = $(string) ;
16    creator2 $(targets) : $(sources) ;
17}
18
19actions creator2
20{
21    echo $(STRING) > $(<)
22}
23
24make foo.bar : : creator foobar ;
25""")
26
27t.run_build_system()
28t.expect_addition("bin/$toolset/debug/foo.bar")
29t.fail_test(find(t.read("bin/$toolset/debug/foo.bar"), "foobar") == -1)
30
31# Regression test. Make sure that if main target requested two times,
32# and build request differ only in incidental properties, the main target
33# if created only once. The bug was discovered by Kirill Lapshin.
34
35t.write("Jamfile", """
36# Make sure that incidental property does not
37# cause second creation of 'hello1.cpp'.
38exe a : dir//hello1.cpp ;
39exe b : dir//hello1.cpp/<hardcode-dll-paths>true ;
40""")
41
42t.write("project-root.jam", "")
43
44t.write("dir/Jamfile", """
45import common ;
46make hello1.cpp : hello.cpp : common.copy ;
47
48""")
49
50t.write("dir/hello.cpp", """
51int main()
52{
53    return 1;
54}
55""")
56t.run_build_system("-d2")
57t.fail_test(t.stdout().count("common.copy") != 1)
58
59t.cleanup()
Note: See TracBrowser for help on using the repository browser.