summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authordirkbaechle <devnull@localhost>2012-09-27 22:35:09 (GMT)
committerdirkbaechle <devnull@localhost>2012-09-27 22:35:09 (GMT)
commita6d1f2c5f7282a4c25bc20059054cbc0a6d9a688 (patch)
tree1781448eb906652d808ea4bf50fdda4312fe23c1 /test
parentedbb8113bf8737e7bc77a4f23d7fd41a44dca5a6 (diff)
downloadSCons-a6d1f2c5f7282a4c25bc20059054cbc0a6d9a688.zip
SCons-a6d1f2c5f7282a4c25bc20059054cbc0a6d9a688.tar.gz
SCons-a6d1f2c5f7282a4c25bc20059054cbc0a6d9a688.tar.bz2
- several smaller fixes to get all tests running under Buildbot again
Diffstat (limited to 'test')
-rw-r--r--test/Fortran/FORTRAN.py2
-rw-r--r--test/Subst/TypeError.py2
-rw-r--r--test/VariantDir/VariantDir.py2
-rw-r--r--test/dependency-cycle.py4
-rw-r--r--test/explain/basic.py16
-rw-r--r--test/import.py4
-rw-r--r--test/packaging/rpm/multipackage.py12
-rw-r--r--test/packaging/rpm/package.py8
-rw-r--r--test/packaging/rpm/tagging.py8
9 files changed, 36 insertions, 22 deletions
diff --git a/test/Fortran/FORTRAN.py b/test/Fortran/FORTRAN.py
index df73ea6..4a2529c 100644
--- a/test/Fortran/FORTRAN.py
+++ b/test/Fortran/FORTRAN.py
@@ -87,7 +87,7 @@ test.must_match('test08' + _exe, "This is a .FPP file.\n")
fc = 'f77'
f77 = test.detect_tool(fc)
-FTN_LIB = TestSCons.fortran_lib
+FTN_LIB = test.gccFortranLibs()
if f77:
diff --git a/test/Subst/TypeError.py b/test/Subst/TypeError.py
index a996a77..371ceff 100644
--- a/test/Subst/TypeError.py
+++ b/test/Subst/TypeError.py
@@ -35,7 +35,7 @@ test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
-expect_build = r"""scons: \*\*\*%s TypeError `(unsubscriptable object|'NoneType' object is (not |un)subscriptable)' trying to evaluate `%s'
+expect_build = r"""scons: \*\*\*%s TypeError `(unsubscriptable object|'NoneType' object is (not |un)subscriptable|'NoneType' object has no attribute '__getitem__')' trying to evaluate `%s'
"""
expect_read = "\n" + expect_build + TestSCons.file_expr
diff --git a/test/VariantDir/VariantDir.py b/test/VariantDir/VariantDir.py
index a294d6b..0092692 100644
--- a/test/VariantDir/VariantDir.py
+++ b/test/VariantDir/VariantDir.py
@@ -26,9 +26,9 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
_exe = TestSCons._exe
-fortran_runtime = TestSCons.fortran_lib
test = TestSCons.TestSCons()
+fortran_runtime = test.gccFortranLibs()
fortran = test.detect('FORTRAN')
diff --git a/test/dependency-cycle.py b/test/dependency-cycle.py
index 42c9392..a555d76 100644
--- a/test/dependency-cycle.py
+++ b/test/dependency-cycle.py
@@ -50,8 +50,8 @@ f1(void)
test.run(arguments = ".", stderr=r"""
scons: \*\*\* Found dependency cycle\(s\):
- .*foo1.* -> .*foo3.* -> .*foo2.* -> .*foo1.*
- .*foo3.* -> .*foo2.* -> .*foo1.* -> .*foo3.*
+ .*foo(1|3|2).* -> .*foo(3|2|1).* -> .*foo(2|1|3).* -> .*foo(1|3|2).*
+ .*foo(3|1|2).* -> .*foo(2|3|1).* -> .*foo(1|2|3).* -> .*foo(3|1|2).*
.*
""", status=2)
diff --git a/test/explain/basic.py b/test/explain/basic.py
index 1f0a16c..5e31cfd 100644
--- a/test/explain/basic.py
+++ b/test/explain/basic.py
@@ -169,11 +169,9 @@ test.write(['src', 'file6.in'], "file6.in 1\n")
test.write(['src', 'subdir', 'file7.in'], "subdir/file7.in 1\n")
-
args = '--debug=explain .'
-
expect = test.wrap_stdout("""\
scons: building `file1' because it doesn't exist
%(_python_)s %(cat_py)s file1 file1.in
@@ -203,7 +201,9 @@ scons: building `%(subdir_file9)s' because it doesn't exist
%(_python_)s %(cat_py)s %(subdir_file9)s %(subdir_file7_in)s
""" % locals())
+test.set_match_function(TestSCons.match_caseinsensitive)
test.run(chdir='src', arguments=args, stdout=expect)
+test.set_match_function(TestSCons.match_exact)
test.must_match(['src', 'file1'], "file1.in 1\n")
test.must_match(['src', 'file2'], """\
@@ -259,7 +259,9 @@ scons: rebuilding `%(subdir_file8)s' because:
%(_python_)s %(cat_py)s %(subdir_file8)s %(subdir_file7_in)s
""" % locals())
+test.set_match_function(TestSCons.match_caseinsensitive)
test.run(chdir='src', arguments=args, stdout=expect)
+test.set_match_function(TestSCons.match_exact)
test.must_match(['src', 'file1'], "file1.in 2\n")
test.must_match(['src', 'file2'], """\
@@ -289,7 +291,9 @@ scons: rebuilding `file3' because `zzz' is no longer a dependency
%(_python_)s %(cat_py)s file3 xxx yyy
""" % locals())
+test.set_match_function(TestSCons.match_caseinsensitive)
test.run(chdir='src', arguments=args, stdout=expect)
+test.set_match_function(TestSCons.match_exact)
test.must_match(['src', 'file3'], "xxx 1\nyyy 2\n")
@@ -327,7 +331,9 @@ scons: rebuilding `file3' because the dependency order changed:
%(_python_)s %(cat_py)s file3 zzz yyy xxx
""" % locals())
+test.set_match_function(TestSCons.match_caseinsensitive)
test.run(chdir='src', arguments=args, stdout=expect)
+test.set_match_function(TestSCons.match_exact)
test.must_match(['src', 'file3'], "zzz 2\nyyy 2\nxxx 1\n")
@@ -352,7 +358,9 @@ scons: rebuilding `file3' because the build action changed:
%(_python_)s %(cat_py)s file3.yyy zzz yyy xxx yyy
""" % locals())
+test.set_match_function(TestSCons.match_caseinsensitive)
test.run(chdir='src', arguments=args, stdout=expect)
+test.set_match_function(TestSCons.match_exact)
test.must_match(['src', 'file3'], "zzz 2\nyyy 2\nxxx 1\n")
test.must_match(['src', 'file3.alt'], "zzz 2\nyyy 2\nxxx 1\n")
@@ -381,7 +389,9 @@ scons: rebuilding `file3' because the build action changed:
%(_python_)s %(cat_py)s file3.yyy zzz yyy xxx xxx
""" % locals())
+test.set_match_function(TestSCons.match_caseinsensitive)
test.run(chdir='src', arguments=args, stdout=expect)
+test.set_match_function(TestSCons.match_exact)
test.must_match(['src', 'file3'], "zzz 2\nyyy 2\nxxx 1\n")
test.must_match(['src', 'file3.alt'], "zzz 2\nyyy 2\nxxx 1\n")
@@ -402,7 +412,9 @@ scons: rebuilding `file4' because the contents of the build action changed
%(_python_)s %(cat_py)s file4 file4.in
""" % locals())
+test.set_match_function(TestSCons.match_caseinsensitive)
test.run(chdir='src',arguments=args, stdout=expect)
+test.set_match_function(TestSCons.match_exact)
test.must_match(['src', 'file4'], "file4.in 1\n")
diff --git a/test/import.py b/test/import.py
index 5bb4fcd..ef5ee61 100644
--- a/test/import.py
+++ b/test/import.py
@@ -39,7 +39,7 @@ tooldir = os.path.join(os.getcwd(), 'src', 'engine', 'SCons', 'Tool')
import TestSCons
test = TestSCons.TestSCons()
-# Before executing the any of the platform or tool modules, add some
+# Before executing any of the platform or tool modules, add some
# null entries to the environment $PATH variable to make sure there's
# no code that tries to index elements from the list before making sure
# they're non-null.
@@ -77,6 +77,8 @@ ignore = ('__init__.py',
'MSCommon',
# Sun pkgchk and pkginfo common stuff
'sun_pkg.py',
+ # RPM utilities
+ 'rpmutils.py',
)
tools = []
for name in os.listdir(tooldir):
diff --git a/test/packaging/rpm/multipackage.py b/test/packaging/rpm/multipackage.py
index 4807a20..ab8734d 100644
--- a/test/packaging/rpm/multipackage.py
+++ b/test/packaging/rpm/multipackage.py
@@ -30,7 +30,7 @@ from one SCons environment.
"""
import os
-import glob
+import SCons.Tool.rpmutils
import TestSCons
_python_ = TestSCons._python_
@@ -98,18 +98,18 @@ env.Alias( 'install', prog )
test.run(arguments='', stderr = None)
src_rpm = 'foo-1.2.3-0.src.rpm'
-machine_rpm = 'foo-1.2.3-0.*.rpm'
+machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine()
src_rpm2 = 'foo2-1.2.3-0.src.rpm'
-machine_rpm2 = 'foo2-1.2.3-0.*.rpm'
+machine_rpm2 = 'foo2-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine()
-test.must_exist_one_of( [machine_rpm] )
+test.must_exist( machine_rpm )
test.must_exist( src_rpm )
-test.must_exist_one_of( [machine_rpm2] )
+test.must_exist( machine_rpm2 )
test.must_exist( src_rpm2 )
test.must_not_exist( 'bin/main' )
-test.fail_test( not os.popen('rpm -qpl %s' % glob.glob(machine_rpm)[0].lstrip('./')).read()=='/bin/main\n')
+test.fail_test( not os.popen('rpm -qpl %s' % machine_rpm).read()=='/bin/main\n')
test.fail_test( not os.popen('rpm -qpl %s' % src_rpm).read()=='foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n')
test.pass_test()
diff --git a/test/packaging/rpm/package.py b/test/packaging/rpm/package.py
index b1abaab..d8c2785 100644
--- a/test/packaging/rpm/package.py
+++ b/test/packaging/rpm/package.py
@@ -29,7 +29,7 @@ Test the ability to create a really simple rpm package.
"""
import os
-import glob
+import SCons.Tool.rpmutils
import TestSCons
_python_ = TestSCons._python_
@@ -83,12 +83,12 @@ env.Alias( 'install', prog )
test.run(arguments='', stderr = None)
src_rpm = 'foo-1.2.3-0.src.rpm'
-machine_rpm = 'foo-1.2.3-0.*.rpm'
+machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine()
-test.must_exist_one_of( [machine_rpm] )
+test.must_exist( machine_rpm )
test.must_exist( src_rpm )
test.must_not_exist( 'bin/main' )
-test.fail_test( not os.popen('rpm -qpl %s' % glob.glob(machine_rpm)[0].lstrip('./')).read()=='/bin/main\n')
+test.fail_test( not os.popen('rpm -qpl %s' % machine_rpm).read()=='/bin/main\n')
test.fail_test( not os.popen('rpm -qpl %s' % src_rpm).read()=='foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n')
test.pass_test()
diff --git a/test/packaging/rpm/tagging.py b/test/packaging/rpm/tagging.py
index 4d6c76e..3016274 100644
--- a/test/packaging/rpm/tagging.py
+++ b/test/packaging/rpm/tagging.py
@@ -29,7 +29,7 @@ Test the ability to add file tags
"""
import os
-import glob
+import SCons.Tool.rpmutils
import TestSCons
@@ -88,11 +88,11 @@ env.Package( NAME = 'foo',
test.run(arguments='', stderr = None)
src_rpm = 'foo-1.2.3-0.src.rpm'
-machine_rpm = 'foo-1.2.3-0.*.rpm'
+machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine()
-test.must_exist_one_of( [machine_rpm] )
+test.must_exist( machine_rpm )
test.must_exist( src_rpm )
-test.fail_test( not os.popen('rpm -qpl %s' % glob.glob(machine_rpm)[0].lstrip('./')).read()=='/bin/main\n')
+test.fail_test( not os.popen('rpm -qpl %s' % machine_rpm).read()=='/bin/main\n')
test.fail_test( not os.popen('rpm -qpl %s' % src_rpm).read()=='foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n')
expect = '(0755, root, users) /bin/main'