• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
9import BoostBuild
10
11t = BoostBuild.Tester(["-ffile.jam"], pass_toolset=0)
12
13t.write("file.jam", """\
14name = n1 n2 ;
15contents = M1 M2 ;
16EXIT "file:" "@(o$(name) .txt:E= test -D$(contents))" : 0 ;
17""")
18
19t.run_build_system()
20t.expect_output_lines("file: on1 on2 .txt");
21t.expect_addition("on1 on2 .txt")
22t.expect_content("on1 on2 .txt", " test -DM1 -DM2", True)
23
24t.rm(".")
25
26t.write("file.jam", """\
27name = n1 n2 ;
28contents = M1 M2 ;
29actions run { echo file: "@(o$(name) .txt:E= test -D$(contents))" }
30run all ;
31""")
32
33t.run_build_system(["-d2"])
34t.expect_output_lines(' echo file: "on1 on2 .txt" ');
35t.expect_addition("on1 on2 .txt")
36t.expect_content("on1 on2 .txt", " test -DM1 -DM2", True)
37
38t.rm(".")
39
40t.write("file.jam", """\
41name = n1 n2 ;
42contents = M1 M2 ;
43file = "@($(STDOUT):E= test -D$(contents)\n)" ;
44actions run { $(file) }
45run all ;
46""")
47
48t.run_build_system(["-d1"])
49t.expect_output_lines(" test -DM1 -DM2")
50
51t.rm(".")
52
53t.write("file.jam", """\
54name = n1 n2 ;
55contents = M1 M2 ;
56actions run { @($(STDOUT):E= test -D$(contents)\n) }
57run all ;
58""")
59
60t.run_build_system(["-d1"])
61t.expect_output_lines(" test -DM1 -DM2")
62
63t.cleanup()
64