2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-15 13:02:11 +00:00

Fix tests using sleep on Windows.

[SVN r75871]
This commit is contained in:
Steven Watanabe
2011-12-09 01:36:04 +00:00
parent 77c7489fbc
commit ca8a2e67c6
4 changed files with 58 additions and 23 deletions

View File

@@ -11,14 +11,27 @@ t = BoostBuild.Tester(pass_toolset=0)
t.write("sleep.bat","""@setlocal
@echo off
timeout /T %1 /NOBREAK >nul
@REM timeout /T %1 /NOBREAK >nul
ping 127.0.0.1 -n 2 -w 1000 >nul
ping 127.0.0.1 -n %1 -w 1000 >nul
@endlocal
@exit /B 0
""")
t.write("file.jam", """
if $(NT)
{
SLEEP = @call sleep.bat ;
}
else
{
SLEEP = sleep ;
}
actions .a. {
echo 001
sleep 4
$(SLEEP) 4
echo 002
}
@@ -27,18 +40,8 @@ echo 002
DEPENDS all : sleeper ;
""")
t.run_build_system("-ffile.jam -d1 -l2", status=1, stdout="""...found 2 targets...
...updating 1 target...
.a. sleeper
2 second time limit exceeded
001
t.run_build_system("-ffile.jam -d1 -l2", status=1)
echo 001
sleep 4
echo 002
...failed .a. sleeper...
...failed updating 1 target...
""")
t.expect_output_line("2 second time limit exceeded")
t.cleanup()

View File

@@ -11,7 +11,11 @@ t = BoostBuild.Tester(pass_toolset=0, pass_d0=False)
t.write("sleep.bat","""@setlocal
@echo off
timeout /T %1 /NOBREAK >nul
@REM timeout /T %1 /NOBREAK >nul
ping 127.0.0.1 -n 2 -w 1000 >nul
ping 127.0.0.1 -n %1 -w 1000 >nul
@endlocal
@exit /B 0
""")
t.write("file.jam", """
@@ -20,11 +24,11 @@ t.write("file.jam", """
actions sleeper
{
echo [$(<:S)] 0
sleep 1
@call sleep.bat 1
echo [$(<:S)] 1
sleep 1
@call sleep.bat 1
echo [$(<:S)] 2
sleep $(<:B)
@call sleep.bat $(<:B)
}
}
else

View File

@@ -11,13 +11,27 @@ t = BoostBuild.Tester(pass_toolset=0, pass_d0=False)
t.write("sleep.bat","""@setlocal
@echo off
timeout /T %1 /NOBREAK >nul
@REM timeout /T %1 /NOBREAK >nul
ping 127.0.0.1 -n 2 -w 1000 >nul
ping 127.0.0.1 -n %1 -w 1000 >nul
@endlocal
@exit /B 0
""")
t.write("file.jam", """
if $(NT)
{
SLEEP = @call sleep.bat ;
}
else
{
SLEEP = sleep ;
}
actions .gen. {
echo 001
sleep 4
$(SLEEP) 4
echo 002
}
rule .use.1 { DEPENDS $(<) : $(>) ; }
@@ -26,7 +40,7 @@ echo 003
}
rule .use.2 { DEPENDS $(<) : $(>) ; }
actions .use.2 {
sleep 1
$(SLEEP) 1
echo 004
}

View File

@@ -23,13 +23,27 @@ t = BoostBuild.Tester(pass_toolset=0, pass_d0=False)
t.write("sleep.bat","""@setlocal
@echo off
timeout /T %1 /NOBREAK >nul
@REM timeout /T %1 /NOBREAK >nul
ping 127.0.0.1 -n 2 -w 1000 >nul
ping 127.0.0.1 -n %1 -w 1000 >nul
@endlocal
@exit /B 0
""")
t.write("file.jam", """
if $(NT)
{
SLEEP = @call sleep.bat ;
}
else
{
SLEEP = sleep ;
}
actions link
{
sleep 1
$(SLEEP) 1
echo 001 - linked
}