summaryrefslogtreecommitdiff
path: root/test/Program.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-10-26 18:30:48 +0000
committerSteven Knight <knight@baldmt.com>2001-10-26 18:30:48 +0000
commita140305276c1dc47997c54a76e5b586b1f82b4fb (patch)
tree4ec44fddaf1f2877ce6eb95b80062a62a4804a7d /test/Program.py
parent72bf1332c237068b5a3fac1bb5342530237f36f0 (diff)
downloadscons-a140305276c1dc47997c54a76e5b586b1f82b4fb.tar.gz
Fix a signature calculation bug.
Diffstat (limited to 'test/Program.py')
-rw-r--r--test/Program.py72
1 files changed, 70 insertions, 2 deletions
diff --git a/test/Program.py b/test/Program.py
index 6a0db703..80c1d95b 100644
--- a/test/Program.py
+++ b/test/Program.py
@@ -143,12 +143,80 @@ test.run(program = test.workpath('foo3'), stdout = "f3a.c\nf3b.c X\nf3c.c\n")
test.up_to_date(arguments = '.')
-# make sure the programs don't get rebuilt, because nothing changed:
+# make sure the programs didn't get rebuilt, because nothing changed:
oldtime1 = os.path.getmtime(test.workpath('foo1'))
oldtime2 = os.path.getmtime(test.workpath('foo2'))
oldtime3 = os.path.getmtime(test.workpath('foo3'))
+
time.sleep(2) # introduce a small delay, to make the test valid
-test.run(arguments = '.')
+
+test.run(arguments = 'foo1 foo2 foo3')
+
+test.fail_test(not (oldtime1 == os.path.getmtime(test.workpath('foo1'))))
+test.fail_test(not (oldtime2 == os.path.getmtime(test.workpath('foo2'))))
+test.fail_test(not (oldtime3 == os.path.getmtime(test.workpath('foo3'))))
+
+test.write('f1.c', """
+int
+main(int argc, char *argv[])
+{
+ argv[argc++] = "--";
+ printf("f1.c Y\n");
+ exit (0);
+}
+""")
+
+test.write('f3b.c', """
+void
+f3b(void)
+{
+ printf("f3b.c Y\n");
+}
+""")
+
+test.run(arguments = 'foo1 foo2 foo3')
+
+test.run(program = test.workpath('foo1'), stdout = "f1.c Y\n")
+test.run(program = test.workpath('foo2'), stdout = "f2a.c\nf2b.c\nf2c.c\n")
+test.run(program = test.workpath('foo3'), stdout = "f3a.c\nf3b.c Y\nf3c.c\n")
+
+test.up_to_date(arguments = 'foo1 foo2 foo3')
+
+test.write('f1.c', """
+int
+main(int argc, char *argv[])
+{
+ argv[argc++] = "--";
+ printf("f1.c Z\n");
+ exit (0);
+}
+""")
+
+test.write('f3b.c', """
+void
+f3b(void)
+{
+ printf("f3b.c Z\n");
+}
+""")
+
+test.run(arguments = 'foo1 foo2 foo3')
+
+test.run(program = test.workpath('foo1'), stdout = "f1.c Z\n")
+test.run(program = test.workpath('foo2'), stdout = "f2a.c\nf2b.c\nf2c.c\n")
+test.run(program = test.workpath('foo3'), stdout = "f3a.c\nf3b.c Z\nf3c.c\n")
+
+test.up_to_date(arguments = 'foo1 foo2 foo3')
+
+# make sure the programs didn't get rebuilt, because nothing changed:
+oldtime1 = os.path.getmtime(test.workpath('foo1'))
+oldtime2 = os.path.getmtime(test.workpath('foo2'))
+oldtime3 = os.path.getmtime(test.workpath('foo3'))
+
+time.sleep(2) # introduce a small delay, to make the test valid
+
+test.run(arguments = 'foo1 foo2 foo3')
+
test.fail_test(not (oldtime1 == os.path.getmtime(test.workpath('foo1'))))
test.fail_test(not (oldtime2 == os.path.getmtime(test.workpath('foo2'))))
test.fail_test(not (oldtime3 == os.path.getmtime(test.workpath('foo3'))))