summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-08-14 11:17:14 (GMT)
committerSteven Knight <knight@baldmt.com>2001-08-14 11:17:14 (GMT)
commit7884cffaf3380a66a999ae8db12e0418f96993c0 (patch)
tree98d0b177f9b53719dc070c00f52332f653b65049 /test
parent062cbfc18a81e3b0c4147c4ead7cebff5e18063f (diff)
downloadSCons-7884cffaf3380a66a999ae8db12e0418f96993c0.zip
SCons-7884cffaf3380a66a999ae8db12e0418f96993c0.tar.gz
SCons-7884cffaf3380a66a999ae8db12e0418f96993c0.tar.bz2
Clean up tests.
Diffstat (limited to 'test')
-rw-r--r--test/Program-j.py (renamed from test/t0002.py)10
-rw-r--r--test/Program.py (renamed from test/t0010.py)8
-rw-r--r--test/SConscript.py28
-rw-r--r--test/option-f.py34
-rw-r--r--test/option-j.py (renamed from test/t0001.py)12
-rw-r--r--test/t0001.t30
6 files changed, 78 insertions, 44 deletions
diff --git a/test/t0002.py b/test/Program-j.py
index 0cdfa81..822c64f 100644
--- a/test/t0002.py
+++ b/test/Program-j.py
@@ -1,12 +1,12 @@
#!/usr/bin/env python
-__revision__ = "test/t0002.py __REVISION__ __DATE__ __DEVELOPER__"
+__revision__ = "test/Program-j.py __REVISION__ __DATE__ __DEVELOPER__"
-from TestCmd import TestCmd
+import TestCmd
-test = TestCmd(program = 'scons.py',
- workdir = '',
- interpreter = 'python')
+test = TestCmd.TestCmd(program = 'scons.py',
+ workdir = '',
+ interpreter = 'python')
test.write('SConstruct', """
env = Environment()
diff --git a/test/t0010.py b/test/Program.py
index 9d00a7f..78edf92 100644
--- a/test/t0010.py
+++ b/test/Program.py
@@ -1,10 +1,12 @@
#!/usr/bin/env python
-__revision__ = "test/t0001.t __REVISION__ __DATE__ __DEVELOPER__"
+__revision__ = "test/Program.py __REVISION__ __DATE__ __DEVELOPER__"
-from TestCmd import TestCmd
+import TestCmd
-test = TestCmd(program = 'scons.py', workdir = '', interpreter = 'python')
+test = TestCmd.TestCmd(program = 'scons.py',
+ workdir = '',
+ interpreter = 'python')
test.write('SConstruct', """
env = Environment()
diff --git a/test/SConscript.py b/test/SConscript.py
new file mode 100644
index 0000000..de24d68
--- /dev/null
+++ b/test/SConscript.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+
+__revision__ = "test/SConscript.py __REVISION__ __DATE__ __DEVELOPER__"
+
+import TestCmd
+
+test = TestCmd.TestCmd(program = 'scons.py',
+ workdir = '',
+ interpreter = 'python')
+
+test.write('SConstruct', """
+import os
+print "SConstruct", os.getcwd()
+Conscript('SConscript')
+""")
+
+# XXX I THINK THEY SHOULD HAVE TO RE-IMPORT OS HERE
+test.write('SConscript', """
+import os
+print "SConscript " + os.getcwd()
+""")
+
+wpath = test.workpath()
+
+test.run(chdir = '.')
+test.fail_test(test.stdout() != ("SConstruct %s\nSConscript %s\n" % (wpath, wpath)))
+
+test.pass_test()
diff --git a/test/option-f.py b/test/option-f.py
new file mode 100644
index 0000000..e52532e
--- /dev/null
+++ b/test/option-f.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+
+__revision__ = "test/option-f.py __REVISION__ __DATE__ __DEVELOPER__"
+
+import TestCmd
+import os.path
+
+test = TestCmd.TestCmd(program = 'scons.py',
+ workdir = '',
+ interpreter = 'python')
+
+test.subdir('subdir')
+
+subdir_BuildThis = os.path.join('subdir', 'Buildthis')
+
+test.write('SConscript', """
+import os
+print "SConscript " + os.getcwd()
+""")
+
+test.write(subdir_BuildThis, """
+import os
+print "subdir/BuildThis", os.getcwd()
+""")
+
+wpath = test.workpath()
+
+test.run(chdir = '.', arguments = '-f SConscript')
+test.fail_test(test.stdout() != ("SConscript %s\n" % wpath))
+
+test.run(chdir = '.', arguments = '-f ' + subdir_BuildThis)
+test.fail_test(test.stdout() != ("subdir/BuildThis %s\n" % wpath))
+
+test.pass_test()
diff --git a/test/t0001.py b/test/option-j.py
index 824e046..ae403a6 100644
--- a/test/t0001.py
+++ b/test/option-j.py
@@ -1,8 +1,8 @@
#!/usr/bin/env python
-__revision__ = "test/t0001.py __REVISION__ __DATE__ __DEVELOPER__"
+__revision__ = "test/option-j.py __REVISION__ __DATE__ __DEVELOPER__"
-from TestCmd import TestCmd
+import TestCmd
import string
import sys
@@ -12,13 +12,13 @@ try:
except ImportError:
# if threads are not supported, then
# there is nothing to test
- test.pass_test()
+ TestCmd.no_result()
sys.exit()
-test = TestCmd(program = 'scons.py',
- workdir = '',
- interpreter = 'python')
+test = TestCmd.TestCmd(program = 'scons.py',
+ workdir = '',
+ interpreter = 'python')
test.write('build.py', r"""
import time
diff --git a/test/t0001.t b/test/t0001.t
deleted file mode 100644
index 8f9bed3..0000000
--- a/test/t0001.t
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env python
-
-__revision__ = "test/t0001.t __REVISION__ __DATE__ __DEVELOPER__"
-
-from TestCmd import TestCmd
-
-test = TestCmd(program = 'scons.py', workdir = '', interpreter = 'python')
-
-test.write('SConstruct', """
-import os
-print "SConstruct", os.getcwd()
-Conscript('SConscript')
-""")
-
-# XXX I THINK THEY SHOULD HAVE TO RE-IMPORT OS HERE,
-# WHICH THEY DO FOR THE SECOND TEST BELOW, BUT NOT THE FIRST...
-test.write('SConscript', """
-import os
-print "SConscript " + os.getcwd()
-""")
-
-wpath = test.workpath()
-
-test.run(chdir = '.')
-test.fail_test(test.stdout() != ("SConstruct %s\nSConscript %s\n" % (wpath, wpath)))
-
-test.run(chdir = '.', arguments = '-f SConscript')
-test.fail_test(test.stdout() != ("SConscript %s\n" % wpath))
-
-test.pass_test()