From af9e270bf0dc34fecff450199f90dc14bb0334de Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Thu, 15 Jul 2004 12:39:34 +0000 Subject: Win32 portability: add an explicit match argument to TestCommon.py, use it to only use match_re_dotall when we're using TestSCons.noisy_ar. --- etc/TestCmd.py | 16 +++++----- etc/TestCommon.py | 68 ++++++++++++++++++++++------------------ etc/TestSCons.py | 5 ++- test/AR.py | 10 ++++-- test/ARFLAGS.py | 10 ++++-- test/CPPPATH.py | 6 ++-- test/HeaderGen.py | 5 +-- test/HeaderInstall.py | 6 ++-- test/LIBPATH.py | 18 ++++++++--- test/LIBPREFIXES.py | 6 ++-- test/LIBS.py | 14 ++++++--- test/LIBSUFFIXES.py | 6 ++-- test/Library.py | 10 ++++-- test/QT.py | 12 ++++--- test/QTFLAGS.py | 5 +-- test/RANLIB.py | 10 ++++-- test/RANLIBFLAGS.py | 10 ++++-- test/Repository/StaticLibrary.py | 14 ++++++--- test/SharedLibrary.py | 16 +++++++--- test/long-lines.py | 6 ++-- test/scan-once.py | 6 ++-- 21 files changed, 163 insertions(+), 96 deletions(-) diff --git a/etc/TestCmd.py b/etc/TestCmd.py index 48aa204..9533398 100644 --- a/etc/TestCmd.py +++ b/etc/TestCmd.py @@ -175,8 +175,8 @@ version. # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. __author__ = "Steven Knight " -__revision__ = "TestCmd.py 0.7.D001 2004/07/08 10:02:13 knight" -__version__ = "0.7" +__revision__ = "TestCmd.py 0.8.D001 2004/07/15 06:24:14 knight" +__version__ = "0.8" import os import os.path @@ -496,7 +496,7 @@ class TestCmd: """ if not self._dirlist: return - os.chdir(self._cwd) + os.chdir(self._cwd) self.workdir = None if condition is None: condition = self.condition @@ -510,7 +510,7 @@ class TestCmd: self.writable(dir, 1) shutil.rmtree(dir, ignore_errors = 1) self._dirlist = [] - + try: global _Cleanup _Cleanup.remove(self) @@ -789,10 +789,10 @@ class TestCmd: def where_is(self, file, path=None, pathext=None): """Find an executable file. """ - if is_List(file): - file = apply(os.path.join, tuple(file)) - if not os.path.isabs(file): - file = where_is(file, path, pathext) + if is_List(file): + file = apply(os.path.join, tuple(file)) + if not os.path.isabs(file): + file = where_is(file, path, pathext) return file def workdir_set(self, path): diff --git a/etc/TestCommon.py b/etc/TestCommon.py index 8f4f22c..ff8a3f3 100644 --- a/etc/TestCommon.py +++ b/etc/TestCommon.py @@ -43,7 +43,8 @@ provided by the TestCommon class: test.run(options = "options to be prepended to arguments", stdout = "expected standard output from the program", stderr = "expected error output from the program", - status = expected_status) + status = expected_status, + match = match_function) The TestCommon module also provides the following variables @@ -75,8 +76,8 @@ The TestCommon module also provides the following variables # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. __author__ = "Steven Knight " -__revision__ = "TestCommon.py 0.7.D001 2004/07/08 10:02:13 knight" -__version__ = "0.7" +__revision__ = "TestCommon.py 0.8.D001 2004/07/15 06:24:14 knight" +__version__ = "0.8" import os import os.path @@ -220,7 +221,7 @@ class TestCommon(TestCmd): self.fail_test(not self.match(file_contents, expect)) except: print "Unexpected contents of `%s'" % file - print "EXPECTED contents ======" + print "EXPECTED contents ======" print expect print "ACTUAL contents ========" print file_contents @@ -240,7 +241,7 @@ class TestCommon(TestCmd): def run(self, options = None, arguments = None, stdout = None, stderr = '', status = 0, **kw): - """Runs the program under test, checking that the test succeeded. + """Runs the program under test, checking that the test succeeded. The arguments are the same as the base TestCmd.run() method, with the addition of: @@ -248,13 +249,13 @@ class TestCommon(TestCmd): options Extra options that get appended to the beginning of the arguments. - stdout The expected standard output from - the command. A value of None means - don't test standard output. + stdout The expected standard output from + the command. A value of None means + don't test standard output. - stderr The expected error output from - the command. A value of None means - don't test error output. + stderr The expected error output from + the command. A value of None means + don't test error output. status The expected exit status from the command. A value of None means don't @@ -263,32 +264,37 @@ class TestCommon(TestCmd): By default, this expects a successful exit (status = 0), does not test standard output (stdout = None), and expects that error output is empty (stderr = ""). - """ + """ if options: if arguments is None: arguments = options else: arguments = options + " " + arguments kw['arguments'] = arguments - try: - apply(TestCmd.run, [self], kw) - except: - print "STDOUT ============" - print self.stdout() - print "STDERR ============" - print self.stderr() - raise - if _failed(self, status): + try: + match = kw['match'] + del kw['match'] + except KeyError: + match = self.match + try: + apply(TestCmd.run, [self], kw) + except: + print "STDOUT ============" + print self.stdout() + print "STDERR ============" + print self.stderr() + raise + if _failed(self, status): expect = '' if status != 0: expect = " (expected %s)" % str(status) print "%s returned %s%s" % (self.program, str(_status(self)), expect) print "STDOUT ============" print self.stdout() - print "STDERR ============" - print self.stderr() - raise TestFailed - if not stdout is None and not self.match(self.stdout(), stdout): + print "STDERR ============" + print self.stderr() + raise TestFailed + if not stdout is None and not match(self.stdout(), stdout): print "Expected STDOUT ==========" print stdout print "Actual STDOUT ============" @@ -298,11 +304,11 @@ class TestCommon(TestCmd): print "STDERR ===================" print stderr raise TestFailed - if not stderr is None and not self.match(self.stderr(), stderr): + if not stderr is None and not match(self.stderr(), stderr): print "STDOUT ===================" print self.stdout() - print "Expected STDERR ==========" - print stderr - print "Actual STDERR ============" - print self.stderr() - raise TestFailed + print "Expected STDERR ==========" + print stderr + print "Actual STDERR ============" + print self.stderr() + raise TestFailed diff --git a/etc/TestSCons.py b/etc/TestSCons.py index 737f8a2..202f5d5 100644 --- a/etc/TestSCons.py +++ b/etc/TestSCons.py @@ -188,6 +188,7 @@ class TestSCons(TestCommon): arguments = options + " " + arguments kw['arguments'] = arguments kw['stdout'] = self.wrap_stdout(read_str = read_str, build_str = s) + kw['match'] = self.match_exact apply(self.run, [], kw) def not_up_to_date(self, options = None, arguments = None, **kw): @@ -204,10 +205,8 @@ class TestSCons(TestCommon): kw['stdout'] = self.wrap_stdout(build_str="("+s+"[^\n]*\n)*") kw['stdout'] = string.replace(kw['stdout'],'\n','\\n') kw['stdout'] = string.replace(kw['stdout'],'.','\\.') - old_match_func = self.match_func - self.match_func = match_re_dotall + kw['match'] = self.match_re_dotall apply(self.run, [], kw) - self.match_func = old_match_func # In some environments, $AR will generate a warning message to stderr # if the library doesn't previously exist and is being created. One diff --git a/test/AR.py b/test/AR.py index f27aeb0..81a57b5 100644 --- a/test/AR.py +++ b/test/AR.py @@ -32,7 +32,7 @@ import TestSCons python = TestSCons.python _exe = TestSCons._exe -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() test.write("wrapper.py", """import os @@ -82,11 +82,15 @@ main(int argc, char *argv[]) """) -test.run(arguments = 'f' + _exe, stderr=TestSCons.noisy_ar) +test.run(arguments = 'f' + _exe, + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.fail_test(os.path.exists(test.workpath('wrapper.out'))) -test.run(arguments = 'b' + _exe, stderr=TestSCons.noisy_ar) +test.run(arguments = 'b' + _exe, + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.fail_test(test.read('wrapper.out') != "wrapper.py\n") diff --git a/test/ARFLAGS.py b/test/ARFLAGS.py index 15ce994..9a7e274 100644 --- a/test/ARFLAGS.py +++ b/test/ARFLAGS.py @@ -32,7 +32,7 @@ import TestSCons python = TestSCons.python _exe = TestSCons._exe -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() test.write("wrapper.py", """import os @@ -82,11 +82,15 @@ main(int argc, char *argv[]) """) -test.run(arguments = 'f' + _exe, stderr=TestSCons.noisy_ar) +test.run(arguments = 'f' + _exe, + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.fail_test(os.path.exists(test.workpath('wrapper.out'))) -test.run(arguments = 'b' + _exe, stderr=TestSCons.noisy_ar) +test.run(arguments = 'b' + _exe, + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.fail_test(test.read('wrapper.out') != "wrapper.py\n") diff --git a/test/CPPPATH.py b/test/CPPPATH.py index d3185c0..cb6969e 100644 --- a/test/CPPPATH.py +++ b/test/CPPPATH.py @@ -36,7 +36,7 @@ variant_prog = os.path.join('variant', 'prog' + _exe) args = prog + ' ' + subdir_prog + ' ' + variant_prog -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() test.subdir('include', 'subdir', ['subdir', 'include'], 'inc2') @@ -203,6 +203,8 @@ env.Library('foo', source = 'empty.c') test.write('empty.c', """ """) -test.run(arguments = '.', stderr=TestSCons.noisy_ar) +test.run(arguments = '.', + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.pass_test() diff --git a/test/HeaderGen.py b/test/HeaderGen.py index 44dd3ce..3cdd207 100644 --- a/test/HeaderGen.py +++ b/test/HeaderGen.py @@ -31,7 +31,7 @@ and that generated header files don't cause circular dependencies. import TestSCons -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() test.write('SConstruct', """\ def writeFile(target, contents): @@ -51,7 +51,8 @@ env.Command('gen.cpp', [], lambda env,target,source: writeFile(target, '#include "gen.h"\\n')) """) -test.run(stderr=TestSCons.noisy_ar) +test.run(stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.up_to_date(arguments = '.') diff --git a/test/HeaderInstall.py b/test/HeaderInstall.py index ae4213f..84a6a4a 100644 --- a/test/HeaderInstall.py +++ b/test/HeaderInstall.py @@ -31,7 +31,7 @@ import os.path import TestSCons -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() test.subdir('work1', ['work1', 'dist']) @@ -64,7 +64,9 @@ test.write(['work1', 'dist', 'h3.h'], """\ int foo = 3; """) -test.run(chdir = 'work1', arguments = ".", stderr=TestSCons.noisy_ar) +test.run(chdir='work1', arguments=".", + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.up_to_date(chdir = 'work1', arguments = ".") diff --git a/test/LIBPATH.py b/test/LIBPATH.py index 9f5bbfd..b9318a0 100644 --- a/test/LIBPATH.py +++ b/test/LIBPATH.py @@ -33,7 +33,7 @@ _exe = TestSCons._exe _dll = TestSCons._dll dll_ = TestSCons.dll_ -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() test.subdir('lib1', 'lib2') @@ -86,7 +86,9 @@ main(int argc, char *argv[]) } """) -test.run(arguments = '.', stderr=TestSCons.noisy_ar) +test.run(arguments = '.', + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.run(program = prog1, stdout = "f1.c\nprog.c\n") @@ -107,7 +109,9 @@ f1(void) } """) -test.run(arguments = '.', stderr=TestSCons.noisy_ar) +test.run(arguments = '.', + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.run(program = prog1, stdout = "f1.c 1\nprog.c\n") test.fail_test(oldtime2 == os.path.getmtime(prog2)) @@ -138,7 +142,9 @@ f1(void) } """) -test.run(arguments = '.', stderr=TestSCons.noisy_ar) +test.run(arguments = '.', + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.run(program = prog1, stdout = "f1.c 2\nprog.c\n") @@ -154,6 +160,8 @@ env = Environment(LIBPATH = '') env.Library('foo', source = 'empty.c') """) -test.run(arguments = '.', stderr=TestSCons.noisy_ar) +test.run(arguments = '.', + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.pass_test() diff --git a/test/LIBPREFIXES.py b/test/LIBPREFIXES.py index 7abf0d4..5ca427d 100644 --- a/test/LIBPREFIXES.py +++ b/test/LIBPREFIXES.py @@ -33,7 +33,7 @@ if sys.platform == 'win32': else: _lib = '.a' -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() test.write('SConstruct', """ env = Environment(LIBPREFIX = 'xxx-', @@ -62,7 +62,9 @@ main(int argc, char *argv[]) } """) -test.run(arguments = '.', stderr=TestSCons.noisy_ar) +test.run(arguments = '.', + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.fail_test(not os.path.exists(test.workpath('xxx-foo' + _lib))) diff --git a/test/LIBS.py b/test/LIBS.py index 07f1746..cc31cad 100644 --- a/test/LIBS.py +++ b/test/LIBS.py @@ -34,7 +34,7 @@ else: _exe = '' bar_lib = 'libbar.a' -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() test.subdir('sub1', 'sub2') @@ -148,7 +148,9 @@ SConscript('sub2/SConscript', 'env') # on IRIX, ld32 prints out a warning saying that libbaz.a isn't used sw = 'ld32: WARNING 84 : ./libbaz.a is not used for resolving any symbol.\n' -test.run(arguments = '.', stderr='(%s|%s'%(sw, TestSCons.noisy_ar[1:])) +test.run(arguments = '.', + stderr='(%s|%s'%(sw, TestSCons.noisy_ar[1:]), + match=TestSCons.match_re_dotall) #test.fail_test(not test.stderr() in ['', sw]) test.run(program=foo1_exe, stdout='sub1/bar.c\nsub1/baz.c\n') @@ -174,7 +176,9 @@ void baz() } """) -test.run(arguments = '.', stderr='(%s|%s'%(sw, TestSCons.noisy_ar[1:])) +test.run(arguments = '.', + stderr='(%s|%s'%(sw, TestSCons.noisy_ar[1:]), + match=TestSCons.match_re_dotall) #test.fail_test(not test.stderr() in ['', sw, TestSCons.noisy_ar]) test.run(program=foo1_exe, stdout='sub1/bar.c\nsub1/baz.c 2\n') @@ -251,7 +255,9 @@ int DisplayMessage2 (void) } """) -test.run(arguments = '.', stderr=TestSCons.noisy_ar) +test.run(arguments = '.', + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.run(program=blender_exe, stdout='src/component1/message.c\nsrc/component2/hello.c\n') diff --git a/test/LIBSUFFIXES.py b/test/LIBSUFFIXES.py index 4e0073e..e61096a 100644 --- a/test/LIBSUFFIXES.py +++ b/test/LIBSUFFIXES.py @@ -33,7 +33,7 @@ if sys.platform == 'win32': else: lib_ = 'lib' -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() test.write('SConstruct', """ env = Environment(LIBSUFFIX = '.xxx', @@ -62,7 +62,9 @@ main(int argc, char *argv[]) } """) -test.run(arguments = '.', stderr=TestSCons.noisy_ar) +test.run(arguments = '.', + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.fail_test(not os.path.exists(test.workpath(lib_ + 'foo.xxx'))) diff --git a/test/Library.py b/test/Library.py index 2b0810f..f089e0c 100644 --- a/test/Library.py +++ b/test/Library.py @@ -26,7 +26,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() test.write('SConstruct', """ env = Environment(LIBS = [ 'foo1', 'libfoo2' ], @@ -121,7 +121,9 @@ main(int argc, char *argv[]) } """) -test.run(arguments = '.', stderr=TestSCons.noisy_ar) +test.run(arguments = '.', + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.run(program = test.workpath('prog'), stdout = "f1.c\nf2a.c\nf2b.c\nf2c.c\nf3a.c\nf3b.c\nf3c.cpp\nprog.c\n") @@ -150,7 +152,9 @@ int main() { } """) -test.run(stderr=TestSCons.noisy_ar) +test.run(stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) + test.run(program = test.workpath('uses-nrd'), stdout = "nrd\n") diff --git a/test/QT.py b/test/QT.py index c5f32fb..4879432 100644 --- a/test/QT.py +++ b/test/QT.py @@ -43,7 +43,7 @@ dll_ = TestSCons.dll_ _dll = TestSCons._dll _shobj = TestSCons._shobj -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() test.subdir( 'qt', ['qt', 'bin'], ['qt', 'include'], ['qt', 'lib'] ) @@ -127,7 +127,8 @@ env.StaticLibrary( 'myqt', 'my_qobject.cpp' ) """) test.run(chdir=test.workpath('qt','lib'), arguments = '.', - stderr=TestSCons.noisy_ar) + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) QT = test.workpath('qt') QT_LIB = 'myqt' @@ -311,7 +312,9 @@ void useit() { } """) -test.run(chdir='work3', arguments = lib_aaa, stderr=TestSCons.noisy_ar) +test.run(chdir='work3', arguments = lib_aaa, + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.up_to_date(chdir='work3', options = '-n', arguments = lib_aaa) test.write(['work3', 'aaa.cpp'], r""" #include "my_qobject.h" @@ -324,7 +327,8 @@ test.not_up_to_date(chdir='work3', options = '-n', arguments = moc) test.run(chdir='work3', arguments = "build_dir=1 " + test.workpath('work3', 'build', lib_aaa), - stderr=TestSCons.noisy_ar ) + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.run(chdir='work3', arguments = "build_dir=1 chdir=1 " + test.workpath('work3', 'build', lib_aaa) ) diff --git a/test/QTFLAGS.py b/test/QTFLAGS.py index 3563d37..a503fad 100644 --- a/test/QTFLAGS.py +++ b/test/QTFLAGS.py @@ -34,7 +34,7 @@ import os.path python = TestSCons.python _exe = TestSCons._exe -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() test.subdir( 'qt', ['qt', 'bin'], ['qt', 'include'], ['qt', 'lib'] ) @@ -117,7 +117,8 @@ env.StaticLibrary( 'myqt', 'my_qobject.cpp' ) """) test.run(chdir=test.workpath('qt','lib'), arguments = '.', - stderr=TestSCons.noisy_ar) + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) QT = test.workpath('qt') QT_LIB = 'myqt' diff --git a/test/RANLIB.py b/test/RANLIB.py index 5de4a09..cf4ae78 100644 --- a/test/RANLIB.py +++ b/test/RANLIB.py @@ -34,7 +34,7 @@ python = TestSCons.python _exe = TestSCons._exe -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() ranlib = test.detect('RANLIB', 'ranlib') @@ -89,11 +89,15 @@ main(int argc, char *argv[]) """) -test.run(arguments = 'f' + _exe, stderr=TestSCons.noisy_ar) +test.run(arguments = 'f' + _exe, + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.fail_test(os.path.exists(test.workpath('wrapper.out'))) -test.run(arguments = 'b' + _exe, stderr=TestSCons.noisy_ar) +test.run(arguments = 'b' + _exe, + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.fail_test(test.read('wrapper.out') != "wrapper.py\n") diff --git a/test/RANLIBFLAGS.py b/test/RANLIBFLAGS.py index 64c6847..d6c25a8 100644 --- a/test/RANLIBFLAGS.py +++ b/test/RANLIBFLAGS.py @@ -32,7 +32,7 @@ import TestSCons python = TestSCons.python _exe = TestSCons._exe -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() ranlib = test.detect('RANLIB', 'ranlib') @@ -86,11 +86,15 @@ main(int argc, char *argv[]) """) -test.run(arguments = 'f' + _exe, stderr=TestSCons.noisy_ar) +test.run(arguments = 'f' + _exe, + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.fail_test(os.path.exists(test.workpath('wrapper.out'))) -test.run(arguments = 'b' + _exe, stderr=TestSCons.noisy_ar) +test.run(arguments = 'b' + _exe, + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.fail_test(test.read('wrapper.out') != "wrapper.py\n") diff --git a/test/Repository/StaticLibrary.py b/test/Repository/StaticLibrary.py index 2dd8f88..f104448 100644 --- a/test/Repository/StaticLibrary.py +++ b/test/Repository/StaticLibrary.py @@ -37,7 +37,7 @@ else: -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() # test.subdir('repository', 'work1', 'work2', 'work3') @@ -101,7 +101,8 @@ test.writable('repository', 0) # test.run(chdir = 'work1', options = opts, arguments = ".", - stderr=TestSCons.noisy_ar) + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.run(program = work1_foo, stdout = """repository/aaa.c @@ -125,7 +126,8 @@ bbb(void) """) test.run(chdir = 'work1', options = opts, arguments = ".", - stderr=TestSCons.noisy_ar) + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.run(program = work1_foo, stdout = """repository/aaa.c @@ -144,7 +146,8 @@ test.up_to_date(chdir = 'work1', options = opts, arguments = ".") test.writable('repository', 1) test.run(chdir = 'repository', options = opts, arguments = ".", - stderr=TestSCons.noisy_ar) + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.run(program = repository_foo, stdout = """repository/aaa.c @@ -173,7 +176,8 @@ bbb(void) """) test.run(chdir = 'work2', options = opts, arguments = ".", - stderr=TestSCons.noisy_ar) + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.run(program = work2_foo, stdout = """repository/aaa.c diff --git a/test/SharedLibrary.py b/test/SharedLibrary.py index d4eb730..185cf9f 100644 --- a/test/SharedLibrary.py +++ b/test/SharedLibrary.py @@ -31,7 +31,7 @@ import sys import TestCmd import TestSCons -test = TestSCons.TestSCons(match=TestCmd.match_re_dotall) +test = TestSCons.TestSCons() test.write('SConstruct', """ import sys @@ -191,7 +191,9 @@ main(int argc, char *argv[]) } """) -test.run(arguments = '.', stderr=TestSCons.noisy_ar) +test.run(arguments = '.', + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) if os.name == 'posix': os.environ['LD_LIBRARY_PATH'] = '.' @@ -206,14 +208,18 @@ if sys.platform == 'win32' or string.find(sys.platform, 'irix') != -1: else: test.run(arguments = '-f SConstructFoo', status=2, stderr='''\ scons: \*\*\* Source file: foo\..* is static and is not compatible with shared target: .* -''') +''', + match=TestSCons.match_re_dotall) # Run it again to make sure that we still get the error # even though the static objects already exist. test.run(arguments = '-f SConstructFoo', status=2, stderr='''\ scons: \*\*\* Source file: foo\..* is static and is not compatible with shared target: .* -''') +''', + match=TestSCons.match_re_dotall) -test.run(arguments = '-f SConstructFoo2', stderr=TestSCons.noisy_ar) +test.run(arguments = '-f SConstructFoo2', + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) if sys.platform == 'win32': # Make sure we don't insert a .def source file (when diff --git a/test/long-lines.py b/test/long-lines.py index 5216429..a883e37 100644 --- a/test/long-lines.py +++ b/test/long-lines.py @@ -30,7 +30,7 @@ import string import sys import TestSCons -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() if sys.platform == 'win32': lib_static_lib = 'static.lib' @@ -103,7 +103,9 @@ main(int argc, char *argv[]) """) -test.run(arguments = '.', stderr=TestSCons.noisy_ar) +test.run(arguments = '.', + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) test.up_to_date(arguments = '.') diff --git a/test/scan-once.py b/test/scan-once.py index 57a8d36..0d1dd2a 100644 --- a/test/scan-once.py +++ b/test/scan-once.py @@ -43,7 +43,7 @@ import sys import TestCmd import TestSCons -test = TestSCons.TestSCons(match=TestSCons.match_re_dotall) +test = TestSCons.TestSCons() test.subdir('simple', 'SLF', @@ -474,7 +474,9 @@ XScanner: node = file3.x create file4.x from file3.x """)) -test.run(arguments = 'SLF', stderr=TestSCons.noisy_ar) +test.run(arguments = 'SLF', + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) # XXX Note that the generated .h files still get scanned twice, # once before they're generated and once after. That's the -- cgit v0.12