mirror of
https://github.com/boostorg/build.git
synced 2026-02-14 00:32:11 +00:00
Additional consequences: * Makes the test system work correctly even should it ever be run with files stored on different file systems with different supported minimal path modification timestamp resolutions, e.g. NTFS (<1 ms) & FAT (2 sec). * When requesting a new file to be written with a large enough file modification timestamp, any missing folders created in the process are created with large enough modification timestamp as well. * Source paths with modification timestamps set too far in the future will now be reported as test environment errors instead of causing the test system to wait for some possibly long (all internal sleeps now limited to 5 seconds). [SVN r79830]
69 lines
1.5 KiB
Python
69 lines
1.5 KiB
Python
#!/usr/bin/python
|
|
|
|
# Copyright 2005 Dave Abrahams
|
|
# Distributed under the Boost Software License, Version 1.0.
|
|
# (See accompanying file LICENSE_1_0.txt or copy at
|
|
# http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
import BoostBuild
|
|
|
|
|
|
def wait_for_bar(t):
|
|
"""
|
|
Wait to make the test system correctly recognize the 'bar' file as
|
|
touched after the next build run. Without the wait, the next build run may
|
|
rebuild the 'bar' file with the new and the old file modification timestamp
|
|
too close to each other - which could, depending on the currently supported
|
|
file modification timestamp resolution, be detected as 'no change' by the
|
|
testing system.
|
|
|
|
"""
|
|
t.wait_for_time_change("bar", touch=False)
|
|
|
|
|
|
t = BoostBuild.Tester(["-ffile.jam", "-d+3", "-d+12", "-d+13"], pass_d0=False,
|
|
pass_toolset=0)
|
|
|
|
t.write("file.jam", """\
|
|
rule make
|
|
{
|
|
DEPENDS $(<) : $(>) ;
|
|
DEPENDS all : $(<) ;
|
|
}
|
|
actions make
|
|
{
|
|
echo "******" making $(<) from $(>) "******"
|
|
echo made from $(>) > $(<)
|
|
}
|
|
|
|
make aux1 : bar ;
|
|
make foo : bar ;
|
|
REBUILDS foo : bar ;
|
|
make bar : baz ;
|
|
make aux2 : bar ;
|
|
""")
|
|
|
|
t.write("baz", "nothing")
|
|
|
|
t.run_build_system(["bar"])
|
|
t.expect_addition("bar")
|
|
t.expect_nothing_more()
|
|
|
|
wait_for_bar(t)
|
|
t.run_build_system(["foo"])
|
|
t.expect_touch("bar")
|
|
t.expect_addition("foo")
|
|
t.expect_nothing_more()
|
|
|
|
t.run_build_system()
|
|
t.expect_addition(["aux1", "aux2"])
|
|
t.expect_nothing_more()
|
|
|
|
t.touch("bar")
|
|
wait_for_bar(t)
|
|
t.run_build_system()
|
|
t.expect_touch(["foo", "bar", "aux1", "aux2"])
|
|
t.expect_nothing_more()
|
|
|
|
t.cleanup()
|