diff options
author | Steven Knight <knight@baldmt.com> | 2005-08-17 19:00:39 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-08-17 19:00:39 (GMT) |
commit | d8075b1a39a6d29bf2724e02a7b27dc35f794b70 (patch) | |
tree | db3f38fb056dd425a3c21fa50b374724c950c692 /test | |
parent | c5eb97dd2c58dc4b93bbe6682631d57febdd96bc (diff) | |
download | SCons-d8075b1a39a6d29bf2724e02a7b27dc35f794b70.zip SCons-d8075b1a39a6d29bf2724e02a7b27dc35f794b70.tar.gz SCons-d8075b1a39a6d29bf2724e02a7b27dc35f794b70.tar.bz2 |
Update test infrastructure and ae2cvs utility to latest. Fix runtest.py's swallowing of interrupts. Update various tests.
Diffstat (limited to 'test')
-rw-r--r-- | test/Fortran/F90PATH.py | 1 | ||||
-rw-r--r-- | test/Options.py | 18 | ||||
-rw-r--r-- | test/Options/PackageOption.py | 2 | ||||
-rw-r--r-- | test/Options/PathOption.py | 36 | ||||
-rw-r--r-- | test/Perforce/Perforce.py | 30 | ||||
-rw-r--r-- | test/RCS/diskcheck.py | 4 |
6 files changed, 48 insertions, 43 deletions
diff --git a/test/Fortran/F90PATH.py b/test/Fortran/F90PATH.py index 87ddda1..f1fac46 100644 --- a/test/Fortran/F90PATH.py +++ b/test/Fortran/F90PATH.py @@ -26,6 +26,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os import os.path +import string import sys import TestSCons diff --git a/test/Options.py b/test/Options.py index ecd9aa4..bd827d1 100644 --- a/test/Options.py +++ b/test/Options.py @@ -114,19 +114,19 @@ def check(expect): test.run() check(['0', '1', cc, string.strip(ccflags + ' -g'), 'v', 'v']) -test.run(arguments='"RELEASE_BUILD=1"') +test.run(arguments='RELEASE_BUILD=1') check(['1', '1', cc, string.strip(ccflags + ' -O -g'), 'v', 'v']) -test.run(arguments='"RELEASE_BUILD=1" "DEBUG_BUILD=0"') +test.run(arguments='RELEASE_BUILD=1 DEBUG_BUILD=0') check(['1', '0', cc, string.strip(ccflags + ' -O'), 'v', 'v']) -test.run(arguments='"CC=not_a_c_compiler"') +test.run(arguments='CC=not_a_c_compiler') check(['0', '1', 'not_a_c_compiler', string.strip(ccflags + ' -g'), 'v', 'v']) -test.run(arguments='"UNDECLARED=foo"') +test.run(arguments='UNDECLARED=foo') check(['0', '1', cc, string.strip(ccflags + ' -g'), 'v', 'v']) -test.run(arguments='"CCFLAGS=--taco"') +test.run(arguments='CCFLAGS=--taco') check(['0', '1', cc, string.strip(ccflags + ' -g'), 'v', 'v']) test.write('custom.py', """ @@ -137,7 +137,7 @@ RELEASE_BUILD=1 test.run() check(['1', '0', cc, string.strip(ccflags + ' -O'), 'v', 'v']) -test.run(arguments='"DEBUG_BUILD=1"') +test.run(arguments='DEBUG_BUILD=1') check(['1', '1', cc, string.strip(ccflags + ' -O -g'), 'v', 'v']) test.run(arguments='-h', @@ -217,7 +217,7 @@ check(['1','0']) checkSave('options.saved', { 'RELEASE_BUILD':1, 'DEBUG_BUILD':0}) # Override with command line arguments -test.run(arguments='"DEBUG_BUILD=3"') +test.run(arguments='DEBUG_BUILD=3') check(['1','3']) checkSave('options.saved', {'RELEASE_BUILD':1, 'DEBUG_BUILD':3}) @@ -265,12 +265,12 @@ check(['0','1']) checkSave('options.saved', {}) # Now specify one option the same as default and make sure it doesn't write out -test.run(arguments='"DEBUG_BUILD=1"') +test.run(arguments='DEBUG_BUILD=1') check(['0','1']) checkSave('options.saved', {}) # Now specify same option non-default and make sure only it is written out -test.run(arguments='"DEBUG_BUILD=0" "LISTOPTION_TEST=a,b"') +test.run(arguments='DEBUG_BUILD=0 LISTOPTION_TEST=a,b') check(['0','0']) checkSave('options.saved',{'DEBUG_BUILD':0, 'LISTOPTION_TEST':'a,b'}) diff --git a/test/Options/PackageOption.py b/test/Options/PackageOption.py index ca8944d..cc520f7 100644 --- a/test/Options/PackageOption.py +++ b/test/Options/PackageOption.py @@ -62,7 +62,7 @@ test.run() check(['1']) test.run(arguments='x11=no'); check(['0']) test.run(arguments='x11=0'); check(['0']) -test.run(arguments='"x11=%s"' % test.workpath()); check([test.workpath()]) +test.run(arguments=['x11=%s' % test.workpath()]); check([test.workpath()]) test.run(arguments='x11=/non/existing/path/', stderr = """ diff --git a/test/Options/PathOption.py b/test/Options/PathOption.py index 55f95c5..d15f39b 100644 --- a/test/Options/PathOption.py +++ b/test/Options/PathOption.py @@ -74,27 +74,27 @@ check([qtpath, os.path.join('$qtdir', 'lib'), libpath]) qtpath = os.path.join(workpath, 'qt') libpath = os.path.join(qtpath, 'lib') -test.run(arguments='"qtdir=%s"' % qtpath) +test.run(arguments=['qtdir=%s' % qtpath]) check([qtpath, os.path.join('$qtdir', 'lib'), libpath]) qtpath = workpath libpath = os.path.join(qtpath, 'nolib') -test.run(arguments='"qt_libraries=%s"' % libpath) +test.run(arguments=['qt_libraries=%s' % libpath]) check([qtpath, libpath, libpath]) qtpath = os.path.join(workpath, 'qt') libpath = os.path.join(workpath, 'nolib') -test.run(arguments='"qtdir=%s" "qt_libraries=%s"' % (qtpath, libpath)) +test.run(arguments=['qtdir=%s' % qtpath, 'qt_libraries=%s' % libpath]) check([qtpath, libpath, libpath]) qtpath = os.path.join(workpath, 'non', 'existing', 'path') -test.run(arguments='"qtdir=%s"' % qtpath, +test.run(arguments=['qtdir=%s' % qtpath], stderr = """ scons: *** Path for option qtdir does not exist: %s File "SConstruct", line 12, in ? """ % qtpath, status=2) -test.run(arguments='"qt_libraries=%s"' % qtpath, +test.run(arguments=['qt_libraries=%s' % qtpath], stderr = """ scons: *** Path for option qt_libraries does not exist: %s File "SConstruct", line 12, in ? @@ -132,16 +132,16 @@ Default(env.Alias('dummy', None)) test.run() check([default_subdir]) -test.run(arguments='"X=%s"' % existing_file) +test.run(arguments=['X=%s' % existing_file]) check([existing_file]) -test.run(arguments='"X=%s"' % non_existing_file) +test.run(arguments=['X=%s' % non_existing_file]) check([non_existing_file]) -test.run(arguments='"X=%s"' % existing_subdir) +test.run(arguments=['X=%s' % existing_subdir]) check([existing_subdir]) -test.run(arguments='"X=%s"' % non_existing_subdir) +test.run(arguments=['X=%s' % non_existing_subdir]) check([non_existing_subdir]) test.must_not_exist(non_existing_file) @@ -173,17 +173,17 @@ test.write(default_file, "default_file\n") test.run() check([default_file]) -test.run(arguments='"X=%s"' % existing_subdir, +test.run(arguments=['X=%s' % existing_subdir], status=2, stderr=""" scons: *** File path for option X is a directory: %s File "SConstruct", line 6, in ? """ % existing_subdir) -test.run(arguments='"X=%s"' % existing_file) +test.run(arguments=['X=%s' % existing_file]) check([existing_file]) -test.run(arguments='"X=%s"' % non_existing_file, +test.run(arguments=['X=%s' % non_existing_file], status=2, stderr=""" scons: *** File path for option X does not exist: %s @@ -216,17 +216,17 @@ test.subdir(default_subdir) test.run() check([default_subdir]) -test.run(arguments='"X=%s"' % existing_file, +test.run(arguments=['X=%s' % existing_file], status=2, stderr=""" scons: *** Directory path for option X is a file: %s File "SConstruct", line 6, in ? """ % existing_file) -test.run(arguments='"X=%s"' % existing_subdir) +test.run(arguments=['X=%s' % existing_subdir]) check([existing_subdir]) -test.run(arguments='"X=%s"' % non_existing_subdir, +test.run(arguments=['X=%s' % non_existing_subdir], status=2, stderr=""" scons: *** Directory path for option X does not exist: %s @@ -251,17 +251,17 @@ Default(env.Alias('dummy', None)) test.run() check([default_subdir]) -test.run(arguments='"X=%s"' % existing_file, +test.run(arguments=['X=%s' % existing_file], status=2, stderr=""" scons: *** Path for option X is a file, not a directory: %s File "SConstruct", line 6, in ? """ % existing_file) -test.run(arguments='"X=%s"' % existing_subdir) +test.run(arguments=['X=%s' % existing_subdir]) check([existing_subdir]) -test.run(arguments='"X=%s"' % non_existing_subdir) +test.run(arguments=['X=%s' % non_existing_subdir]) check([non_existing_subdir]) test.must_exist(non_existing_subdir) diff --git a/test/Perforce/Perforce.py b/test/Perforce/Perforce.py index 891acc3..5d41f8f 100644 --- a/test/Perforce/Perforce.py +++ b/test/Perforce/Perforce.py @@ -59,7 +59,8 @@ except TestSCons.TestFailed: pass # it's okay if this fails...it will fail if the depot is clear already. # Set up a perforce depot for testing. -test.write("depotspec","""# A Perforce Depot Specification. +depotspec = """\ +# A Perforce Depot Specification. Depot: testme Owner: %s @@ -74,13 +75,14 @@ Type: local Address: subdir Map: testme/... -""" % user) +""" % user -test.run(program=p4, arguments='-p 1666 depot -i < depotspec') +test.run(program=p4, arguments='-p 1666 depot -i', stdin = depotspec) # Now set up 2 clients, one to check in some files, and one to # do the building. -clientspec = """# A Perforce Client Specification. +clientspec = """\ +# A Perforce Client Specification. Client: %s Owner: %s @@ -104,13 +106,11 @@ clientspec1 = clientspec % ("testclient1", user, host, test.workpath('import'), "//testme/foo/...", "testclient1") clientspec2 = clientspec % ("testclient2", user, host, test.workpath('work'), "//testme/...", "testclient2") -test.write("testclient1", clientspec1) -test.write("testclient2", clientspec2) test.subdir('import', ['import', 'sub'], 'work') -test.run(program=p4, arguments = '-p 1666 client -i < testclient1') -test.run(program=p4, arguments = '-p 1666 client -i < testclient2') +test.run(program=p4, arguments = '-p 1666 client -i', stdin=clientspec1) +test.run(program=p4, arguments = '-p 1666 client -i', stdin=clientspec2) test.write(['import', 'aaa.in'], "import/aaa.in\n") test.write(['import', 'bbb.in'], "import/bbb.in\n") @@ -130,11 +130,13 @@ test.write(['import', 'sub', 'fff.in'], "import/sub/fff.in\n") # Perforce uses the PWD environment variable in preference to the actual cwd os.environ["PWD"] = test.workpath('import') -paths = map(os.path.normpath, [ 'sub/ddd.in', 'sub/eee.in', 'sub/fff.in', 'sub/SConscript' ]) -args = '-p 1666 -c testclient1 add -t binary *.in %s' % string.join(paths) +paths = [ 'aaa.in', 'bbb.in', 'ccc.in', + 'sub/ddd.in', 'sub/eee.in', 'sub/fff.in', 'sub/SConscript' ] +paths = map(os.path.normpath, paths) +args = '-p 1666 -c testclient1 add -t binary %s' % string.join(paths) test.run(program=p4, chdir='import', arguments=args) -test.write('changespec', """ +changespec = """ Change: new Client: testclient1 @@ -154,9 +156,11 @@ Files: //testme/foo/sub/ddd.in # add //testme/foo/sub/eee.in # add //testme/foo/sub/fff.in # add -""" % user) +""" % user -test.run(program=p4, arguments='-p 1666 -c testclient1 submit -i < changespec') +test.run(program=p4, + arguments='-p 1666 -c testclient1 submit -i', + stdin=changespec) test.write(['work', 'SConstruct'], """ def cat(env, source, target): diff --git a/test/RCS/diskcheck.py b/test/RCS/diskcheck.py index 4a93edf..8af2545 100644 --- a/test/RCS/diskcheck.py +++ b/test/RCS/diskcheck.py @@ -117,10 +117,10 @@ test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") expect = """\ -scons: warning: Ignoring missing SConscript 'sub/SConscript' +scons: warning: Ignoring missing SConscript '%s' File "SConstruct", line 23, in ? scons: *** Source `aaa.in' not found, needed by target `aaa.out'. Stop. -""" +""" % os.path.join('sub', 'SConscript') test.run(status=2, stderr=expect) |