summaryrefslogtreecommitdiff
path: root/QMTest
diff options
context:
space:
mode:
Diffstat (limited to 'QMTest')
-rw-r--r--QMTest/README.txt4
-rw-r--r--QMTest/SConscript2
-rw-r--r--QMTest/TestCmd.py14
-rw-r--r--QMTest/TestCommon.py57
-rw-r--r--QMTest/TestRuntest.py4
-rw-r--r--QMTest/TestSCons.py17
-rw-r--r--QMTest/TestSConsMSVS.py4
-rw-r--r--QMTest/TestSCons_time.py4
-rw-r--r--QMTest/TestSConsign.py4
-rw-r--r--QMTest/scons_tdb.py4
10 files changed, 57 insertions, 57 deletions
diff --git a/QMTest/README.txt b/QMTest/README.txt
index 8f08c2b..9f92e2e 100644
--- a/QMTest/README.txt
+++ b/QMTest/README.txt
@@ -54,5 +54,5 @@ the pieces here are local to SCons.
from this infrastructure, in no small part because we're not
really using it as originally envisioned.
-Copyright (c) 2001 - 2015 The SCons Foundation
-QMTest/README.txt rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog
+Copyright (c) 2001 - 2016 The SCons Foundation
+QMTest/README.txt rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog
diff --git a/QMTest/SConscript b/QMTest/SConscript
index 7cf784c..e4c9108 100644
--- a/QMTest/SConscript
+++ b/QMTest/SConscript
@@ -3,7 +3,7 @@
#
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py
index 3048973..cd559b7 100644
--- a/QMTest/TestCmd.py
+++ b/QMTest/TestCmd.py
@@ -317,20 +317,6 @@ except ImportError:
exec('from UserList import UserList')
exec('from UserString import UserString')
-try:
- # pre-2.7 doesn't have the memoryview() built-in
- memoryview
-except NameError:
- class memoryview:
- def __init__(self, obj):
- # wrapping buffer in () keeps the fixer from changing it
- self.obj = (buffer)(obj)
- def __getitem__(self, indx):
- if isinstance(indx, slice):
- return self.obj[indx.start:indx.stop]
- else:
- return self.obj[indx]
-
__all__ = [
'diff_re',
'fail_test',
diff --git a/QMTest/TestCommon.py b/QMTest/TestCommon.py
index 4e90e16..dc4c97c 100644
--- a/QMTest/TestCommon.py
+++ b/QMTest/TestCommon.py
@@ -36,6 +36,8 @@ provided by the TestCommon class:
test.must_contain('file', 'required text\n')
+ test.must_contain_all(output, input, ['title', find])
+
test.must_contain_all_lines(output, lines, ['title', find])
test.must_contain_any_line(output, lines, ['title', find])
@@ -121,31 +123,6 @@ __all__.extend([ 'TestCommon',
'dll_suffix',
])
-try:
- sorted
-except NameError:
- # Pre-2.4 Python has no sorted() function.
- #
- # The pre-2.4 Python list.sort() method does not support
- # list.sort(key=) nor list.sort(reverse=) keyword arguments, so
- # we must implement the functionality of those keyword arguments
- # by hand instead of passing them to list.sort().
- def sorted(iterable, cmp=None, key=None, reverse=False):
- if key is not None:
- result = [(key(x), x) for x in iterable]
- else:
- result = iterable[:]
- if cmp is None:
- # Pre-2.3 Python does not support list.sort(None).
- result.sort()
- else:
- result.sort(cmp)
- if key is not None:
- result = [t1 for t0,t1 in result]
- if reverse:
- result.reverse()
- return result
-
# Variables that describe the prefixes and suffixes on this system.
if sys.platform == 'win32':
exe_suffix = '.exe'
@@ -305,6 +282,36 @@ class TestCommon(TestCmd):
print file_contents
self.fail_test(not contains)
+ def must_contain_all(self, output, input, title=None, find=None):
+ """Ensures that the specified output string (first argument)
+ contains all of the specified input as a block (second argument).
+
+ An optional third argument can be used to describe the type
+ of output being searched, and only shows up in failure output.
+
+ An optional fourth argument can be used to supply a different
+ function, of the form "find(line, output), to use when searching
+ for lines in the output.
+ """
+ if find is None:
+ def find(o, i):
+ try:
+ return o.index(i)
+ except ValueError:
+ return None
+
+ if is_List(output):
+ output = os.newline.join(output)
+
+ if find(output, input) is None:
+ if title is None:
+ title = 'output'
+ print 'Missing expected input from %s:' % title
+ print input
+ print self.banner(title + ' ')
+ print output
+ self.fail_test()
+
def must_contain_all_lines(self, output, lines, title=None, find=None):
"""Ensures that the specified output string (first argument)
contains all of the specified lines (second argument).
diff --git a/QMTest/TestRuntest.py b/QMTest/TestRuntest.py
index 6c113fe..da49a4a 100644
--- a/QMTest/TestRuntest.py
+++ b/QMTest/TestRuntest.py
@@ -12,9 +12,9 @@ from those classes, as well as any overridden or additional methods or
attributes defined in this subclass.
"""
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
-__revision__ = "QMTest/TestRuntest.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "QMTest/TestRuntest.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import os
import os.path
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py
index 3e96c02..fdd3ec8 100644
--- a/QMTest/TestSCons.py
+++ b/QMTest/TestSCons.py
@@ -12,10 +12,10 @@ from those classes, as well as any overridden or additional methods or
attributes defined in this subclass.
"""
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
from __future__ import division
-__revision__ = "QMTest/TestSCons.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "QMTest/TestSCons.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import os
import re
@@ -34,16 +34,16 @@ from TestCmd import PIPE
# here provides some independent verification that what we packaged
# conforms to what we expect.
-default_version = '2.4.1'
+default_version = '2.5.0'
-python_version_unsupported = (2, 3, 0)
+python_version_unsupported = (2, 6, 0)
python_version_deprecated = (2, 7, 0)
# In the checked-in source, the value of SConsVersion in the following
# line must remain "__ VERSION __" (without the spaces) so the built
# version in build/QMTest/TestSCons.py contains the actual version
# string of the packages that have been built.
-SConsVersion = '2.4.1'
+SConsVersion = '2.5.0'
if SConsVersion == '__' + 'VERSION' + '__':
SConsVersion = default_version
@@ -201,6 +201,7 @@ class TestSCons(TestCommon):
"""
scons_version = SConsVersion
+ javac_is_gcj = False
def __init__(self, **kw):
"""Initialize an SCons testing object.
@@ -768,8 +769,13 @@ class TestSCons(TestCommon):
m = re.search(r'javac (\d\.\d)', self.stderr())
if m:
version = m.group(1)
+ self.javac_is_gcj = False
+ elif self.stderr().find('gcj'):
+ version='1.2'
+ self.javac_is_gcj = True
else:
version = None
+ self.javac_is_gcj = False
return where_javac, version
def java_where_javah(self, version=None):
@@ -792,6 +798,7 @@ class TestSCons(TestCommon):
self.skip_test("Could not find Java rmic, skipping non-simulated test(s).\n")
return where_rmic
+
def java_get_class_files(self, dir):
result = []
for dirpath, dirnames, filenames in os.walk(dir):
diff --git a/QMTest/TestSConsMSVS.py b/QMTest/TestSConsMSVS.py
index cdd85b5..6f207ef 100644
--- a/QMTest/TestSConsMSVS.py
+++ b/QMTest/TestSConsMSVS.py
@@ -13,9 +13,9 @@ as well as any overridden or additional methods or attributes defined
in this subclass.
"""
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
-__revision__ = "QMTest/TestSConsMSVS.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "QMTest/TestSConsMSVS.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import os
import sys
diff --git a/QMTest/TestSCons_time.py b/QMTest/TestSCons_time.py
index 4484015..fc6748f 100644
--- a/QMTest/TestSCons_time.py
+++ b/QMTest/TestSCons_time.py
@@ -11,9 +11,9 @@ from those classes, as well as any overridden or additional methods or
attributes defined in this subclass.
"""
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
-__revision__ = "QMTest/TestSCons_time.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "QMTest/TestSCons_time.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import os
import os.path
diff --git a/QMTest/TestSConsign.py b/QMTest/TestSConsign.py
index 67f8abb..619827a 100644
--- a/QMTest/TestSConsign.py
+++ b/QMTest/TestSConsign.py
@@ -1,6 +1,6 @@
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
-__revision__ = "QMTest/TestSConsign.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "QMTest/TestSConsign.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__doc__ = """
TestSConsign.py: a testing framework for the "sconsign" script
diff --git a/QMTest/scons_tdb.py b/QMTest/scons_tdb.py
index d85d15c..b44efad 100644
--- a/QMTest/scons_tdb.py
+++ b/QMTest/scons_tdb.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -28,7 +28,7 @@ QMTest classes to support SCons' testing and Aegis-inspired workflow.
Thanks to Stefan Seefeld for the initial code.
"""
-__revision__ = "QMTest/scons_tdb.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "QMTest/scons_tdb.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
########################################################################
# Imports