diff options
author | William Deegan <bill@baddogconsulting.com> | 2020-12-20 23:37:56 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2020-12-20 23:37:56 (GMT) |
commit | 78292be9cbb471101e6ed4ec5f6da0161730c656 (patch) | |
tree | e0ef841cc870866c5af965411b9222c455d8d3e7 /test | |
parent | 2b583646718acda52481b71f15c9a6723fb3eb81 (diff) | |
parent | 97dbf8d22b518a8f67cf670f8e3449990f3f5813 (diff) | |
download | SCons-78292be9cbb471101e6ed4ec5f6da0161730c656.zip SCons-78292be9cbb471101e6ed4ec5f6da0161730c656.tar.gz SCons-78292be9cbb471101e6ed4ec5f6da0161730c656.tar.bz2 |
Merge remote-tracking branch 'upstream/master' into reimplement_soname_soversion
Diffstat (limited to 'test')
187 files changed, 462 insertions, 392 deletions
diff --git a/test/AR/AR.py b/test/AR/AR.py index 552b827..2b92ff4 100644 --- a/test/AR/AR.py +++ b/test/AR/AR.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons diff --git a/test/AR/ARFLAGS.py b/test/AR/ARFLAGS.py index 2aa1a14..21b3793 100644 --- a/test/AR/ARFLAGS.py +++ b/test/AR/ARFLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons diff --git a/test/AS/AS.py b/test/AS/AS.py index 56a1498..0b6611d 100644 --- a/test/AS/AS.py +++ b/test/AS/AS.py @@ -29,8 +29,6 @@ Verify the ability to set the $AS construction variable to a different assembler (a wrapper we create). """ -import os -import sys import TestSCons diff --git a/test/AS/ASFLAGS.py b/test/AS/ASFLAGS.py index 52f44af..4a1c162 100644 --- a/test/AS/ASFLAGS.py +++ b/test/AS/ASFLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import sys import TestSCons diff --git a/test/AS/ASPP.py b/test/AS/ASPP.py index 64e1080..9c8f047 100644 --- a/test/AS/ASPP.py +++ b/test/AS/ASPP.py @@ -24,8 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os -import sys import TestSCons diff --git a/test/AS/ASPPFLAGS.py b/test/AS/ASPPFLAGS.py index 5dd9a38..f7d7c5c 100644 --- a/test/AS/ASPPFLAGS.py +++ b/test/AS/ASPPFLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import sys import TestSCons diff --git a/test/Actions/append.py b/test/Actions/append.py index 0a59c42..b5d4c3a 100644 --- a/test/Actions/append.py +++ b/test/Actions/append.py @@ -30,7 +30,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os import stat -import sys import TestSCons _exe = TestSCons._exe diff --git a/test/Actions/pre-post.py b/test/Actions/pre-post.py index 4d22b07..358aa43 100644 --- a/test/Actions/pre-post.py +++ b/test/Actions/pre-post.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os -import stat import TestSCons diff --git a/test/Builder/errors.py b/test/Builder/errors.py index bd7e100..375e052 100644 --- a/test/Builder/errors.py +++ b/test/Builder/errors.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test the ability to catch Builder creation with poorly specified Actions. """ -import os.path import TestSCons diff --git a/test/CC/CCVERSION.py b/test/CC/CCVERSION.py index 7e829f0..3ee601f 100644 --- a/test/CC/CCVERSION.py +++ b/test/CC/CCVERSION.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import sys import TestSCons diff --git a/test/CC/SHCC.py b/test/CC/SHCC.py index c756219..1c9f68d 100644 --- a/test/CC/SHCC.py +++ b/test/CC/SHCC.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons diff --git a/test/CFILESUFFIX.py b/test/CFILESUFFIX.py index 7af4fa4..0a62307 100644 --- a/test/CFILESUFFIX.py +++ b/test/CFILESUFFIX.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Verify that we can set CFILESUFFIX to arbitrary values. """ -import os import TestSCons diff --git a/test/CXX/CXX.py b/test/CXX/CXX.py index abccf1e..4be4199 100644 --- a/test/CXX/CXX.py +++ b/test/CXX/CXX.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import sys import TestSCons diff --git a/test/CXX/CXXFILESUFFIX.py b/test/CXX/CXXFILESUFFIX.py index 48d727e..0ae5827 100644 --- a/test/CXX/CXXFILESUFFIX.py +++ b/test/CXX/CXXFILESUFFIX.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons diff --git a/test/CacheDir/CacheDir_TryCompile.py b/test/CacheDir/CacheDir_TryCompile.py index bb22835..dbea9be 100644 --- a/test/CacheDir/CacheDir_TryCompile.py +++ b/test/CacheDir/CacheDir_TryCompile.py @@ -32,7 +32,6 @@ could be bytes instead of a string which would fail when combining cache signatu which ended up a mixture of bytes and strings. """ -import os import TestSCons diff --git a/test/CacheDir/NoCache.py b/test/CacheDir/NoCache.py index 8ecfeb3..506a859 100644 --- a/test/CacheDir/NoCache.py +++ b/test/CacheDir/NoCache.py @@ -28,7 +28,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Verify that the NoCache environment method works. """ -import TestSCons, os.path +import TestSCons test = TestSCons.TestSCons() diff --git a/test/CacheDir/multiple-targets.py b/test/CacheDir/multiple-targets.py index 99ab8da..d985ca0 100644 --- a/test/CacheDir/multiple-targets.py +++ b/test/CacheDir/multiple-targets.py @@ -28,8 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test that multiple target files get retrieved from a CacheDir correctly. """ -import os.path -import shutil import TestSCons diff --git a/test/CacheDir/option--cd.py b/test/CacheDir/option--cd.py index 1620858..3ea739c 100644 --- a/test/CacheDir/option--cd.py +++ b/test/CacheDir/option--cd.py @@ -29,8 +29,6 @@ Test the --cache-disable option when retrieving derived files from a CacheDir. """ -import os.path -import shutil import TestSCons diff --git a/test/CacheDir/option--cr.py b/test/CacheDir/option--cr.py index b7696c5..0395876 100644 --- a/test/CacheDir/option--cr.py +++ b/test/CacheDir/option--cr.py @@ -29,8 +29,6 @@ Test the --cache-readonly option when retrieving derived files from a CacheDir. It should retrieve as normal but not update files. """ -import os.path -import shutil import TestSCons diff --git a/test/CacheDir/option--cs.py b/test/CacheDir/option--cs.py index feb89bd..a2b09ed 100644 --- a/test/CacheDir/option--cs.py +++ b/test/CacheDir/option--cs.py @@ -29,8 +29,6 @@ Test printing build actions when using the --cache-show option and retrieving derived files from a CacheDir. """ -import os.path -import shutil import TestSCons diff --git a/test/CacheDir/readonly-cache.py b/test/CacheDir/readonly-cache.py index 63cfd22..4aad0ee 100755 --- a/test/CacheDir/readonly-cache.py +++ b/test/CacheDir/readonly-cache.py @@ -32,7 +32,6 @@ import glob import os import TestSCons import time -from stat import * test = TestSCons.TestSCons() diff --git a/test/CacheDir/scanner-target.py b/test/CacheDir/scanner-target.py index 249e587..202910b 100644 --- a/test/CacheDir/scanner-target.py +++ b/test/CacheDir/scanner-target.py @@ -31,8 +31,6 @@ to push the file to the CacheDir after the build signature had already been cleared (as a sign that the built file should now be rescanned). """ -import os.path -import shutil import TestSCons diff --git a/test/Clean/Option.py b/test/Clean/Option.py index 5795ff2..c63dff7 100644 --- a/test/Clean/Option.py +++ b/test/Clean/Option.py @@ -29,7 +29,6 @@ Verify that {Set,Get}Option('clean') works correctly to control cleaning behavior. """ -import os import TestSCons diff --git a/test/CommandGenerator.py b/test/CommandGenerator.py index b8155e7..5cae4a6 100644 --- a/test/CommandGenerator.py +++ b/test/CommandGenerator.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os.path import TestSCons diff --git a/test/CompilationDatabase/fixture/SConstruct_variant b/test/CompilationDatabase/fixture/SConstruct_variant index f47c732..ea461fb 100644 --- a/test/CompilationDatabase/fixture/SConstruct_variant +++ b/test/CompilationDatabase/fixture/SConstruct_variant @@ -32,6 +32,10 @@ env.CompilationDatabase('compile_commands_over_rel.json', COMPILATIONDB_USE_ABSP env.CompilationDatabase('compile_commands_over_abs_1.json', COMPILATIONDB_USE_ABSPATH=1) env.CompilationDatabase('compile_commands_over_abs_0.json', COMPILATIONDB_USE_ABSPATH=0) +# Try filter for build and build2 output +env.CompilationDatabase('compile_commands_filter_build.json', COMPILATIONDB_PATH_FILTER='build/*') +env.CompilationDatabase('compile_commands_filter_build2.json', COMPILATIONDB_PATH_FILTER='build2/*') + env.VariantDir('build','src') env.Program('build/main', 'build/test_main.c') diff --git a/test/CompilationDatabase/variant_dir.py b/test/CompilationDatabase/variant_dir.py index a36e516..6a2675b 100644 --- a/test/CompilationDatabase/variant_dir.py +++ b/test/CompilationDatabase/variant_dir.py @@ -56,6 +56,14 @@ abs_files = [ 'compile_commands_over_abs_1.json', ] +filter_build_files = [ + 'compile_commands_filter_build.json', +] + +filter_build2_files = [ + 'compile_commands_filter_build2.json', +] + example_rel_file = """[ { "command": "%(exe)s mygcc.py cc -o %(output_file)s -c %(variant_src_file)s", @@ -115,4 +123,45 @@ for f in abs_files: test.must_exist(f) test.must_match(f, example_abs_file, mode='r') +example_filter_build_file = """[ + { + "command": "%(exe)s mygcc.py cc -o %(output_file)s -c %(variant_src_file)s", + "directory": "%(workdir)s", + "file": "%(src_file)s", + "output": "%(output_file)s" + } +]""" % {'exe': sys.executable, + 'workdir': test.workdir, + 'src_file': os.path.join('src', 'test_main.c'), + 'output_file': os.path.join('build', 'test_main.o'), + 'variant_src_file': os.path.join('build', 'test_main.c') + } + +if sys.platform == 'win32': + example_filter_build_file = example_filter_build_file.replace('\\', '\\\\') + +for f in filter_build_files: + test.must_exist(f) + test.must_match(f, example_filter_build_file, mode='r') + +example_filter_build2_file = """[ + { + "command": "%(exe)s mygcc.py cc -o %(output2_file)s -c %(src_file)s", + "directory": "%(workdir)s", + "file": "%(src_file)s", + "output": "%(output2_file)s" + } +]""" % {'exe': sys.executable, + 'workdir': test.workdir, + 'src_file': os.path.join('src', 'test_main.c'), + 'output2_file': os.path.join('build2', 'test_main.o'), + } + +if sys.platform == 'win32': + example_filter_build2_file = example_filter_build2_file.replace('\\', '\\\\') + +for f in filter_build2_files: + test.must_exist(f) + test.must_match(f, example_filter_build2_file, mode='r') + test.pass_test() diff --git a/test/Configure/VariantDir2.py b/test/Configure/VariantDir2.py index ffe6525..98f4ccd 100644 --- a/test/Configure/VariantDir2.py +++ b/test/Configure/VariantDir2.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Verify that Configure contexts work with SConstruct/SConscript structure """ -import os import TestSCons diff --git a/test/Configure/config-h.py b/test/Configure/config-h.py index 0331b24..f617d92 100644 --- a/test/Configure/config-h.py +++ b/test/Configure/config-h.py @@ -27,7 +27,6 @@ Verify creation of a config.h file from a Configure context. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import re import TestSCons diff --git a/test/Copy-Symlinks.py b/test/Copy-Symlinks.py index eab38e3..d2f5f4b 100644 --- a/test/Copy-Symlinks.py +++ b/test/Copy-Symlinks.py @@ -29,8 +29,6 @@ Verify that the Copy() Action symlink soft-copy support works. """ import os -import stat -import sys import TestSCons import SCons.Defaults diff --git a/test/D/Issues/2994/Common/D_changed_DFLAGS_not_rebuilding.py b/test/D/Issues/2994/Common/D_changed_DFLAGS_not_rebuilding.py index b58227d..66d84c8 100644 --- a/test/D/Issues/2994/Common/D_changed_DFLAGS_not_rebuilding.py +++ b/test/D/Issues/2994/Common/D_changed_DFLAGS_not_rebuilding.py @@ -30,7 +30,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons -from os.path import abspath, dirname, join +from os.path import abspath, dirname import sys sys.path.insert(1, abspath(dirname(__file__) + '/../../../Support')) diff --git a/test/D/MixedDAndC/Common/common.py b/test/D/MixedDAndC/Common/common.py index 852e2e2..2de1304 100644 --- a/test/D/MixedDAndC/Common/common.py +++ b/test/D/MixedDAndC/Common/common.py @@ -30,7 +30,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons from os.path import abspath, dirname -from platform import architecture import sys sys.path.insert(1, abspath(dirname(__file__) + '/../../Support')) diff --git a/test/DVIPDF/DVIPDFFLAGS.py b/test/DVIPDF/DVIPDFFLAGS.py index 9ecb736..9900cf7 100644 --- a/test/DVIPDF/DVIPDFFLAGS.py +++ b/test/DVIPDF/DVIPDFFLAGS.py @@ -122,7 +122,7 @@ subprocess.run(cmd, shell=True) test.write('SConstruct', """ import os ENV = {'PATH' : os.environ['PATH']} -foo = Environment(DVIPDFFLAGS = '-N', ENV = ENV) +foo = Environment(DVIPDFFLAGS = '-R2', ENV = ENV) dvipdf = foo.Dictionary('DVIPDF') bar = Environment(DVIPDF = r'%(_python_)s wrapper.py ' + dvipdf, ENV = ENV) foo.PDF(target = 'foo.pdf', diff --git a/test/Decider/MD5-winonly-firstbuild.py b/test/Decider/MD5-winonly-firstbuild.py index 87f7999..beabce3 100644 --- a/test/Decider/MD5-winonly-firstbuild.py +++ b/test/Decider/MD5-winonly-firstbuild.py @@ -29,8 +29,6 @@ Test but which only shows on windows when one generated file depends on another In this case flex and yacc are an example. """ -import os -import stat import TestSCons from TestCmd import IS_WINDOWS diff --git a/test/Dir/PyPackageDir/PyPackageDir.py b/test/Dir/PyPackageDir/PyPackageDir.py index b215c7b..beb256b 100644 --- a/test/Dir/PyPackageDir/PyPackageDir.py +++ b/test/Dir/PyPackageDir/PyPackageDir.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import os.path
import TestSCons
test = TestSCons.TestSCons()
diff --git a/test/Docbook/basedir/htmlchunked/htmlchunked_cmd.py b/test/Docbook/basedir/htmlchunked/htmlchunked_cmd.py index 3ad6369..e603232 100644 --- a/test/Docbook/basedir/htmlchunked/htmlchunked_cmd.py +++ b/test/Docbook/basedir/htmlchunked/htmlchunked_cmd.py @@ -28,7 +28,6 @@ the xsltproc executable, if it exists. """ import os -import sys import TestSCons test = TestSCons.TestSCons() diff --git a/test/Docbook/basedir/htmlhelp/htmlhelp_cmd.py b/test/Docbook/basedir/htmlhelp/htmlhelp_cmd.py index 2b004c6..ebefb92 100644 --- a/test/Docbook/basedir/htmlhelp/htmlhelp_cmd.py +++ b/test/Docbook/basedir/htmlhelp/htmlhelp_cmd.py @@ -28,7 +28,6 @@ the xsltproc executable, if it exists. """ import os -import sys import TestSCons test = TestSCons.TestSCons() diff --git a/test/Docbook/basedir/slideshtml/slideshtml_cmd.py b/test/Docbook/basedir/slideshtml/slideshtml_cmd.py index 901d94e..b0f1f25 100644 --- a/test/Docbook/basedir/slideshtml/slideshtml_cmd.py +++ b/test/Docbook/basedir/slideshtml/slideshtml_cmd.py @@ -28,7 +28,6 @@ the xsltproc executable, if it exists. """ import os -import sys import TestSCons test = TestSCons.TestSCons() diff --git a/test/Docbook/basic/htmlchunked/htmlchunked_cmd.py b/test/Docbook/basic/htmlchunked/htmlchunked_cmd.py index 6b79102..9715c0f 100644 --- a/test/Docbook/basic/htmlchunked/htmlchunked_cmd.py +++ b/test/Docbook/basic/htmlchunked/htmlchunked_cmd.py @@ -27,7 +27,6 @@ Test the chunked HTML builder while using the xsltproc executable, if it exists. """ -import os import TestSCons test = TestSCons.TestSCons() diff --git a/test/Docbook/basic/slideshtml/slideshtml_cmd.py b/test/Docbook/basic/slideshtml/slideshtml_cmd.py index 7ebc8d4..9c8097b 100644 --- a/test/Docbook/basic/slideshtml/slideshtml_cmd.py +++ b/test/Docbook/basic/slideshtml/slideshtml_cmd.py @@ -28,7 +28,6 @@ the xsltproc executable, if it exists. """ import os -import sys import TestSCons test = TestSCons.TestSCons() diff --git a/test/Errors/execute-a-directory.py b/test/Errors/execute-a-directory.py index 8b6d13b..ff50620 100644 --- a/test/Errors/execute-a-directory.py +++ b/test/Errors/execute-a-directory.py @@ -25,7 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os -import sys import TestSCons diff --git a/test/Errors/non-executable-file.py b/test/Errors/non-executable-file.py index 64c75c6..98d4721 100644 --- a/test/Errors/non-executable-file.py +++ b/test/Errors/non-executable-file.py @@ -25,7 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os -import sys import TestSCons diff --git a/test/Fortran/F03.py b/test/Fortran/F03.py index 989d878..ce56cc3 100644 --- a/test/Fortran/F03.py +++ b/test/Fortran/F03.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F03FILESUFFIXES.py b/test/Fortran/F03FILESUFFIXES.py index 5620a2d..49c9c66 100644 --- a/test/Fortran/F03FILESUFFIXES.py +++ b/test/Fortran/F03FILESUFFIXES.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F03FILESUFFIXES2.py b/test/Fortran/F03FILESUFFIXES2.py index 6073aab..6512341 100644 --- a/test/Fortran/F03FILESUFFIXES2.py +++ b/test/Fortran/F03FILESUFFIXES2.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F03FLAGS.py b/test/Fortran/F03FLAGS.py index 54b8083..63d1fcb 100644 --- a/test/Fortran/F03FLAGS.py +++ b/test/Fortran/F03FLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F08.py b/test/Fortran/F08.py index f60509c..eb381ee 100644 --- a/test/Fortran/F08.py +++ b/test/Fortran/F08.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F08FILESUFFIXES.py b/test/Fortran/F08FILESUFFIXES.py index 989d685..392ff64 100644 --- a/test/Fortran/F08FILESUFFIXES.py +++ b/test/Fortran/F08FILESUFFIXES.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F08FILESUFFIXES2.py b/test/Fortran/F08FILESUFFIXES2.py index 0d99225..babb8e6 100644 --- a/test/Fortran/F08FILESUFFIXES2.py +++ b/test/Fortran/F08FILESUFFIXES2.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F08FLAGS.py b/test/Fortran/F08FLAGS.py index 015fb0b..81ae441 100644 --- a/test/Fortran/F08FLAGS.py +++ b/test/Fortran/F08FLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F77.py b/test/Fortran/F77.py index ed5d33f..c43fb3e 100644 --- a/test/Fortran/F77.py +++ b/test/Fortran/F77.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F77FILESUFFIXES.py b/test/Fortran/F77FILESUFFIXES.py index c289e10..8c7aec8 100644 --- a/test/Fortran/F77FILESUFFIXES.py +++ b/test/Fortran/F77FILESUFFIXES.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F77FILESUFFIXES2.py b/test/Fortran/F77FILESUFFIXES2.py index 1f26012..86cd931 100644 --- a/test/Fortran/F77FILESUFFIXES2.py +++ b/test/Fortran/F77FILESUFFIXES2.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F77FLAGS.py b/test/Fortran/F77FLAGS.py index caf291d..01bf33b 100644 --- a/test/Fortran/F77FLAGS.py +++ b/test/Fortran/F77FLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F90.py b/test/Fortran/F90.py index d76af07..404f883 100644 --- a/test/Fortran/F90.py +++ b/test/Fortran/F90.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F90FILESUFFIXES.py b/test/Fortran/F90FILESUFFIXES.py index d91c4c8..e376f3c 100644 --- a/test/Fortran/F90FILESUFFIXES.py +++ b/test/Fortran/F90FILESUFFIXES.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F90FILESUFFIXES2.py b/test/Fortran/F90FILESUFFIXES2.py index 3efc52c..e01425f 100644 --- a/test/Fortran/F90FILESUFFIXES2.py +++ b/test/Fortran/F90FILESUFFIXES2.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F90FLAGS.py b/test/Fortran/F90FLAGS.py index f748e5d..5a469e9 100644 --- a/test/Fortran/F90FLAGS.py +++ b/test/Fortran/F90FLAGS.py @@ -25,7 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F95.py b/test/Fortran/F95.py index 8e6d0b9..7b4c97a 100644 --- a/test/Fortran/F95.py +++ b/test/Fortran/F95.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F95FILESUFFIXES.py b/test/Fortran/F95FILESUFFIXES.py index 427c881..710f838 100644 --- a/test/Fortran/F95FILESUFFIXES.py +++ b/test/Fortran/F95FILESUFFIXES.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F95FILESUFFIXES2.py b/test/Fortran/F95FILESUFFIXES2.py index a0ee1cf..2f8bb17 100644 --- a/test/Fortran/F95FILESUFFIXES2.py +++ b/test/Fortran/F95FILESUFFIXES2.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/F95FLAGS.py b/test/Fortran/F95FLAGS.py index 203aee1..2853cc9 100644 --- a/test/Fortran/F95FLAGS.py +++ b/test/Fortran/F95FLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/FORTRAN.py b/test/Fortran/FORTRAN.py index 721d48f..62d7065 100644 --- a/test/Fortran/FORTRAN.py +++ b/test/Fortran/FORTRAN.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/FORTRANFILESUFFIXES.py b/test/Fortran/FORTRANFILESUFFIXES.py index ec659a1..e58b971 100644 --- a/test/Fortran/FORTRANFILESUFFIXES.py +++ b/test/Fortran/FORTRANFILESUFFIXES.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/FORTRANFILESUFFIXES2.py b/test/Fortran/FORTRANFILESUFFIXES2.py index 6dda07d..a57dd2a 100644 --- a/test/Fortran/FORTRANFILESUFFIXES2.py +++ b/test/Fortran/FORTRANFILESUFFIXES2.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/FORTRANFLAGS.py b/test/Fortran/FORTRANFLAGS.py index 316f67c..218c95f 100644 --- a/test/Fortran/FORTRANFLAGS.py +++ b/test/Fortran/FORTRANFLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/FORTRANPPFILESUFFIXES.py b/test/Fortran/FORTRANPPFILESUFFIXES.py index 6b3b3d8..2c10b10 100644 --- a/test/Fortran/FORTRANPPFILESUFFIXES.py +++ b/test/Fortran/FORTRANPPFILESUFFIXES.py @@ -25,9 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os -import string -import sys import TestSCons diff --git a/test/Fortran/SHF03.py b/test/Fortran/SHF03.py index 0ab2cc9..1c3fb1b 100644 --- a/test/Fortran/SHF03.py +++ b/test/Fortran/SHF03.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/SHF08.py b/test/Fortran/SHF08.py index 8147b79..49a4c47 100644 --- a/test/Fortran/SHF08.py +++ b/test/Fortran/SHF08.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/SHF77.py b/test/Fortran/SHF77.py index 1b0e180..4358533 100644 --- a/test/Fortran/SHF77.py +++ b/test/Fortran/SHF77.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/SHF77FLAGS.py b/test/Fortran/SHF77FLAGS.py index 19d40b6..3a7e6b2 100644 --- a/test/Fortran/SHF77FLAGS.py +++ b/test/Fortran/SHF77FLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/SHF90.py b/test/Fortran/SHF90.py index 1524bf3..057f98c 100644 --- a/test/Fortran/SHF90.py +++ b/test/Fortran/SHF90.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/SHF90FLAGS.py b/test/Fortran/SHF90FLAGS.py index 947bf4b..900acbc 100644 --- a/test/Fortran/SHF90FLAGS.py +++ b/test/Fortran/SHF90FLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/SHF95.py b/test/Fortran/SHF95.py index 27d9a76..3b1f4fb 100644 --- a/test/Fortran/SHF95.py +++ b/test/Fortran/SHF95.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/SHF95FLAGS.py b/test/Fortran/SHF95FLAGS.py index d1fbe3f..56744d6 100644 --- a/test/Fortran/SHF95FLAGS.py +++ b/test/Fortran/SHF95FLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/SHFORTRAN.py b/test/Fortran/SHFORTRAN.py index f4850d7..a8806e7 100644 --- a/test/Fortran/SHFORTRAN.py +++ b/test/Fortran/SHFORTRAN.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Fortran/SHFORTRANFLAGS.py b/test/Fortran/SHFORTRANFLAGS.py index ac2abd8..6a4692b 100644 --- a/test/Fortran/SHFORTRANFLAGS.py +++ b/test/Fortran/SHFORTRANFLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons _python_ = TestSCons._python_ diff --git a/test/Install/directories.py b/test/Install/directories.py index 3ebc713..e980936 100644 --- a/test/Install/directories.py +++ b/test/Install/directories.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test using Install() on directories. """ -import os.path import TestSCons diff --git a/test/Install/non-ascii-name.py b/test/Install/non-ascii-name.py index 462040d..7e25743 100644 --- a/test/Install/non-ascii-name.py +++ b/test/Install/non-ascii-name.py @@ -29,7 +29,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Verify that the Install() Builder works """ -import os.path import TestSCons diff --git a/test/Java/JAR.py b/test/Java/JAR.py index d5425af..2cd6012 100644 --- a/test/Java/JAR.py +++ b/test/Java/JAR.py @@ -26,7 +26,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os import TestSCons -import sys _python_ = TestSCons._python_ diff --git a/test/Java/JARCHDIR.py b/test/Java/JARCHDIR.py index 59bf082..24a8597 100644 --- a/test/Java/JARCHDIR.py +++ b/test/Java/JARCHDIR.py @@ -33,7 +33,6 @@ Includes logic to make sure that expansions of $JARCHDIR that include ${TARGET} or ${SOURCE} work. """ -import os import TestSCons diff --git a/test/Java/JARFLAGS.py b/test/Java/JARFLAGS.py index 6983bf7..fc6e55e 100644 --- a/test/Java/JARFLAGS.py +++ b/test/Java/JARFLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons diff --git a/test/Java/jar_not_in_PATH.py b/test/Java/jar_not_in_PATH.py index 9a716c5..d69f9c3 100644 --- a/test/Java/jar_not_in_PATH.py +++ b/test/Java/jar_not_in_PATH.py @@ -29,7 +29,6 @@ Ensures that the Tool gets initialized, even when jar is not directly found via the PATH variable (issue #2730). """ -import os import TestSCons diff --git a/test/Java/nested-classes.py b/test/Java/nested-classes.py index a764054..0208eb6 100644 --- a/test/Java/nested-classes.py +++ b/test/Java/nested-classes.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test Java compilation with inner and anonymous classes (Issue 2087). """ -import os import TestSCons diff --git a/test/Java/swig-dependencies.py b/test/Java/swig-dependencies.py index a3af9ec..c1821f8 100644 --- a/test/Java/swig-dependencies.py +++ b/test/Java/swig-dependencies.py @@ -143,7 +143,6 @@ except: # the test framework test.skip_test('Throwing no result for this test because of bug ' + 'related here: https://github.com/SCons/scons/issues/2907\n') - pass #test.must_exist(['java', 'classes', 'foopack', 'foopack.class']) #test.must_exist(['java', 'classes', 'foopack', 'foopackJNI.class']) test.must_exist(['java', 'classes', 'foopack.class']) diff --git a/test/LEX/LEX.py b/test/LEX/LEX.py index a739bfe..79d8359 100644 --- a/test/LEX/LEX.py +++ b/test/LEX/LEX.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons diff --git a/test/LEX/LEXFLAGS.py b/test/LEX/LEXFLAGS.py index 994834e..2cebca7 100644 --- a/test/LEX/LEXFLAGS.py +++ b/test/LEX/LEXFLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import sys import TestSCons diff --git a/test/LINK/LDMODULEVERSIONFLAGS.py b/test/LINK/LDMODULEVERSIONFLAGS.py index d8f280a..509bde8 100644 --- a/test/LINK/LDMODULEVERSIONFLAGS.py +++ b/test/LINK/LDMODULEVERSIONFLAGS.py @@ -24,8 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os -import re import TestSCons import SCons.Platform diff --git a/test/LINK/LINK.py b/test/LINK/LINK.py index 6c99134..f278ac0 100644 --- a/test/LINK/LINK.py +++ b/test/LINK/LINK.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons diff --git a/test/LINK/LINKFLAGS.py b/test/LINK/LINKFLAGS.py index 749e369..d3b675e 100644 --- a/test/LINK/LINKFLAGS.py +++ b/test/LINK/LINKFLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons diff --git a/test/LINK/SHLINK.py b/test/LINK/SHLINK.py index 9d406fc..26d88fa 100644 --- a/test/LINK/SHLINK.py +++ b/test/LINK/SHLINK.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons diff --git a/test/LINK/SHLINKFLAGS.py b/test/LINK/SHLINKFLAGS.py index af5bdbb..a4ae652 100644 --- a/test/LINK/SHLINKFLAGS.py +++ b/test/LINK/SHLINKFLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons diff --git a/test/LINK/VersionedLib.py b/test/LINK/VersionedLib.py index 104f696..5f74f92 100644 --- a/test/LINK/VersionedLib.py +++ b/test/LINK/VersionedLib.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os -import sys import TestSCons import SCons.Platform diff --git a/test/Libs/SharedLibrary-update-deps.py b/test/Libs/SharedLibrary-update-deps.py index 3abce83..922d580 100644 --- a/test/Libs/SharedLibrary-update-deps.py +++ b/test/Libs/SharedLibrary-update-deps.py @@ -30,7 +30,6 @@ This is https://github.com/SCons/scons/issues/2903 """ import sys -import os.path import TestSCons test = TestSCons.TestSCons() diff --git a/test/MSVC/PCHSTOP-errors.py b/test/MSVC/PCHSTOP-errors.py index aa14a3f..a359135 100644 --- a/test/MSVC/PCHSTOP-errors.py +++ b/test/MSVC/PCHSTOP-errors.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" # Test error reporting """ -import re import TestSCons diff --git a/test/MSVC/mssdk.py b/test/MSVC/mssdk.py index 9890d48..88dd5d1 100644 --- a/test/MSVC/mssdk.py +++ b/test/MSVC/mssdk.py @@ -27,7 +27,6 @@ Simple test to make sure mssdk works. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import time import TestSCons diff --git a/test/MSVC/pch-basics.py b/test/MSVC/pch-basics.py index ebee0da..e2b40f1 100644 --- a/test/MSVC/pch-basics.py +++ b/test/MSVC/pch-basics.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Verify PCH works to build a simple exe and a simple dll. """ -import time import TestSCons diff --git a/test/MSVC/pch-spaces-subdir.py b/test/MSVC/pch-spaces-subdir.py index 65595fc..f00fac1 100644 --- a/test/MSVC/pch-spaces-subdir.py +++ b/test/MSVC/pch-spaces-subdir.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Verify PCH works if variant dir has spaces in its name """ -import time import TestSCons diff --git a/test/MSVS/common-prefix.py b/test/MSVS/common-prefix.py index 7079661..7bba783 100644 --- a/test/MSVS/common-prefix.py +++ b/test/MSVS/common-prefix.py @@ -30,7 +30,6 @@ Test that we can generate Visual Studio 8.0 project (.vcproj) and solution (.sln) files that look correct. """ -import os import sys import TestSConsMSVS diff --git a/test/MSVS/runfile.py b/test/MSVS/runfile.py index 631c919..1cc4720 100644 --- a/test/MSVS/runfile.py +++ b/test/MSVS/runfile.py @@ -30,7 +30,6 @@ Test that we can generate Visual Studio 8.0 project (.vcproj) and solution (.sln) files that look correct. """ -import os import sys import TestSConsMSVS diff --git a/test/MSVS/vs-6.0-exec.py b/test/MSVS/vs-6.0-exec.py index ab70872..40f69c0 100644 --- a/test/MSVS/vs-6.0-exec.py +++ b/test/MSVS/vs-6.0-exec.py @@ -29,7 +29,6 @@ Test that we can actually build a simple program using our generated Visual Studio 6 project (.dsp) and solution (.dsw) files. """ -import os import sys import TestSConsMSVS diff --git a/test/MSVS/vs-7.0-exec.py b/test/MSVS/vs-7.0-exec.py index 3c41aa5..a6235a7 100644 --- a/test/MSVS/vs-7.0-exec.py +++ b/test/MSVS/vs-7.0-exec.py @@ -29,7 +29,6 @@ Test that we can actually build a simple program using our generated Visual Studio 7.0 project (.vcproj) and solution (.sln) files. """ -import os import sys import TestSConsMSVS diff --git a/test/MSVS/vs-7.0-scc-files.py b/test/MSVS/vs-7.0-scc-files.py index 4d90a92..f1f77db 100644 --- a/test/MSVS/vs-7.0-scc-files.py +++ b/test/MSVS/vs-7.0-scc-files.py @@ -29,7 +29,6 @@ Test that we can generate Visual Studio 7.0 project (.vcproj) and solution (.sln) files that contain SCC information and look correct. """ -import os import TestSConsMSVS diff --git a/test/MSVS/vs-7.0-scc-legacy-files.py b/test/MSVS/vs-7.0-scc-legacy-files.py index e87441b..a180b8a 100644 --- a/test/MSVS/vs-7.0-scc-legacy-files.py +++ b/test/MSVS/vs-7.0-scc-legacy-files.py @@ -29,7 +29,6 @@ Test that we can generate Visual Studio 7.0 project (.vcproj) and solution (.sln) files that contain SCC information and look correct. """ -import os import TestSConsMSVS diff --git a/test/MSVS/vs-7.1-exec.py b/test/MSVS/vs-7.1-exec.py index f66b92d..7bb3055 100644 --- a/test/MSVS/vs-7.1-exec.py +++ b/test/MSVS/vs-7.1-exec.py @@ -29,7 +29,6 @@ Test that we can actually build a simple program using our generated Visual Studio 7.1 project (.vcproj) and solution (.sln) files """ -import os import sys import TestSConsMSVS diff --git a/test/MSVS/vs-7.1-scc-files.py b/test/MSVS/vs-7.1-scc-files.py index 8404422..0b42930 100644 --- a/test/MSVS/vs-7.1-scc-files.py +++ b/test/MSVS/vs-7.1-scc-files.py @@ -29,7 +29,6 @@ Test that we can generate Visual Studio 7.1 project (.vcproj) and solution (.sln) files that contain SCC information and look correct. """ -import os import TestSConsMSVS diff --git a/test/MSVS/vs-7.1-scc-legacy-files.py b/test/MSVS/vs-7.1-scc-legacy-files.py index f80c965..bb184d6 100644 --- a/test/MSVS/vs-7.1-scc-legacy-files.py +++ b/test/MSVS/vs-7.1-scc-legacy-files.py @@ -29,7 +29,6 @@ Test that we can generate Visual Studio 7.1 project (.vcproj) and solution (.sln) files that contain SCC information and look correct. """ -import os import TestSConsMSVS diff --git a/test/MinGW/mingw_uses_comstr_issue_2799.py b/test/MinGW/mingw_uses_comstr_issue_2799.py index cc92446..fc96ad4 100644 --- a/test/MinGW/mingw_uses_comstr_issue_2799.py +++ b/test/MinGW/mingw_uses_comstr_issue_2799.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test that mingw respects SHLINKCOMSTR, SHCCCOMSTR, and LDMODULECOMSTR """ -import sys import TestSCons _python_ = TestSCons._python_ diff --git a/test/Progress/TARGET.py b/test/Progress/TARGET.py index bbe2538..9535390 100644 --- a/test/Progress/TARGET.py +++ b/test/Progress/TARGET.py @@ -29,7 +29,6 @@ Verify substition of the $TARGET string in progress output, including overwriting it by setting the overwrite= keyword argument. """ -import os import TestSCons diff --git a/test/Progress/spinner.py b/test/Progress/spinner.py index ff88841..f9be6e9 100644 --- a/test/Progress/spinner.py +++ b/test/Progress/spinner.py @@ -29,7 +29,6 @@ Verify output when a Progress() call is initialized with the list that represents a canonical "spinner" on the output. """ -import os import TestSCons diff --git a/test/Repository/Install.py b/test/Repository/Install.py index 75052e7..9c1259a 100644 --- a/test/Repository/Install.py +++ b/test/Repository/Install.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os.path import TestSCons diff --git a/test/Repository/InstallAs.py b/test/Repository/InstallAs.py index d717254..c153771 100644 --- a/test/Repository/InstallAs.py +++ b/test/Repository/InstallAs.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os.path import TestSCons diff --git a/test/Repository/M4.py b/test/Repository/M4.py index 8fa91ab..2e40468 100644 --- a/test/Repository/M4.py +++ b/test/Repository/M4.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test that $M4 and $M4FLAGS work with repositories. """ -import os import TestSCons diff --git a/test/SConsignFile/default.py b/test/SConsignFile/default.py index 62ac006..868f9d7 100644 --- a/test/SConsignFile/default.py +++ b/test/SConsignFile/default.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,16 +22,10 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" -Verify the default behavior of SConsignFile(), called with no arguments. -""" +"""Verify the default behavior of SConsignFile() called with no arguments.""" import TestSCons -import os.path _python_ = TestSCons._python_ @@ -47,12 +43,13 @@ sys.exit(0) # test.write('SConstruct', """ SConsignFile() -B = Builder(action = r'%(_python_)s build.py $TARGETS $SOURCES') -env = Environment(BUILDERS = { 'B' : B }) -env.B(target = 'f1.out', source = 'f1.in') -env.B(target = 'f2.out', source = 'f2.in') -env.B(target = 'subdir/f3.out', source = 'subdir/f3.in') -env.B(target = 'subdir/f4.out', source = 'subdir/f4.in') +DefaultEnvironment(tools=[]) +B = Builder(action=r'%(_python_)s build.py $TARGETS $SOURCES') +env = Environment(BUILDERS={'B': B}, tools=[]) +env.B(target='f1.out', source='f1.in') +env.B(target='f2.out', source='f2.in') +env.B(target='subdir/f3.out', source='subdir/f3.in') +env.B(target='subdir/f4.out', source='subdir/f4.in') """ % locals()) test.write('f1.in', "f1.in\n") @@ -71,7 +68,7 @@ test.must_match('f2.out', "f2.in\n") test.must_match(['subdir', 'f3.out'], "subdir/f3.in\n") test.must_match(['subdir', 'f4.out'], "subdir/f4.in\n") -test.up_to_date(arguments = '.') +test.up_to_date(arguments='.') test.must_exist(test.workpath('.sconsign.dblite')) test.must_not_exist(test.workpath('.sconsign')) diff --git a/test/SConsignFile/explicit-dbm-module.py b/test/SConsignFile/explicit-dbm-module.py new file mode 100644 index 0000000..c093271 --- /dev/null +++ b/test/SConsignFile/explicit-dbm-module.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python +# +# MIT License +# +# Copyright The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +"""Verify SConsignFile() when used with explicit SCons.dblite.""" + +import TestSCons + +_python_ = TestSCons._python_ + +test = TestSCons.TestSCons() + +use_db = 'SCons.dblite' + +test.subdir('subdir') + +test.write('build.py', r""" +import sys +with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: + ofp.write(ifp.read()) +sys.exit(0) +""") + +test.write('SConstruct', """ +import %(use_db)s +SConsignFile(dbm_module=%(use_db)s) +DefaultEnvironment(tools=[]) +B = Builder(action=r'%(_python_)s build.py $TARGETS $SOURCES') +env = Environment(BUILDERS={'B': B}, tools=[]) +env.B(target='f1.out', source='f1.in') +env.B(target='f2.out', source='f2.in') +env.B(target='subdir/f3.out', source='subdir/f3.in') +env.B(target='subdir/f4.out', source='subdir/f4.in') +""" % locals()) + +test.write('f1.in', "f1.in\n") +test.write('f2.in', "f2.in\n") +test.write(['subdir', 'f3.in'], "subdir/f3.in\n") +test.write(['subdir', 'f4.in'], "subdir/f4.in\n") + +test.run() + +test.must_exist(test.workpath('.sconsign.dblite')) +test.must_not_exist(test.workpath('.sconsign')) +test.must_not_exist(test.workpath('subdir', '.sconsign')) + +test.must_match('f1.out', "f1.in\n") +test.must_match('f2.out', "f2.in\n") +test.must_match(['subdir', 'f3.out'], "subdir/f3.in\n") +test.must_match(['subdir', 'f4.out'], "subdir/f4.in\n") + +test.up_to_date(arguments='.') + +test.must_exist(test.workpath('.sconsign.dblite')) +test.must_not_exist(test.workpath('.sconsign')) +test.must_not_exist(test.workpath('subdir', '.sconsign')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/SConsignFile/explicit-file.py b/test/SConsignFile/explicit-file.py index 7583bdc..850b0ef 100644 --- a/test/SConsignFile/explicit-file.py +++ b/test/SConsignFile/explicit-file.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,16 +22,10 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" -Verify the default behavior of SConsignFile(), called with no arguments. -""" +"""Verify the behavior of env.SConsignFile() called with a subst-able path.""" import TestSCons -import os.path _python_ = TestSCons._python_ @@ -45,14 +41,15 @@ with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: # test.write('SConstruct', """ -e = Environment(XXX = 'scons') +DefaultEnvironment(tools=[]) +e = Environment(XXX='scons', tools=[]) e.SConsignFile('my_${XXX}ign') -B = Builder(action = r'%(_python_)s build.py $TARGETS $SOURCES') -env = Environment(BUILDERS = { 'B' : B }) -env.B(target = 'f5.out', source = 'f5.in') -env.B(target = 'f6.out', source = 'f6.in') -env.B(target = 'subdir/f7.out', source = 'subdir/f7.in') -env.B(target = 'subdir/f8.out', source = 'subdir/f8.in') +B = Builder(action=r'%(_python_)s build.py $TARGETS $SOURCES') +env = Environment(BUILDERS={'B': B}, tools=[]) +env.B(target='f5.out', source='f5.in') +env.B(target='f6.out', source='f6.in') +env.B(target='subdir/f7.out', source='subdir/f7.in') +env.B(target='subdir/f8.out', source='subdir/f8.in') """ % locals()) test.write('f5.in', "f5.in\n") @@ -71,7 +68,7 @@ test.must_match('f6.out', "f6.in\n") test.must_match(['subdir', 'f7.out'], "subdir/f7.in\n") test.must_match(['subdir', 'f8.out'], "subdir/f8.in\n") -test.up_to_date(arguments = '.') +test.up_to_date(arguments='.') test.must_exist(test.workpath('my_sconsign.dblite')) test.must_not_exist(test.workpath('.sconsign')) diff --git a/test/SConsignFile/make-directory.py b/test/SConsignFile/make-directory.py index 50bab79..264ee26 100644 --- a/test/SConsignFile/make-directory.py +++ b/test/SConsignFile/make-directory.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify the ability to make a SConsignFile() in a non-existent @@ -40,15 +39,17 @@ bar_foo_txt = os.path.join('bar', 'foo.txt') test.write('SConstruct', """ import SCons.dblite -env = Environment() +DefaultEnvironment(tools=[]) +env = Environment(tools=[]) env.SConsignFile("sub/dir/sconsign", SCons.dblite) env.Install('bar', 'foo.txt') """) test.write('foo.txt', "Foo\n") - -expect = test.wrap_stdout(read_str = 'Mkdir("%s")\n' % sub_dir, - build_str = 'Install file: "foo.txt" as "%s"\n' % bar_foo_txt) +expect = test.wrap_stdout( + read_str='Mkdir("%s")\n' % sub_dir, + build_str='Install file: "foo.txt" as "%s"\n' % bar_foo_txt, +) test.run(options='-n', stdout=expect) diff --git a/test/SConsignFile/use-dbhash.py b/test/SConsignFile/use-dbhash.py index e57e244..2968cd7 100644 --- a/test/SConsignFile/use-dbhash.py +++ b/test/SConsignFile/use-dbhash.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify SConsignFile() when used with dbhash. @@ -36,8 +35,9 @@ test = TestSCons.TestSCons() try: import dbm.bsd + use_dbm = 'dbm.bsd' except ImportError: - test.skip_test('No dbhash in this version of Python; skipping test.\n') + test.skip_test('No dbm.bsd in this version of Python; skipping test.\n') test.subdir('subdir') @@ -50,11 +50,11 @@ sys.exit(0) # test.write('SConstruct', """ -import sys -import dbhash -SConsignFile('.sconsign', dbhash) +import %(use_dbm)s +SConsignFile('.sconsign', %(use_dbm)s) +DefaultEnvironment(tools=[]) B = Builder(action = r'%(_python_)s build.py $TARGETS $SOURCES') -env = Environment(BUILDERS = { 'B' : B }) +env = Environment(BUILDERS={'B': B}, tools=[]) env.B(target = 'f1.out', source = 'f1.in') env.B(target = 'f2.out', source = 'f2.in') env.B(target = 'subdir/f3.out', source = 'subdir/f3.in') diff --git a/test/SConsignFile/use-dbm.py b/test/SConsignFile/use-dbm.py index 5100916..a1ef1b2 100644 --- a/test/SConsignFile/use-dbm.py +++ b/test/SConsignFile/use-dbm.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify SConsignFile() when used with dbm. @@ -37,15 +36,9 @@ test = TestSCons.TestSCons() try: import dbm.ndbm - - use_db = 'dbm.ndbm' + use_dbm = 'dbm.ndbm' except ImportError: - try: - import dbm - - use_db = 'dbm' - except ImportError: - test.skip_test('No dbm.ndbm in this version of Python; skipping test.\n') + test.skip_test('No dbm.ndbm in this version of Python; skipping test.\n') test.subdir('subdir') @@ -58,16 +51,15 @@ sys.exit(0) # test.write('SConstruct', """ -import sys -import %(use_db)s -SConsignFile('.sconsign', %(use_db)s) -B = Builder(action = r'%(_python_)s build.py $TARGETS $SOURCES') +import %(use_dbm)s +SConsignFile('.sconsign', %(use_dbm)s) DefaultEnvironment(tools=[]) -env = Environment(BUILDERS = { 'B' : B }, tools=[]) -env.B(target = 'f1.out', source = 'f1.in') -env.B(target = 'f2.out', source = 'f2.in') -env.B(target = 'subdir/f3.out', source = 'subdir/f3.in') -env.B(target = 'subdir/f4.out', source = 'subdir/f4.in') +B = Builder(action=r'%(_python_)s build.py $TARGETS $SOURCES') +env = Environment(BUILDERS={'B': B}, tools=[]) +env.B(target='f1.out', source='f1.in') +env.B(target='f2.out', source='f2.in') +env.B(target='subdir/f3.out', source='subdir/f3.in') +env.B(target='subdir/f4.out', source='subdir/f4.in') """ % locals()) test.write('f1.in', "f1.in\n") @@ -80,8 +72,10 @@ test.run() # We don't check for explicit .db or other file, because base "dbm" # can use different file extensions on different implementations. -test.fail_test(os.path.exists('.sconsign') and 'dbm' not in dbm.whichdb('.sconsign'), - message=".sconsign existed and wasn't any type of dbm file") +test.fail_test( + os.path.exists('.sconsign') and 'dbm' not in dbm.whichdb('.sconsign'), + message=".sconsign existed and wasn't any type of dbm file", +) test.must_not_exist(test.workpath('.sconsign.dblite')) test.must_not_exist(test.workpath('subdir', '.sconsign')) test.must_not_exist(test.workpath('subdir', '.sconsign.dblite')) diff --git a/test/SConsignFile/use-dumbdbm.py b/test/SConsignFile/use-dumbdbm.py index 36ba18b..875f3fc 100644 --- a/test/SConsignFile/use-dumbdbm.py +++ b/test/SConsignFile/use-dumbdbm.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify SConsignFile() when used with dumbdbm. @@ -35,14 +34,10 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() try: - import dumbdbm - use_dbm = 'dumbdbm' + import dbm.dumb + use_dbm = 'dbm.dumb' except ImportError: - try: - import dbm.dumb - use_dbm='dbm.dumb' - except ImportError: - test.skip_test('No dumbdbm or dbm.dumb in this version of Python; skipping test.\n') + test.skip_test('No dbm.dumb in this version of Python; skipping test.\n') test.subdir('subdir') @@ -55,15 +50,15 @@ sys.exit(0) # test.write('SConstruct', """ -import sys import %(use_dbm)s SConsignFile('.sconsign', %(use_dbm)s) -B = Builder(action = r'%(_python_)s build.py $TARGETS $SOURCES') -env = Environment(BUILDERS = { 'B' : B }) -env.B(target = 'f1.out', source = 'f1.in') -env.B(target = 'f2.out', source = 'f2.in') -env.B(target = 'subdir/f3.out', source = 'subdir/f3.in') -env.B(target = 'subdir/f4.out', source = 'subdir/f4.in') +DefaultEnvironment(tools=[]) +B = Builder(action=r'%(_python_)s build.py $TARGETS $SOURCES') +env = Environment(BUILDERS={'B': B}, tools=[]) +env.B(target='f1.out', source='f1.in') +env.B(target='f2.out', source='f2.in') +env.B(target='subdir/f3.out', source='subdir/f3.in') +env.B(target='subdir/f4.out', source='subdir/f4.in') """ % locals()) test.write('f1.in', "f1.in\n") @@ -87,7 +82,7 @@ test.must_match('f2.out', "f2.in\n") test.must_match(['subdir', 'f3.out'], "subdir/f3.in\n") test.must_match(['subdir', 'f4.out'], "subdir/f4.in\n") -test.up_to_date(arguments = '.') +test.up_to_date(arguments='.') test.must_exist(test.workpath('.sconsign.dat')) test.must_exist(test.workpath('.sconsign.dir')) diff --git a/test/SConsignFile/use-gdbm.py b/test/SConsignFile/use-gdbm.py index 12a2e8b..c1f0c4d 100644 --- a/test/SConsignFile/use-gdbm.py +++ b/test/SConsignFile/use-gdbm.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify SConsignFile() when used with gdbm. @@ -35,14 +34,10 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() try: - import gdbm - use_dbm = "gdbm" + import dbm.gnu + use_dbm = "dbm.gnu" except ImportError: - try: - import dbm.gnu - use_dbm = "dbm.gnu" - except ImportError: - test.skip_test('No GNU dbm in this version of Python; skipping test.\n') + test.skip_test('No GNU dbm in this version of Python; skipping test.\n') test.subdir('subdir') @@ -55,15 +50,15 @@ sys.exit(0) # test.write('SConstruct', """ -import sys import %(use_dbm)s SConsignFile('.sconsign', %(use_dbm)s) -B = Builder(action = '%(_python_)s build.py $TARGETS $SOURCES') -env = Environment(BUILDERS = { 'B' : B }) -env.B(target = 'f1.out', source = 'f1.in') -env.B(target = 'f2.out', source = 'f2.in') -env.B(target = 'subdir/f3.out', source = 'subdir/f3.in') -env.B(target = 'subdir/f4.out', source = 'subdir/f4.in') +DefaultEnvironment(tools=[]) +B = Builder(action='%(_python_)s build.py $TARGETS $SOURCES') +env = Environment(BUILDERS={'B': B}, tools=[]) +env.B(target='f1.out', source='f1.in') +env.B(target='f2.out', source='f2.in') +env.B(target='subdir/f3.out', source='subdir/f3.in') +env.B(target='subdir/f4.out', source='subdir/f4.in') """ % locals()) test.write('f1.in', "f1.in\n") @@ -83,7 +78,7 @@ test.must_match('f2.out', "f2.in\n") test.must_match(['subdir', 'f3.out'], "subdir/f3.in\n") test.must_match(['subdir', 'f4.out'], "subdir/f4.in\n") -test.up_to_date(arguments = '.') +test.up_to_date(arguments='.') test.must_exist(test.workpath('.sconsign')) test.must_not_exist(test.workpath('.sconsign.dblite')) diff --git a/test/SWIG/SWIGFLAGS.py b/test/SWIG/SWIGFLAGS.py index cb91699..70e16a6 100644 --- a/test/SWIG/SWIGFLAGS.py +++ b/test/SWIG/SWIGFLAGS.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Verify that we can use ${SOURCE} expansions in $SWIGFLAGS. """ -import sys import TestSCons test = TestSCons.TestSCons() diff --git a/test/SWIG/live.py b/test/SWIG/live.py index e7b2602..3d46b74 100644 --- a/test/SWIG/live.py +++ b/test/SWIG/live.py @@ -27,7 +27,6 @@ Test SWIG behavior with a live, installed SWIG. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import sys import TestSCons diff --git a/test/Scanner/Scanner.py b/test/Scanner/Scanner.py index 7e39134..4889d0f 100644 --- a/test/Scanner/Scanner.py +++ b/test/Scanner/Scanner.py @@ -25,7 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons -import os _python_ = TestSCons._python_ diff --git a/test/TEMPFILE/TEMPFILE-actionlist.py b/test/TEMPFILE/TEMPFILE-actionlist.py new file mode 100644 index 0000000..d66b217 --- /dev/null +++ b/test/TEMPFILE/TEMPFILE-actionlist.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python +# +# Copyright The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Verify that using $TEMPFILE in multiple actions in a +list invokes each command in the list. +""" + +import TestSCons + +test = TestSCons.TestSCons(match=TestSCons.match_re) +test.file_fixture('fixture/SConstruct-tempfile-actionlist', 'SConstruct') + +test.write('file.input', "file.input\n") + +test.run(arguments='-n -Q .', + stdout="""\ +Using tempfile \\S+ for command line: +xxx.py -otempfile file.input +xxx.py @\\S+ +Using tempfile \\S+ for command line: +yyy.py -ofile.output tempfile +yyy.py @\\S+ +""") + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/TempFileMunge/TEMPFILEDIR.py b/test/TEMPFILE/TEMPFILEDIR.py index b528be3..b528be3 100644 --- a/test/TempFileMunge/TEMPFILEDIR.py +++ b/test/TEMPFILE/TEMPFILEDIR.py diff --git a/test/TempFileMunge/TEMPFILEPREFIX.py b/test/TEMPFILE/TEMPFILEPREFIX.py index ac2ae46..62ac814 100644 --- a/test/TempFileMunge/TEMPFILEPREFIX.py +++ b/test/TEMPFILE/TEMPFILEPREFIX.py @@ -25,8 +25,6 @@ it to appear at the front of name of the generated tempfile used for long command lines. """ -import os -import stat import TestSCons diff --git a/test/TempFileMunge/TEMPFILESUFFIX.py b/test/TEMPFILE/TEMPFILESUFFIX.py index a19317d..bd4cf09 100644 --- a/test/TempFileMunge/TEMPFILESUFFIX.py +++ b/test/TEMPFILE/TEMPFILESUFFIX.py @@ -25,8 +25,6 @@ it to appear at the end of name of the generated tempfile used for long command lines. """ -import os -import stat import TestSCons diff --git a/test/TEMPFILE/fixture/SConstruct-tempfile-actionlist b/test/TEMPFILE/fixture/SConstruct-tempfile-actionlist new file mode 100644 index 0000000..07b6345 --- /dev/null +++ b/test/TEMPFILE/fixture/SConstruct-tempfile-actionlist @@ -0,0 +1,6 @@ +DefaultEnvironment(tools=[]) +env = Environment(tools=[], + BUILDCOM=['${TEMPFILE("xxx.py -otempfile $SOURCE")}', + '${TEMPFILE("yyy.py -o$TARGET tempfile")}'], + MAXLINELENGTH=1) +env.Command('file.output', 'file.input', '$BUILDCOM') diff --git a/test/TempFileMunge/fixture/SConstruct.tempfiledir b/test/TEMPFILE/fixture/SConstruct.tempfiledir index ea26c27..ea26c27 100644 --- a/test/TempFileMunge/fixture/SConstruct.tempfiledir +++ b/test/TEMPFILE/fixture/SConstruct.tempfiledir diff --git a/test/TEX/generated_files.py b/test/TEX/generated_files.py index 9bafc9b..418d99b 100644 --- a/test/TEX/generated_files.py +++ b/test/TEX/generated_files.py @@ -33,7 +33,6 @@ Test courtesy Rob Managan. """ import TestSCons -import os test = TestSCons.TestSCons() diff --git a/test/TEX/synctex.py b/test/TEX/synctex.py index 385a173..c9552d5 100644 --- a/test/TEX/synctex.py +++ b/test/TEX/synctex.py @@ -31,7 +31,6 @@ be aware of the created synctex.gz file. Test configuration contributed by Robert Managan. """ -import os import TestSCons test = TestSCons.TestSCons() diff --git a/test/Value/GetContent.py b/test/Value/GetContent.py new file mode 100644 index 0000000..8fbbf29 --- /dev/null +++ b/test/Value/GetContent.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +""" +Test the Value node as a build target +""" + +import TestSCons + +test = TestSCons.TestSCons() + +test.write('SConstruct', """ +import SCons.Script +def null_build(target, source, env): + pass +env = DefaultEnvironment() +env['BUILDERS']['ValueBuilder'] = SCons.Builder.Builder( + action=SCons.Action.Action(null_build), + target_factory=SCons.Node.Python.Value, +) +v = env.ValueBuilder("myvalue",env.Dir("#")) +v[0].get_text_contents() +""") + +test.run() +test.pass_test() + diff --git a/test/Variables/BoolVariable.py b/test/Variables/BoolVariable.py index d259984..eaf496a 100644 --- a/test/Variables/BoolVariable.py +++ b/test/Variables/BoolVariable.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test the BoolVariable canned Variable type. """ -import os import TestSCons diff --git a/test/Variables/EnumVariable.py b/test/Variables/EnumVariable.py index cf35b9b..14a8bf3 100644 --- a/test/Variables/EnumVariable.py +++ b/test/Variables/EnumVariable.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test the EnumVariable canned Variable type. """ -import os.path import TestSCons diff --git a/test/Variables/PackageVariable.py b/test/Variables/PackageVariable.py index b3fd10a..eb14383 100644 --- a/test/Variables/PackageVariable.py +++ b/test/Variables/PackageVariable.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test the PackageVariable canned Variable type. """ -import os import TestSCons diff --git a/test/YACC/YACCFLAGS.py b/test/YACC/YACCFLAGS.py index b3f86fe..1ab8c0d 100644 --- a/test/YACC/YACCFLAGS.py +++ b/test/YACC/YACCFLAGS.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import sys import TestSCons diff --git a/test/YACC/live.py b/test/YACC/live.py index 4567dba..6314e6c 100644 --- a/test/YACC/live.py +++ b/test/YACC/live.py @@ -29,8 +29,6 @@ Test YACC and YACCFLAGS with a live yacc compiler. """ import TestSCons -import sys -import os _exe = TestSCons._exe _python_ = TestSCons._python_ diff --git a/test/ZIP/ZIPROOT.py b/test/ZIP/ZIPROOT.py index f3e4496..24e82eb 100644 --- a/test/ZIP/ZIPROOT.py +++ b/test/ZIP/ZIPROOT.py @@ -24,8 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os -import stat import TestSCons diff --git a/test/emitter.py b/test/emitter.py index 7712d3a..d2a8b67 100644 --- a/test/emitter.py +++ b/test/emitter.py @@ -25,7 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons -import os test = TestSCons.TestSCons() diff --git a/test/exitfns.py b/test/exitfns.py index fca44b8..ee2ada1 100644 --- a/test/exitfns.py +++ b/test/exitfns.py @@ -25,7 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons -import os test = TestSCons.TestSCons() # also exclude these tests since it overides the exit function which doesnt work with coverage @@ -35,7 +34,7 @@ if test.coverage_run(): test.skip_test("This test replaces the exit function which is needed by coverage to write test data; skipping test.") sconstruct = """ -from SCons.exitfuncs import * +from SCons.exitfuncs import register def x1(): print("running x1") diff --git a/test/gettext/MOFiles/UserExamples.py b/test/gettext/MOFiles/UserExamples.py index 1b78268..5cc3037 100644 --- a/test/gettext/MOFiles/UserExamples.py +++ b/test/gettext/MOFiles/UserExamples.py @@ -30,7 +30,6 @@ Make sure, that the examples given in user guide all work. """ import TestSCons -import os test = TestSCons.TestSCons() diff --git a/test/gettext/POUpdate/UserExamples.py b/test/gettext/POUpdate/UserExamples.py index 5f3e6c7..be38996 100644 --- a/test/gettext/POUpdate/UserExamples.py +++ b/test/gettext/POUpdate/UserExamples.py @@ -29,7 +29,6 @@ Make sure, that the examples given in user guide all work. """ import TestSCons -import os test = TestSCons.TestSCons() diff --git a/test/gettext/Translate/MultiCatalog.py b/test/gettext/Translate/MultiCatalog.py index 1a5708c..e8c2b97 100644 --- a/test/gettext/Translate/MultiCatalog.py +++ b/test/gettext/Translate/MultiCatalog.py @@ -42,7 +42,6 @@ files correctly. # replicate the bug. import TestSCons -from os import path test = TestSCons.TestSCons() diff --git a/test/ignore-command.py b/test/ignore-command.py index d5c18a5..3833e61 100644 --- a/test/ignore-command.py +++ b/test/ignore-command.py @@ -28,7 +28,6 @@ Test use of a preceding - to ignore the return value from a command. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons diff --git a/test/import.py b/test/import.py index df64a1e..55a40cc 100644 --- a/test/import.py +++ b/test/import.py @@ -27,7 +27,6 @@ modules directly. import os import re -import sys # must do this here, since TestSCons will chdir tooldir = os.path.join(os.getcwd(), 'SCons', 'Tool') diff --git a/test/long-lines/signature.py b/test/long-lines/signature.py index 082a13b..7f9ba43 100644 --- a/test/long-lines/signature.py +++ b/test/long-lines/signature.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -22,8 +22,6 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - """ Verify that use of long command lines correctly excludes arguments surrounded by $( $) from the signature calculation. diff --git a/test/multiline.py b/test/multiline.py index c2fabf8..b910b69 100644 --- a/test/multiline.py +++ b/test/multiline.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os.path import TestSCons diff --git a/test/no-arguments.py b/test/no-arguments.py index 8925c48..5ed66ab 100644 --- a/test/no-arguments.py +++ b/test/no-arguments.py @@ -30,7 +30,6 @@ is no Default() in the SConstruct file and there are no command-line arguments, or a null command-line argument. """ -import os.path import TestSCons diff --git a/test/option--random.py b/test/option--random.py index c25ec12..1dafca4 100644 --- a/test/option--random.py +++ b/test/option--random.py @@ -27,7 +27,6 @@ Verify that we build correctly using the --random option. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os.path import TestSCons diff --git a/test/option--tree.py b/test/option--tree.py index 290f1d4..5192ac0 100644 --- a/test/option--tree.py +++ b/test/option--tree.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import sys import TestSCons test = TestSCons.TestSCons() diff --git a/test/option-k.py b/test/option-k.py index 4f4c86b..d6c81ea 100644 --- a/test/option-k.py +++ b/test/option-k.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os.path import TestSCons diff --git a/test/option/debug-count.py b/test/option/debug-count.py index f2fceb4..cf46feb 100644 --- a/test/option/debug-count.py +++ b/test/option/debug-count.py @@ -34,13 +34,6 @@ import TestSCons test = TestSCons.TestSCons() -try: - import weakref -except ImportError: - x = "Python version has no 'weakref' module; skipping tests.\n" - test.skip_test(x) - - test.write('SConstruct', """ DefaultEnvironment(tools=[]) diff --git a/test/option/debug-memory.py b/test/option/debug-memory.py index bf720cc..2958e0b 100644 --- a/test/option/debug-memory.py +++ b/test/option/debug-memory.py @@ -1,6 +1,7 @@ #!/usr/bin/env python +# MIT License # -# __COPYRIGHT__ +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -22,8 +23,6 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - """ Test that the --debug=memory option works. """ @@ -31,21 +30,18 @@ Test that the --debug=memory option works. import re import TestSCons +from TestCmd import IS_WINDOWS test = TestSCons.TestSCons() -try: - import resource -except ImportError: +if not IS_WINDOWS: try: - import win32process - import win32api + import resource # noqa: F401 except ImportError: - x = "Python version has no 'resource' or 'win32api/win32process' module; skipping tests.\n" + x = "Python version has no 'resource' skipping tests.\n" test.skip_test(x) - test.write('SConstruct', """ DefaultEnvironment(tools=[]) def cat(target, source, env): diff --git a/test/option/debug-objects.py b/test/option/debug-objects.py index beec4b7..9c8536c 100644 --- a/test/option/debug-objects.py +++ b/test/option/debug-objects.py @@ -32,13 +32,6 @@ import TestSCons test = TestSCons.TestSCons() -try: - import weakref -except ImportError: - x = "Python version has no 'weakref' module; skipping tests.\n" - test.skip_test(x) - - test.write('SConstruct', """ DefaultEnvironment(tools=[]) diff --git a/test/packaging/msi/explicit-target.py b/test/packaging/msi/explicit-target.py index 85bfa85..015baee 100644 --- a/test/packaging/msi/explicit-target.py +++ b/test/packaging/msi/explicit-target.py @@ -36,7 +36,7 @@ python = TestSCons.python test = TestSCons.TestSCons() try: - from xml.dom.minidom import * + from xml.dom.minidom import parse except ImportError: test.skip_test('Canoot import xml.dom.minidom skipping test\n') diff --git a/test/packaging/msi/file-placement.py b/test/packaging/msi/file-placement.py index 2cc9e61..405e55b 100644 --- a/test/packaging/msi/file-placement.py +++ b/test/packaging/msi/file-placement.py @@ -35,7 +35,7 @@ python = TestSCons.python test = TestSCons.TestSCons() try: - from xml.dom.minidom import * + from xml.dom.minidom import parse except ImportError: test.skip_test('Cannot import xml.dom.minidom; skipping test\n') diff --git a/test/packaging/msi/package.py b/test/packaging/msi/package.py index 4988742..19183bf 100644 --- a/test/packaging/msi/package.py +++ b/test/packaging/msi/package.py @@ -35,7 +35,7 @@ python = TestSCons.python test = TestSCons.TestSCons() try: - from xml.dom.minidom import * + from xml.dom.minidom import parse except ImportError: test.skip_test('Canoot import xml.dom.minidom skipping test\n') diff --git a/test/packaging/place-files-in-subdirectory.py b/test/packaging/place-files-in-subdirectory.py index 838d6b8..dd422e6 100644 --- a/test/packaging/place-files-in-subdirectory.py +++ b/test/packaging/place-files-in-subdirectory.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test the requirement to place files in a given subdirectory before archiving. """ -import os import subprocess import TestSCons diff --git a/test/python-version.py b/test/python-version.py index 9cfd2bd..bbec233 100644 --- a/test/python-version.py +++ b/test/python-version.py @@ -29,7 +29,6 @@ Verify the behavior of our check for unsupported or deprecated versions of Python. """ -import os import re import TestCmd diff --git a/test/runtest/SCons.py b/test/runtest/SCons.py index 9bc86e8..20c4c64 100644 --- a/test/runtest/SCons.py +++ b/test/runtest/SCons.py @@ -34,9 +34,7 @@ import os import TestRuntest test = TestRuntest.TestRuntest() - -test.subdir(['SCons'], - ['SCons', 'suite']) +test.subdir(['SCons'], ['SCons', 'suite']) pythonstring = TestRuntest.pythonstring pythonflags = TestRuntest.pythonflags @@ -44,11 +42,8 @@ src_passTests_py = os.path.join('SCons', 'passTests.py') src_suite_passTests_py = os.path.join('SCons', 'suite', 'passTests.py') test.write_passing_test(['SCons', 'pass.py']) - test.write_passing_test(['SCons', 'passTests.py']) - test.write_passing_test(['SCons', 'suite', 'pass.py']) - test.write_passing_test(['SCons', 'suite', 'passTests.py']) expect_stdout = """\ diff --git a/test/runtest/fallback.py b/test/runtest/faillog.py index b137307..e2ca67e 100644 --- a/test/runtest/fallback.py +++ b/test/runtest/faillog.py @@ -25,68 +25,52 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ -Test that runtest.py falls back (with a warning) using --noqmtest -if it can't find qmtest on the $PATH. +Test a list of tests in failed_tests.log to run with the --retry option """ -import os +import os.path import TestRuntest pythonstring = TestRuntest.pythonstring pythonflags = TestRuntest.pythonflags +test_fail_py = os.path.join('test', 'fail.py') +test_pass_py = os.path.join('test', 'pass.py') test = TestRuntest.TestRuntest() - -# qmtest may be in more than one location in your path -while test.where_is('qmtest'): - qmtest=test.where_is('qmtest') - dir = os.path.split(qmtest)[0] - path = os.environ['PATH'].split(os.pathsep) - path.remove(dir) - os.environ['PATH'] = os.pathsep.join(path) - test.subdir('test') - -test_fail_py = os.path.join('test', 'fail.py') -test_no_result_py = os.path.join('test', 'no_result.py') -test_pass_py = os.path.join('test', 'pass.py') - test.write_failing_test(test_fail_py) -test.write_no_result_test(test_no_result_py) test.write_passing_test(test_pass_py) expect_stdout = """\ %(pythonstring)s%(pythonflags)s %(test_fail_py)s FAILING TEST STDOUT -%(pythonstring)s%(pythonflags)s %(test_no_result_py)s -NO RESULT TEST STDOUT %(pythonstring)s%(pythonflags)s %(test_pass_py)s PASSING TEST STDOUT Failed the following test: \t%(test_fail_py)s - -NO RESULT from the following test: -\t%(test_no_result_py)s """ % locals() expect_stderr = """\ FAILING TEST STDERR -NO RESULT TEST STDERR PASSING TEST STDERR """ testlist = [ test_fail_py, - test_no_result_py, test_pass_py, ] -test.run(arguments = '-k '+' '.join(testlist), - status = 1, - stdout = expect_stdout, - stderr = expect_stderr) +test.run( + arguments='-k --faillog=fail.log %s' % ' '.join(testlist), + status=1, + stdout=expect_stdout, + stderr=expect_stderr, +) +test.must_exist('fail.log') +test.must_contain('fail.log', test_fail_py) +test.must_not_exist('failed_tests.log') test.pass_test() diff --git a/test/runtest/noqmtest.py b/test/runtest/no_faillog.py index fcf7ac0..db17c8e 100644 --- a/test/runtest/noqmtest.py +++ b/test/runtest/no_faillog.py @@ -25,60 +25,54 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ -Test that by default tests are invoked directly via Python, not -using qmtest. +Test a list of tests in failed_tests.log to run with the --retry option """ -import os +import os.path import TestRuntest pythonstring = TestRuntest.pythonstring pythonflags = TestRuntest.pythonflags +test_fail_py = os.path.join('test', 'fail.py') +test_pass_py = os.path.join('test', 'pass.py') test = TestRuntest.TestRuntest() - test.subdir('test') - -test_fail_py = os.path.join('test', 'fail.py') -test_no_result_py = os.path.join('test', 'no_result.py') -test_pass_py = os.path.join('test', 'pass.py') - test.write_failing_test(test_fail_py) -test.write_no_result_test(test_no_result_py) test.write_passing_test(test_pass_py) +test.write('failed_tests.log', """\ +%(test_fail_py)s +""" % locals()) + expect_stdout = """\ %(pythonstring)s%(pythonflags)s %(test_fail_py)s FAILING TEST STDOUT -%(pythonstring)s%(pythonflags)s %(test_no_result_py)s -NO RESULT TEST STDOUT %(pythonstring)s%(pythonflags)s %(test_pass_py)s PASSING TEST STDOUT Failed the following test: \t%(test_fail_py)s - -NO RESULT from the following test: -\t%(test_no_result_py)s """ % locals() expect_stderr = """\ FAILING TEST STDERR -NO RESULT TEST STDERR PASSING TEST STDERR """ testlist = [ test_fail_py, - test_no_result_py, test_pass_py, ] -test.run(arguments = '-k %s' % ' '.join(testlist), - status = 1, - stdout = expect_stdout, - stderr = expect_stderr) +test.run( + arguments='-k --no-faillog %s' % ' '.join(testlist), + status=1, + stdout=expect_stdout, + stderr=expect_stderr, +) +test.must_not_exist('failing_tests.log') test.pass_test() diff --git a/test/runtest/print_time.py b/test/runtest/print_time.py index 322b88b..834d2ae 100644 --- a/test/runtest/print_time.py +++ b/test/runtest/print_time.py @@ -42,13 +42,9 @@ test_no_result_py = re.escape(os.path.join('test', 'no_result.py')) test_pass_py = re.escape(os.path.join('test', 'pass.py')) test = TestRuntest.TestRuntest(match = TestCmd.match_re) - test.subdir('test') - test.write_failing_test(['test', 'fail.py']) - test.write_no_result_test(['test', 'no_result.py']) - test.write_passing_test(['test', 'pass.py']) expect_stdout = """\ diff --git a/test/runtest/python.py b/test/runtest/python.py index da62378..499ab77 100644 --- a/test/runtest/python.py +++ b/test/runtest/python.py @@ -37,9 +37,7 @@ if not hasattr(os.path, 'pardir'): import TestRuntest test = TestRuntest.TestRuntest() - test_pass_py = os.path.join('test', 'pass.py') - head, python = os.path.split(TestRuntest.python) head, dir = os.path.split(head) diff --git a/test/runtest/retry.py b/test/runtest/retry.py new file mode 100644 index 0000000..4280152 --- /dev/null +++ b/test/runtest/retry.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +""" +Test a list of tests in failed_tests.log to run with the --retry option +""" + +import os.path + +import TestRuntest + +pythonstring = TestRuntest.pythonstring +pythonflags = TestRuntest.pythonflags +test_fail_py = os.path.join('test', 'fail.py') +test_no_result_py = os.path.join('test', 'no_result.py') +test_pass_py = os.path.join('test', 'pass.py') + +test = TestRuntest.TestRuntest() + +test.subdir('test') +test.write_failing_test(['test', 'fail.py']) +test.write_no_result_test(['test', 'no_result.py']) +test.write_passing_test(['test', 'pass.py']) + +test.write('failed_tests.log', """\ +%(test_fail_py)s +""" % locals()) + +expect_stdout = """\ +%(pythonstring)s%(pythonflags)s %(test_fail_py)s +FAILING TEST STDOUT +""" % locals() + +expect_stderr = """\ +FAILING TEST STDERR +""" + +test.run(arguments='-k --retry', status=1, stdout=expect_stdout, stderr=expect_stderr) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/runtest/simple/combined.py b/test/runtest/simple/combined.py index ec0a1bb..a54e57c 100644 --- a/test/runtest/simple/combined.py +++ b/test/runtest/simple/combined.py @@ -1,4 +1,3 @@ - #!/usr/bin/env python # # __COPYRIGHT__ @@ -34,21 +33,17 @@ import os import TestRuntest -test = TestRuntest.TestRuntest() - pythonstring = TestRuntest.pythonstring pythonflags = TestRuntest.pythonflags test_fail_py = os.path.join('test', 'fail.py') test_no_result_py = os.path.join('test', 'no_result.py') test_pass_py = os.path.join('test', 'pass.py') +test = TestRuntest.TestRuntest() test.subdir('test') - -test.write_failing_test(['test', 'fail.py']) - -test.write_no_result_test(['test', 'no_result.py']) - -test.write_passing_test(['test', 'pass.py']) +test.write_failing_test(test_fail_py) +test.write_no_result_test(test_no_result_py) +test.write_passing_test(test_pass_py) expect_stdout = """\ %(pythonstring)s%(pythonflags)s %(test_fail_py)s @@ -71,10 +66,14 @@ NO RESULT TEST STDERR PASSING TEST STDERR """ -test.run(arguments='-k test', - status=1, - stdout=expect_stdout, - stderr=expect_stderr) +test.run( + arguments='-k test', + status=1, + stdout=expect_stdout, + stderr=expect_stderr +) +test.must_exist('failed_tests.log') +test.must_contain('failed_tests.log', test_fail_py) test.pass_test() diff --git a/test/runtest/testlistfile.py b/test/runtest/testlistfile.py index 063a8d0..5c956b8 100644 --- a/test/runtest/testlistfile.py +++ b/test/runtest/testlistfile.py @@ -26,10 +26,10 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test a list of tests to run in a file specified with the -f option. +The commented-out test should not run. """ import os.path -import re import TestRuntest @@ -42,11 +42,8 @@ test_pass_py = os.path.join('test', 'pass.py') test = TestRuntest.TestRuntest() test.subdir('test') - test.write_failing_test(['test', 'fail.py']) - test.write_no_result_test(['test', 'no_result.py']) - test.write_passing_test(['test', 'pass.py']) test.write('t.txt', """\ diff --git a/test/scons-time/func/prefix.py b/test/scons-time/func/prefix.py index 67a0c6b..36c9ddf 100644 --- a/test/scons-time/func/prefix.py +++ b/test/scons-time/func/prefix.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Verify that the func -p and --prefix options specify what log files to use. """ -import os.path import TestSCons_time diff --git a/test/scons-time/run/archive/zip.py b/test/scons-time/run/archive/zip.py index 4620440..7bd5538 100644 --- a/test/scons-time/run/archive/zip.py +++ b/test/scons-time/run/archive/zip.py @@ -29,7 +29,6 @@ Verify basic generation of timing information from an input fake-project .zip file. """ -import sys import TestSCons_time diff --git a/test/sconsign/script/SConsignFile.py b/test/sconsign/script/SConsignFile.py index cd82fac..47fe94f 100644 --- a/test/sconsign/script/SConsignFile.py +++ b/test/sconsign/script/SConsignFile.py @@ -29,7 +29,6 @@ Verify that the sconsign script works with files generated when using the signatures in an SConsignFile(). """ -import re import TestSCons import TestSConsign diff --git a/test/silent-command.py b/test/silent-command.py index 7f3b010..3622a04 100644 --- a/test/silent-command.py +++ b/test/silent-command.py @@ -28,7 +28,6 @@ Test the use of a preceding @ to suppress printing a command. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os import TestSCons diff --git a/test/srcchange.py b/test/srcchange.py index 30f6f20..e72d923 100644 --- a/test/srcchange.py +++ b/test/srcchange.py @@ -32,7 +32,6 @@ of Decider('content'). __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os.path import TestSCons diff --git a/test/subdir.py b/test/subdir.py index 363d44c..c5bfcdc 100644 --- a/test/subdir.py +++ b/test/subdir.py @@ -25,7 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons -import os.path _python_ = TestSCons._python_ diff --git a/test/symlink/dangling-include.py b/test/symlink/dangling-include.py index b7d5d2f..081573f 100644 --- a/test/symlink/dangling-include.py +++ b/test/symlink/dangling-include.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test how we handle #includes of dangling symlinks. """ -import os import TestSCons diff --git a/test/symlink/dangling-source.py b/test/symlink/dangling-source.py index b2bc540..94690f4 100644 --- a/test/symlink/dangling-source.py +++ b/test/symlink/dangling-source.py @@ -28,7 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test how we handle dangling symlinks as source files. """ -import os import TestSCons diff --git a/test/timestamp-fallback.py b/test/timestamp-fallback.py index 2dd50a2..b3e812b 100644 --- a/test/timestamp-fallback.py +++ b/test/timestamp-fallback.py @@ -32,7 +32,6 @@ rare no-md5 Pythons comes into play (some entities ban the use of md5 as unsafe, although SCons does not use it in a security context. """ -import sys import os import TestSCons diff --git a/test/tool_args.py b/test/tool_args.py index 6983705..464d009 100644 --- a/test/tool_args.py +++ b/test/tool_args.py @@ -29,7 +29,6 @@ Test the ability to pass a dictionary of keyword arguments to a Tool specification's generate() method. """ -import os.path import TestSCons diff --git a/test/toolpath/basic.py b/test/toolpath/basic.py index 793497b..0d2429e 100644 --- a/test/toolpath/basic.py +++ b/test/toolpath/basic.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os.path import TestSCons diff --git a/test/toolpath/nested/nested.py b/test/toolpath/nested/nested.py index df2ba07..47c0b03 100644 --- a/test/toolpath/nested/nested.py +++ b/test/toolpath/nested/nested.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os.path import TestSCons test = TestSCons.TestSCons() diff --git a/test/toolpath/relative_import/relative_import.py b/test/toolpath/relative_import/relative_import.py index 8fa2f62..f4362f7 100644 --- a/test/toolpath/relative_import/relative_import.py +++ b/test/toolpath/relative_import/relative_import.py @@ -24,7 +24,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import os.path
import TestSCons
test = TestSCons.TestSCons()
diff --git a/test/update-release-info/update-release-info.py b/test/update-release-info/update-release-info.py index f353d38..2de4713 100644 --- a/test/update-release-info/update-release-info.py +++ b/test/update-release-info/update-release-info.py @@ -27,7 +27,8 @@ have the appropriate triggers to cause the modifications. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os, sys, time +import os +import time import TestRuntest diff --git a/test/virtualenv/activated/option/enable-virtualenv.py b/test/virtualenv/activated/option/enable-virtualenv.py index a5ceecc..ff06583 100644 --- a/test/virtualenv/activated/option/enable-virtualenv.py +++ b/test/virtualenv/activated/option/enable-virtualenv.py @@ -30,7 +30,6 @@ Ensure that the --enable-virtualenv flag works. import TestSCons import SCons.Platform.virtualenv -import sys import os import re diff --git a/test/virtualenv/activated/option/ignore-virtualenv.py b/test/virtualenv/activated/option/ignore-virtualenv.py index ac6f945..b0d482e 100644 --- a/test/virtualenv/activated/option/ignore-virtualenv.py +++ b/test/virtualenv/activated/option/ignore-virtualenv.py @@ -30,7 +30,6 @@ Ensure that the --ignore-virtualenv flag works. import TestSCons import SCons.Platform.virtualenv -import sys import os import re diff --git a/test/virtualenv/activated/virtualenv_activated_python.py b/test/virtualenv/activated/virtualenv_activated_python.py index c673ae1..4e793da 100644 --- a/test/virtualenv/activated/virtualenv_activated_python.py +++ b/test/virtualenv/activated/virtualenv_activated_python.py @@ -33,7 +33,6 @@ environment or in unactivated virtualenv. import TestSCons import SCons.Platform.virtualenv -import sys import os import re diff --git a/test/virtualenv/activated/virtualenv_detect_virtualenv.py b/test/virtualenv/activated/virtualenv_detect_virtualenv.py index 2c00793..e7b7cb0 100644 --- a/test/virtualenv/activated/virtualenv_detect_virtualenv.py +++ b/test/virtualenv/activated/virtualenv_detect_virtualenv.py @@ -30,7 +30,6 @@ Check if SCons.Platform.virtualenv.Virtualenv() works in SConscripts. import TestSCons import SCons.Platform.virtualenv -import sys test = TestSCons.TestSCons() diff --git a/test/virtualenv/regularenv/virtualenv_detect_regularenv.py b/test/virtualenv/regularenv/virtualenv_detect_regularenv.py index 57a0d4f..6856838 100644 --- a/test/virtualenv/regularenv/virtualenv_detect_regularenv.py +++ b/test/virtualenv/regularenv/virtualenv_detect_regularenv.py @@ -30,7 +30,6 @@ Check if SCons.Platform.virtualenv.Virtualenv() works in SConscript. import TestSCons import SCons.Platform.virtualenv -import sys test = TestSCons.TestSCons() diff --git a/test/virtualenv/unactivated/virtualenv_unactivated_python.py b/test/virtualenv/unactivated/virtualenv_unactivated_python.py index a4dc240..38d5329 100644 --- a/test/virtualenv/unactivated/virtualenv_unactivated_python.py +++ b/test/virtualenv/unactivated/virtualenv_unactivated_python.py @@ -33,7 +33,6 @@ a regular environment or in an activated virtualenv. import TestSCons import SCons.Platform.virtualenv -import sys import os import re |