Imported Upstream version 1.51.0
[platform/upstream/boost.git] / tools / build / v2 / test / core_option_l.py
1 #!/usr/bin/python
2
3 # Copyright 2007 Rene Rivera.
4 # Copyright 2011 Steven Watanabe
5 # Distributed under the Boost Software License, Version 1.0. 
6 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) 
7
8 import BoostBuild
9
10 t = BoostBuild.Tester(pass_toolset=0)
11
12 t.write("sleep.bat","""@setlocal
13 @echo off
14 @REM timeout /T %1 /NOBREAK >nul
15 ping 127.0.0.1 -n 2 -w 1000 >nul
16 ping 127.0.0.1 -n %1 -w 1000 >nul
17 @endlocal
18 @exit /B 0
19 """)
20
21 t.write("file.jam", """
22
23 if $(NT)
24 {
25     SLEEP = @call sleep.bat ;
26 }
27 else
28 {
29     SLEEP = sleep ;
30 }
31
32 actions .a. {
33 echo 001
34 $(SLEEP) 4
35 echo 002
36 }
37
38 .a. sleeper ;
39
40 DEPENDS all : sleeper ;
41 """)
42
43 t.run_build_system("-ffile.jam -d1 -l2", status=1)
44
45 t.expect_output_line("2 second time limit exceeded")
46
47 t.cleanup()