summaryrefslogtreecommitdiff
path: root/test/Program.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-09-21 11:39:19 +0000
committerSteven Knight <knight@baldmt.com>2001-09-21 11:39:19 +0000
commitf407037c97df685b54882142784d2f353aaac6b6 (patch)
tree3841c4d5ace0dbfd17e48f6f8c85c9a2f3a720d7 /test/Program.py
parent635256859678b6b862b89d4c5ce890b4923e8394 (diff)
downloadscons-f407037c97df685b54882142784d2f353aaac6b6.tar.gz
rebuild in response to changed .c file
Diffstat (limited to 'test/Program.py')
-rw-r--r--test/Program.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Program.py b/test/Program.py
index d5178089..4189c466 100644
--- a/test/Program.py
+++ b/test/Program.py
@@ -3,6 +3,8 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
+import os.path
+import time
#XXX Future: be able to interpolate
@@ -121,4 +123,12 @@ test.run(program = test.workpath('foo2'), stdout = "f2a.c\nf2b.c\nf2c.c\n")
#XXXtest.up_to_date(arguments = '.')
+# make sure the programs don't get rebuilt, because nothing changed:
+oldtime1 = os.path.getmtime(test.workpath('foo1'))
+oldtime2 = os.path.getmtime(test.workpath('foo2'))
+time.sleep(1) # introduce a small delay, to make the test valid
+test.run(arguments = 'foo1 foo2')
+test.fail_test(not (oldtime1 == os.path.getmtime(test.workpath('foo1'))))
+test.fail_test(not (oldtime2 == os.path.getmtime(test.workpath('foo2'))))
+
test.pass_test()