]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #!/usr/bin/python |
2 | # | |
3 | # Copyright (c) 2008 Steven Watanabe | |
4 | # | |
5 | # Distributed under the Boost Software License, Version 1.0. | |
6 | # (See accompanying file LICENSE_1_0.txt or copy at | |
7 | # http://www.boost.org/LICENSE_1_0.txt) | |
8 | ||
9 | # Test that the common.copy rule set the modification date of the new file to | |
10 | # the current time. | |
11 | ||
12 | import BoostBuild | |
13 | ||
14 | tester = BoostBuild.Tester(use_test_config=False) | |
15 | ||
16 | tester.write("test1.cpp", """\ | |
17 | template<bool, int M, class Next> | |
18 | struct time_waster { | |
19 | typedef typename time_waster<true, M-1, time_waster>::type type1; | |
20 | typedef typename time_waster<false, M-1, time_waster>::type type2; | |
21 | typedef void type; | |
22 | }; | |
23 | template<bool B, class Next> | |
24 | struct time_waster<B, 0, Next> { | |
25 | typedef void type; | |
26 | }; | |
27 | typedef time_waster<true, 10, void>::type type; | |
28 | int f() { return 0; } | |
29 | """) | |
30 | ||
31 | tester.write("test2.cpp", """\ | |
32 | template<bool, int M, class Next> | |
33 | struct time_waster { | |
34 | typedef typename time_waster<true, M-1, time_waster>::type type1; | |
35 | typedef typename time_waster<false, M-1, time_waster>::type type2; | |
36 | typedef void type; | |
37 | }; | |
38 | template<bool B, class Next> | |
39 | struct time_waster<B, 0, Next> { | |
40 | typedef void type; | |
41 | }; | |
42 | typedef time_waster<true, 10, void>::type type; | |
43 | int g() { return 0; } | |
44 | """) | |
45 | ||
46 | tester.write("jamroot.jam", """\ | |
47 | obj test2 : test2.cpp ; | |
48 | obj test1 : test1.cpp : <dependency>test2 ; | |
49 | install test2i : test2 : <dependency>test1 ; | |
50 | """) | |
51 | ||
52 | tester.run_build_system() | |
b32b8144 FG |
53 | tester.expect_addition("bin/$toolset/debug*/test2.obj") |
54 | tester.expect_addition("bin/$toolset/debug*/test1.obj") | |
7c673cae FG |
55 | tester.expect_addition("test2i/test2.obj") |
56 | tester.expect_nothing_more() | |
57 | ||
92f5a8d4 TL |
58 | test2src = tester.read("test2i/test2.obj", binary=True) |
59 | test2dest = tester.read("bin/$toolset/debug*/test2.obj", binary=True) | |
7c673cae FG |
60 | if test2src != test2dest: |
61 | BoostBuild.annotation("failure", "The object file was not copied " | |
62 | "correctly") | |
63 | tester.fail_test(1) | |
64 | ||
65 | tester.run_build_system(["-d1"]) | |
66 | tester.expect_output_lines("common.copy*", False) | |
67 | tester.expect_nothing_more() | |
68 | ||
69 | tester.cleanup() |