summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRussel Winder <russel@winder.org.uk>2012-08-29 20:00:36 (GMT)
committerRussel Winder <russel@winder.org.uk>2012-08-29 20:00:36 (GMT)
commit8d266ff2aa3fb3dbb989d2a5c39e8769b0e989f8 (patch)
tree92584f7bce2320c60a9792907c8c08a6dde1780f /test
parent86ad443acfa0e3b3588fb3bc30770b3ed58c10fb (diff)
parenta54670d821ac18abc3880ef9ca03c2f84edd5ae6 (diff)
downloadSCons-8d266ff2aa3fb3dbb989d2a5c39e8769b0e989f8.zip
SCons-8d266ff2aa3fb3dbb989d2a5c39e8769b0e989f8.tar.gz
SCons-8d266ff2aa3fb3dbb989d2a5c39e8769b0e989f8.tar.bz2
Merge in the mainline.
Diffstat (limited to 'test')
-rw-r--r--test/README4
-rw-r--r--test/packaging/convenience-functions/convenience-functions.py (renamed from test/packaging/convenience-functions.py)17
-rw-r--r--test/packaging/convenience-functions/image/SConstruct10
-rw-r--r--test/packaging/convenience-functions/image/f10
-rw-r--r--test/packaging/convenience-functions/image/f20
-rw-r--r--test/packaging/convenience-functions/image/f30
-rw-r--r--test/packaging/sandbox-test/SConstruct19
-rw-r--r--test/packaging/sandbox-test/sandbox-test.py (renamed from test/packaging/sandbox-test.py)27
-rw-r--r--test/packaging/sandbox-test/src/foobar.c0
-rw-r--r--test/packaging/sandbox-test/src/foobar.h0
-rw-r--r--test/runtest/aegis/batch-output.py2
-rw-r--r--test/runtest/baseline/combined.py2
-rw-r--r--test/runtest/baseline/fail.py2
-rw-r--r--test/runtest/baseline/no_result.py2
-rw-r--r--test/runtest/baseline/pass.py2
-rw-r--r--test/runtest/fallback.py2
-rw-r--r--test/runtest/noqmtest.py2
-rw-r--r--test/runtest/print_time.py2
-rw-r--r--test/runtest/python.py2
-rw-r--r--test/runtest/simple/combined.py2
-rw-r--r--test/runtest/simple/fail.py2
-rw-r--r--test/runtest/simple/no_result.py2
-rw-r--r--test/runtest/simple/pass.py2
-rw-r--r--test/runtest/src.py2
-rw-r--r--test/runtest/testlistfile.py2
25 files changed, 51 insertions, 56 deletions
diff --git a/test/README b/test/README
index 7c88b39..2c8423f 100644
--- a/test/README
+++ b/test/README
@@ -53,3 +53,7 @@ semblance of uniformity, here are the naming conventions for tests:
option--lo.py long option; abbreviate the long
option name to a few characters
+
+For some more information about running the tests and writing them, please
+refer to the documentation for the testing framework. It can be found in
+the 'QMTest' folder, as file 'test-framework.rst'.
diff --git a/test/packaging/convenience-functions.py b/test/packaging/convenience-functions/convenience-functions.py
index 2fc6aee..a1be041 100644
--- a/test/packaging/convenience-functions.py
+++ b/test/packaging/convenience-functions/convenience-functions.py
@@ -31,24 +31,9 @@ Test the FindInstalledFiles() and the FindSourceFiles() functions.
import os.path
import TestSCons
-python = TestSCons.python
test = TestSCons.TestSCons()
-test.write( "f1", "" )
-test.write( "f2", "" )
-test.write( "f3", "" )
-
-test.write( 'SConstruct', r"""
-env = Environment(tools=['default', 'packaging'])
-prog = env.Install( 'bin/', ["f1", "f2"] )
-env.File( "f3" )
-
-src_files = sorted(map(str, env.FindSourceFiles()))
-oth_files = sorted(map(str, env.FindInstalledFiles()))
-
-print src_files
-print oth_files
-""")
+test.dir_fixture( "image" )
bin_f1 = os.path.join('bin', 'f1')
bin_f2 = os.path.join('bin', 'f2')
diff --git a/test/packaging/convenience-functions/image/SConstruct b/test/packaging/convenience-functions/image/SConstruct
new file mode 100644
index 0000000..461961e
--- /dev/null
+++ b/test/packaging/convenience-functions/image/SConstruct
@@ -0,0 +1,10 @@
+
+env = Environment(tools=['default', 'packaging'])
+prog = env.Install( 'bin/', ["f1", "f2"] )
+env.File( "f3" )
+
+src_files = sorted(map(str, env.FindSourceFiles()))
+oth_files = sorted(map(str, env.FindInstalledFiles()))
+
+print src_files
+print oth_files
diff --git a/test/packaging/convenience-functions/image/f1 b/test/packaging/convenience-functions/image/f1
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/packaging/convenience-functions/image/f1
diff --git a/test/packaging/convenience-functions/image/f2 b/test/packaging/convenience-functions/image/f2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/packaging/convenience-functions/image/f2
diff --git a/test/packaging/convenience-functions/image/f3 b/test/packaging/convenience-functions/image/f3
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/packaging/convenience-functions/image/f3
diff --git a/test/packaging/sandbox-test/SConstruct b/test/packaging/sandbox-test/SConstruct
new file mode 100644
index 0000000..f44a471
--- /dev/null
+++ b/test/packaging/sandbox-test/SConstruct
@@ -0,0 +1,19 @@
+
+from glob import glob
+
+src_files = glob( 'src/*.c' )
+include_files = glob( 'src/*.h' )
+
+SharedLibrary( 'foobar', src_files )
+
+env = Environment(tools=['default', 'packaging'])
+
+env.Package( NAME = 'libfoobar',
+ VERSION = '1.2.3',
+ PACKAGETYPE = 'targz',
+ source = src_files + include_files )
+
+env.Package( NAME = 'libfoobar',
+ VERSION = '1.2.3',
+ PACKAGETYPE = 'zip',
+ source = src_files + include_files )
diff --git a/test/packaging/sandbox-test.py b/test/packaging/sandbox-test/sandbox-test.py
index 7110c87..c6d2140 100644
--- a/test/packaging/sandbox-test.py
+++ b/test/packaging/sandbox-test/sandbox-test.py
@@ -39,31 +39,8 @@ tar = test.detect('TAR', 'tar')
if not tar:
test.skip_test('tar not found, skipping test\n')
-test.subdir('src')
-
-test.write([ 'src', 'foobar.h' ], '')
-test.write([ 'src', 'foobar.c' ], '')
-
-test.write('SConstruct', """
-from glob import glob
-
-src_files = glob( 'src/*.c' )
-include_files = glob( 'src/*.h' )
-
-SharedLibrary( 'foobar', src_files )
-
-env = Environment(tools=['default', 'packaging'])
-
-env.Package( NAME = 'libfoobar',
- VERSION = '1.2.3',
- PACKAGETYPE = 'targz',
- source = src_files + include_files )
-
-env.Package( NAME = 'libfoobar',
- VERSION = '1.2.3',
- PACKAGETYPE = 'zip',
- source = src_files + include_files )
-""")
+test.dir_fixture('src','src')
+test.file_fixture('SConstruct')
test.run(stderr=None)
diff --git a/test/packaging/sandbox-test/src/foobar.c b/test/packaging/sandbox-test/src/foobar.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/packaging/sandbox-test/src/foobar.c
diff --git a/test/packaging/sandbox-test/src/foobar.h b/test/packaging/sandbox-test/src/foobar.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/packaging/sandbox-test/src/foobar.h
diff --git a/test/runtest/aegis/batch-output.py b/test/runtest/aegis/batch-output.py
index 68bd166..e371def 100644
--- a/test/runtest/aegis/batch-output.py
+++ b/test/runtest/aegis/batch-output.py
@@ -52,7 +52,7 @@ NO RESULT TEST STDERR
PASSING TEST STDERR
"""
-test.run(arguments = '-o aegis.out --aegis test', stderr=expect_stderr)
+test.run(arguments = '-k -o aegis.out --aegis test', stderr=expect_stderr)
expect = """\
test_result = [
diff --git a/test/runtest/baseline/combined.py b/test/runtest/baseline/combined.py
index 119fc63..35c1796 100644
--- a/test/runtest/baseline/combined.py
+++ b/test/runtest/baseline/combined.py
@@ -69,7 +69,7 @@ NO RESULT TEST STDERR
PASSING TEST STDERR
"""
-test.run(arguments='-b . test',
+test.run(arguments='-k -b . test',
status=1,
stdout=expect_stdout,
stderr=expect_stderr)
diff --git a/test/runtest/baseline/fail.py b/test/runtest/baseline/fail.py
index baa974a..5687160 100644
--- a/test/runtest/baseline/fail.py
+++ b/test/runtest/baseline/fail.py
@@ -47,7 +47,7 @@ expect_stderr = """\
FAILING TEST STDERR
"""
-test.run(arguments='-b . test/fail.py',
+test.run(arguments='-k -b . test/fail.py',
status=1,
stdout=expect_stdout,
stderr=expect_stderr)
diff --git a/test/runtest/baseline/no_result.py b/test/runtest/baseline/no_result.py
index 8e0d0dd..2149594 100644
--- a/test/runtest/baseline/no_result.py
+++ b/test/runtest/baseline/no_result.py
@@ -47,7 +47,7 @@ expect_stderr = """\
NO RESULT TEST STDERR
"""
-test.run(arguments='-b . test/no_result.py',
+test.run(arguments='-k -b . test/no_result.py',
status=2,
stdout=expect_stdout,
stderr=expect_stderr)
diff --git a/test/runtest/baseline/pass.py b/test/runtest/baseline/pass.py
index 77cd84d..affa486 100644
--- a/test/runtest/baseline/pass.py
+++ b/test/runtest/baseline/pass.py
@@ -50,7 +50,7 @@ expect_stderr = """\
PASSING TEST STDERR
"""
-test.run(arguments='-b . test',
+test.run(arguments='-k -b . test',
stdout=expect_stdout,
stderr=expect_stderr)
diff --git a/test/runtest/fallback.py b/test/runtest/fallback.py
index 3bfb9f4..1229b28 100644
--- a/test/runtest/fallback.py
+++ b/test/runtest/fallback.py
@@ -82,7 +82,7 @@ testlist = [
test_pass_py,
]
-test.run(arguments = ' '.join(testlist),
+test.run(arguments = '-k '+' '.join(testlist),
status = 1,
stdout = expect_stdout,
stderr = expect_stderr)
diff --git a/test/runtest/noqmtest.py b/test/runtest/noqmtest.py
index 9d0c8e3..eb33223 100644
--- a/test/runtest/noqmtest.py
+++ b/test/runtest/noqmtest.py
@@ -74,7 +74,7 @@ testlist = [
test_pass_py,
]
-test.run(arguments = '--noqmtest %s' % ' '.join(testlist),
+test.run(arguments = '-k --noqmtest %s' % ' '.join(testlist),
status = 1,
stdout = expect_stdout,
stderr = expect_stderr)
diff --git a/test/runtest/print_time.py b/test/runtest/print_time.py
index e068447..244c6f8 100644
--- a/test/runtest/print_time.py
+++ b/test/runtest/print_time.py
@@ -75,7 +75,7 @@ NO RESULT TEST STDERR
PASSING TEST STDERR
"""
-test.run(arguments='-t test',
+test.run(arguments='-k -t test',
status=1,
stdout=expect_stdout,
stderr=expect_stderr)
diff --git a/test/runtest/python.py b/test/runtest/python.py
index 5c2f737..d406be4 100644
--- a/test/runtest/python.py
+++ b/test/runtest/python.py
@@ -66,7 +66,7 @@ expect_stderr = """\
PASSING TEST STDERR
"""
-test.run(arguments=['-P', mypython, 'test'],
+test.run(arguments=['-k','-P', mypython, 'test'],
stdout=expect_stdout,
stderr=expect_stderr)
diff --git a/test/runtest/simple/combined.py b/test/runtest/simple/combined.py
index 6817820..616f4d5 100644
--- a/test/runtest/simple/combined.py
+++ b/test/runtest/simple/combined.py
@@ -70,7 +70,7 @@ NO RESULT TEST STDERR
PASSING TEST STDERR
"""
-test.run(arguments='test',
+test.run(arguments='-k test',
status=1,
stdout=expect_stdout,
stderr=expect_stderr)
diff --git a/test/runtest/simple/fail.py b/test/runtest/simple/fail.py
index 36ec0d0..8b800fb 100644
--- a/test/runtest/simple/fail.py
+++ b/test/runtest/simple/fail.py
@@ -47,7 +47,7 @@ expect_stderr = """\
FAILING TEST STDERR
"""
-test.run(arguments='test/fail.py',
+test.run(arguments='-k test/fail.py',
status=1,
stdout=expect_stdout,
stderr=expect_stderr)
diff --git a/test/runtest/simple/no_result.py b/test/runtest/simple/no_result.py
index 97dcede..91af7e4 100644
--- a/test/runtest/simple/no_result.py
+++ b/test/runtest/simple/no_result.py
@@ -47,7 +47,7 @@ expect_stderr = """\
NO RESULT TEST STDERR
"""
-test.run(arguments='test/no_result.py',
+test.run(arguments='-k test/no_result.py',
status=2,
stdout=expect_stdout,
stderr=expect_stderr)
diff --git a/test/runtest/simple/pass.py b/test/runtest/simple/pass.py
index 6332e5f..6e5b6b0 100644
--- a/test/runtest/simple/pass.py
+++ b/test/runtest/simple/pass.py
@@ -47,7 +47,7 @@ expect_stderr = """\
PASSING TEST STDERR
"""
-test.run(arguments='test/pass.py', stdout=expect_stdout, stderr=expect_stderr)
+test.run(arguments='-k test/pass.py', stdout=expect_stdout, stderr=expect_stderr)
test.pass_test()
diff --git a/test/runtest/src.py b/test/runtest/src.py
index 9136a4d..23894f9 100644
--- a/test/runtest/src.py
+++ b/test/runtest/src.py
@@ -62,7 +62,7 @@ PASSING TEST STDERR
PASSING TEST STDERR
""" % locals()
-test.run(arguments='src', stdout=expect_stdout, stderr=expect_stderr)
+test.run(arguments='-k src', stdout=expect_stdout, stderr=expect_stderr)
test.pass_test()
diff --git a/test/runtest/testlistfile.py b/test/runtest/testlistfile.py
index 8836c8e..b86b0f2 100644
--- a/test/runtest/testlistfile.py
+++ b/test/runtest/testlistfile.py
@@ -62,7 +62,7 @@ expect_stderr = """\
PASSING TEST STDERR
"""
-test.run(arguments='-f t.txt', stdout=expect_stdout, stderr=expect_stderr)
+test.run(arguments='-k -f t.txt', stdout=expect_stdout, stderr=expect_stderr)
test.pass_test()