]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #!/usr/bin/python |
2 | ||
3 | # Copyright 2014 Steven Watanabe | |
4 | # Distributed under the Boost Software License, Version 1.0. | |
5 | # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) | |
6 | ||
7 | import BoostBuild | |
8 | import sys | |
9 | ||
11fdf7f2 | 10 | t = BoostBuild.Tester(pass_toolset=False) |
7c673cae FG |
11 | |
12 | t.write("file.jam", """ | |
13 | actions run { | |
14 | $(ACTION) | |
15 | } | |
16 | ||
17 | # Raw commands only work on Windows | |
18 | if $(OS) = NT | |
19 | { | |
20 | JAMSHELL on test-raw = % ; | |
21 | JAMSHELL on test-raw-fail = % ; | |
22 | } | |
23 | ACTION on test-raw = "\"$(PYTHON)\" -V" ; | |
24 | run test-raw ; | |
25 | ||
26 | ACTION on test-raw-fail = missing-executable ; | |
27 | run test-raw-fail ; | |
28 | ||
29 | # On Windows, the command is stored in a temporary | |
30 | # file. On other systems it is passed directly. | |
31 | if $(OS) = NT | |
32 | { | |
33 | JAMSHELL on test-py = $(PYTHON) ; | |
34 | } | |
35 | else | |
36 | { | |
37 | JAMSHELL on test-py = $(PYTHON) -c ; | |
38 | } | |
39 | ACTION on test-py = " | |
92f5a8d4 TL |
40 | from __future__ import print_function |
41 | print(\\\",\\\".join([str(x) for x in range(3)])) | |
7c673cae FG |
42 | " ; |
43 | run test-py ; | |
44 | ||
45 | DEPENDS all : test-raw test-raw-fail test-py ; | |
46 | """) | |
47 | ||
48 | t.run_build_system(["-ffile.jam", "-d1", "-sPYTHON=" + sys.executable], status=1) | |
49 | t.expect_output_lines([ | |
50 | "...failed run test-raw-fail...", | |
51 | "0,1,2", | |
52 | "...failed updating 1 target...", | |
53 | "...updated 2 targets..."]) | |
54 | ||
55 | t.cleanup() |