Imported Upstream version 1.57.0
[platform/upstream/boost.git] / tools / build / test / core_at_file.py
1 #!/usr/bin/python
2
3 # Copyright 2011 Steven Watanabe
4 # Distributed under the Boost Software License, Version 1.0.
5 # (See accompanying file LICENSE_1_0.txt or copy at
6 # http://www.boost.org/LICENSE_1_0.txt)
7
8
9 import BoostBuild
10
11 t = BoostBuild.Tester(["-ffile.jam"], pass_toolset=0)
12
13 t.write("file.jam", """\
14 name = n1 n2 ;
15 contents = M1 M2 ;
16 EXIT file: "@(o$(name) .txt:E= test -D$(contents))" : 0 ;
17 """)
18
19 t.run_build_system()
20 t.expect_output_lines("file: on1 on2 .txt");
21 t.expect_addition("on1 on2 .txt")
22 t.expect_content("on1 on2 .txt", " test -DM1 -DM2", True)
23
24 t.rm(".")
25
26 t.write("file.jam", """\
27 name = n1 n2 ;
28 contents = M1 M2 ;
29 actions run { echo file: "@(o$(name) .txt:E= test -D$(contents))" }
30 run all ;
31 """)
32
33 t.run_build_system(["-d2"])
34 t.expect_output_lines(' echo file: "on1 on2 .txt" ');
35 t.expect_addition("on1 on2 .txt")
36 t.expect_content("on1 on2 .txt", " test -DM1 -DM2", True)
37
38 t.rm(".")
39
40 t.write("file.jam", """\
41 name = n1 n2 ;
42 contents = M1 M2 ;
43 file = "@($(STDOUT):E= test -D$(contents)\n)" ;
44 actions run { $(file) }
45 run all ;
46 """)
47
48 t.run_build_system(["-d1"])
49 t.expect_output_lines(" test -DM1 -DM2")
50
51 t.rm(".")
52
53 t.write("file.jam", """\
54 name = n1 n2 ;
55 contents = M1 M2 ;
56 actions run { @($(STDOUT):E= test -D$(contents)\n) }
57 run all ;
58 """)
59
60 t.run_build_system(["-d1"])
61 t.expect_output_lines(" test -DM1 -DM2")
62
63 t.cleanup()