summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGabriel Russell <gabriel.russell@mongodb.com>2018-01-30 19:45:41 (GMT)
committerGabriel Russell <gabriel.russell@mongodb.com>2018-01-30 19:47:02 (GMT)
commit28d93e43689e9e91f1a648c522bf6fd11bb28f90 (patch)
tree11b817f94a0cb5cd137eae223fbc9e0990a8acd2 /test
parenta2e35978f159dc4f131451213c2a8c78d4b5835c (diff)
downloadSCons-28d93e43689e9e91f1a648c522bf6fd11bb28f90.zip
SCons-28d93e43689e9e91f1a648c522bf6fd11bb28f90.tar.gz
SCons-28d93e43689e9e91f1a648c522bf6fd11bb28f90.tar.bz2
test for mtime update
Diffstat (limited to 'test')
-rwxr-xr-xtest/CacheDir/readonly-cache.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CacheDir/readonly-cache.py b/test/CacheDir/readonly-cache.py
index 05c46e6..db3b3ec 100755
--- a/test/CacheDir/readonly-cache.py
+++ b/test/CacheDir/readonly-cache.py
@@ -28,8 +28,11 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
Verify accessing cache works even if it's read-only.
"""
+import glob
import os
import TestSCons
+import time
+from stat import *
test = TestSCons.TestSCons()
@@ -42,10 +45,22 @@ test.write('file.in', "file.in\n")
test.run(arguments = '--debug=explain --cache-debug=- .')
+cachefile = glob.glob("cache/??/*")[0]
+
+time0 = os.stat(cachefile).st_mtime
+
+time.sleep(.1)
+
test.unlink('file.out')
test.run(arguments = '--debug=explain --cache-debug=- .')
+time1 = os.stat(cachefile).st_mtime
+
+# make sure that mtime has been updated on cache use
+if time1 <= time0:
+ test.fail_test()
+
test.unlink('file.out')
for root, dirs, files in os.walk("cache",topdown=False):