summaryrefslogtreecommitdiffstats
path: root/test/option-d.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-09-21 01:30:38 (GMT)
committerSteven Knight <knight@baldmt.com>2001-09-21 01:30:38 (GMT)
commitc8bbea81460524f6469fa4b6afc2be5a6f338edc (patch)
treeaa6a337d270384c8e12577542615ae3f3f51dc39 /test/option-d.py
parentb6251d39d5f5b187a7455923caeede3b962a6d0e (diff)
downloadSCons-c8bbea81460524f6469fa4b6afc2be5a6f338edc.zip
SCons-c8bbea81460524f6469fa4b6afc2be5a6f338edc.tar.gz
SCons-c8bbea81460524f6469fa4b6afc2be5a6f338edc.tar.bz2
Add additional tests to provide more examples.
Diffstat (limited to 'test/option-d.py')
-rw-r--r--test/option-d.py104
1 files changed, 99 insertions, 5 deletions
diff --git a/test/option-d.py b/test/option-d.py
index a9bc1e8..e5efcbc 100644
--- a/test/option-d.py
+++ b/test/option-d.py
@@ -3,15 +3,109 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
-import string
-import sys
test = TestSCons.TestSCons()
-test.write('SConstruct', "")
+test.pass_test() #XXX Short-circuit until this is supported.
-test.run(arguments = '-d',
- stderr = "Warning: the -d option is not yet implemented\n")
+test.subdir('subdir')
+
+test.write('SConstruct', """
+env = Environment()
+env.Program(target = 'aaa', source = 'aaa.c')
+env.Program(target = 'bbb', source = 'bbb.c')
+SConscript('subdir/SConscript')
+""")
+
+test.write(['subdir', 'SConscript'], """
+env = Environment()
+env.Program(target = 'ccc', source = 'ccc.c')
+env.Program(target = 'ddd', source = 'ddd.c')
+""")
+
+test.write('aaa.c', """
+int
+main(int argc, char *argv)
+{
+ argv[argc++] = "--";
+ printf("aaa.c\n");
+ exit (0);
+}
+""")
+
+test.write('bbb.c', """
+int
+main(int argc, char *argv)
+{
+ argv[argc++] = "--";
+ printf("bbb.c\n");
+ exit (0);
+}
+""")
+
+test.write(['subdir', 'ccc.c'], """
+int
+main(int argc, char *argv)
+{
+ argv[argc++] = "--";
+ printf("subdir/ccc.c\n");
+ exit (0);
+}
+""")
+
+test.write(['subdir', 'ddd.c'], """
+int
+main(int argc, char *argv)
+{
+ argv[argc++] = "--";
+ printf("subdir/ddd.c\n");
+ exit (0);
+}
+""")
+
+test.run(arguments = '-d .', stdout = """
+Target aaa: aaa.o
+Checking aaa
+ Checking aaa.o
+ Checking aaa.c
+ Rebuilding aaa.o: out of date.
+cc -c -o aaa.o aaa.c
+Rebuilding aaa: out of date.
+cc -o aaa aaa.o
+Target aaa.o: aaa.c
+Target bbb: bbb.o
+Checking bbb
+ Checking bbb.o
+ Checking bbb.c
+ Rebuilding bbb.o: out of date.
+cc -c -o bbb.o bbb.c
+Rebuilding bbb: out of date.
+cc -o bbb bbb.o
+Target bbb.o: bbb.c
+Target subdir/ccc/g: subdir/ccc.o
+Checking subdir/ccc/g
+ Checking subdir/ccc/g.o
+ Checking subdir/ccc/g.c
+ Rebuilding subdir/ccc/g.o: out of date.
+cc -c -o subdir/ccc/g.o subdir/ccc.c
+Rebuilding subdir/ccc/g: out of date.
+cc -o subdir/ccc/g subdir/ccc.o
+Target subdir/ccc/g.o: subdir/ccc.c
+Target subdir/ddd/g: subdir/ddd.o
+Checking subdir/ddd/g
+ Checking subdir/ddd/g.o
+ Checking subdir/ddd/g.c
+ Rebuilding subdir/ddd/g.o: out of date.
+cc -c -o subdir/ddd/g.o subdir/ddd.c
+Rebuilding subdir/ddd/g: out of date.
+cc -o subdir/ddd/g subdir/ddd.o
+Target subdir/ddd/g.o: subdir/ddd.c
+""")
+
+test.run(program = test.workpath('aaa'), stdout = "aaa.c\n")
+test.run(program = test.workpath('bbb'), stdout = "bbb.c\n")
+test.run(program = test.workpath('subdir/ccc'), stdout = "subdir/ccc.c\n")
+test.run(program = test.workpath('subdir/ddd'), stdout = "subdir/ddd.c\n")
test.pass_test()