summaryrefslogtreecommitdiffstats
path: root/test/option-c.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-c.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-c.py')
-rw-r--r--test/option-c.py81
1 files changed, 72 insertions, 9 deletions
diff --git a/test/option-c.py b/test/option-c.py
index ac84d05..1098a03 100644
--- a/test/option-c.py
+++ b/test/option-c.py
@@ -2,22 +2,85 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+import os.path
import TestSCons
-import string
-import sys
test = TestSCons.TestSCons()
-test.write('SConstruct', "")
+test.pass_test() #XXX Short-circuit until this is implemented.
-test.run(arguments = '-c',
- stderr = "Warning: the -c option is not yet implemented\n")
+test.write('SConstruct', """
+env = Environment()
+Program(target = 'foo1', source = 'foo1.c')
+Program(target = 'foo2', source = 'foo2.c')
+Program(target = 'foo3', source = 'foo3.c')
+""")
-test.run(arguments = '--clean',
- stderr = "Warning: the --clean option is not yet implemented\n")
+test.write('foo1.c', """
+int
+main(int argc, char *argv[])
+{
+ argv[argc++] = "--";
+ printf("foo1.c\n");
+ exit (0);
+}
+""")
-test.run(arguments = '--remove',
- stderr = "Warning: the --remove option is not yet implemented\n")
+test.write('foo2.c', """
+int
+main(int argc, char *argv[])
+{
+ argv[argc++] = "--";
+ printf("foo2.c\n");
+ exit (0);
+}
+""")
+
+test.write('foo3.c', """
+int
+main(int argc, char *argv[])
+{
+ argv[argc++] = "--";
+ printf("foo3.c\n");
+ exit (0);
+}
+""")
+
+test.run(arguments = 'foo1 foo2 foo3')
+
+test.run(program = test.workpath('foo1'), stdout = "foo1.c\n")
+test.run(program = test.workpath('foo2'), stdout = "foo2.c\n")
+test.run(program = test.workpath('foo3'), stdout = "foo3.c\n")
+
+test.run(arguments = '-c foo1')
+
+test.fail_test(os.path.exists(test.workpath('foo1')))
+test.fail_test(not os.path.exists(test.workpath('foo2')))
+test.fail_test(not os.path.exists(test.workpath('foo3')))
+
+test.run(arguments = '--clean foo2')
+
+test.fail_test(os.path.exists(test.workpath('foo1')))
+test.fail_test(os.path.exists(test.workpath('foo2')))
+test.fail_test(not os.path.exists(test.workpath('foo3')))
+
+test.run(arguments = '--remove foo3')
+
+test.fail_test(os.path.exists(test.workpath('foo1')))
+test.fail_test(os.path.exists(test.workpath('foo2')))
+test.fail_test(os.path.exists(test.workpath('foo3')))
+
+test.run(arguments = 'foo1 foo2 foo3')
+
+test.run(program = test.workpath('foo1'), stdout = "foo1.c\n")
+test.run(program = test.workpath('foo2'), stdout = "foo2.c\n")
+test.run(program = test.workpath('foo3'), stdout = "foo3.c\n")
+
+test.run(arguments = '-c .')
+
+test.fail_test(os.path.exists(test.workpath('foo1')))
+test.fail_test(os.path.exists(test.workpath('foo2')))
+test.fail_test(os.path.exists(test.workpath('foo3')))
test.pass_test()