diff options
52 files changed, 54 insertions, 299 deletions
diff --git a/fixture/wrapper.py b/fixture/wrapper.py index a797434..f02ea03 100644 --- a/fixture/wrapper.py +++ b/fixture/wrapper.py @@ -1,5 +1,6 @@ import os import sys -path = os.path.join(os.path.abspath(__file__), 'wrapper.out') -open(path, 'wb').write(b"wrapper.py\n") +if '--version' not in sys.argv and '-dumpversion' not in sys.argv: + path = os.path.join(os.path.dirname(os.path.relpath(__file__)), 'wrapper.out') + open(path, 'wb').write(b"wrapper.py\n") os.system(" ".join(sys.argv[1:])) diff --git a/test/AR/AR.py b/test/AR/AR.py index eb4c507..11687d9 100644 --- a/test/AR/AR.py +++ b/test/AR/AR.py @@ -33,12 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() -test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write(b"wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(LIBS = ['foo'], LIBPATH = ['.']) diff --git a/test/AR/ARFLAGS.py b/test/AR/ARFLAGS.py index 0a9f36e..2d90752 100644 --- a/test/AR/ARFLAGS.py +++ b/test/AR/ARFLAGS.py @@ -33,12 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() -test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write(b"wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(LIBS = ['foo'], LIBPATH = ['.']) diff --git a/test/AS/ml.py b/test/AS/ml.py index c377172..0506f5f 100644 --- a/test/AS/ml.py +++ b/test/AS/ml.py @@ -45,12 +45,7 @@ ml = test.where_is('ml') if not ml: test.skip_test("ml not found; skipping test\n") -test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write(b"wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """ import os diff --git a/test/AS/nasm.py b/test/AS/nasm.py index 551a5ab..b436a75 100644 --- a/test/AS/nasm.py +++ b/test/AS/nasm.py @@ -74,12 +74,7 @@ for k, v in list(format_map.items()): nasm_format = v break -test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """ eee = Environment(tools = ['gcc', 'gnulink', 'nasm'], diff --git a/test/CC/CC.py b/test/CC/CC.py index 7478cbe..f6c2954 100644 --- a/test/CC/CC.py +++ b/test/CC/CC.py @@ -139,13 +139,7 @@ env.Program(target = 'test2', source = 'test2.C') test.run(arguments = '.', stderr = None) test.must_match('test2' + _exe, "This is a .C file.\n") -test.write("wrapper.py", -"""import os -import sys -if '--version' not in sys.argv and '-dumpversion' not in sys.argv: - open('%s', 'wb').write(b"wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment() diff --git a/test/CC/SHCC.py b/test/CC/SHCC.py index 5f121fc..beda8e4 100644 --- a/test/CC/SHCC.py +++ b/test/CC/SHCC.py @@ -32,12 +32,7 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() -test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write(b"wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment() diff --git a/test/CXX/CXX.py b/test/CXX/CXX.py index 79dbde4..c9dbf1c 100644 --- a/test/CXX/CXX.py +++ b/test/CXX/CXX.py @@ -183,13 +183,7 @@ env.Program(target = 'test6', source = 'test6.C') -test.write("wrapper.py", -"""import os -import sys -if '--version' not in sys.argv and '-dumpversion' not in sys.argv: - open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment() diff --git a/test/CXX/SHCXX.py b/test/CXX/SHCXX.py index 9a78881..d6a314e 100644 --- a/test/CXX/SHCXX.py +++ b/test/CXX/SHCXX.py @@ -32,12 +32,7 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() -test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment() diff --git a/test/Fortran/F03FLAGS.py b/test/Fortran/F03FLAGS.py index b11b780..4e99db8 100644 --- a/test/Fortran/F03FLAGS.py +++ b/test/Fortran/F03FLAGS.py @@ -103,12 +103,7 @@ g03 = test.detect_tool(fc) if g03: - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(F03 = '%(fc)s') diff --git a/test/Fortran/F08.py b/test/Fortran/F08.py index b61b861..a28389e 100644 --- a/test/Fortran/F08.py +++ b/test/Fortran/F08.py @@ -96,12 +96,7 @@ g08 = test.detect_tool(fc) if g08: - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(F08 = '%(fc)s') diff --git a/test/Fortran/F08FLAGS.py b/test/Fortran/F08FLAGS.py index 34f3d75..c693c82 100644 --- a/test/Fortran/F08FLAGS.py +++ b/test/Fortran/F08FLAGS.py @@ -103,12 +103,7 @@ g08 = test.detect_tool(fc) if g08: - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(F08 = '%(fc)s') diff --git a/test/Fortran/F77.py b/test/Fortran/F77.py index 300df85..8fdd391 100644 --- a/test/Fortran/F77.py +++ b/test/Fortran/F77.py @@ -94,12 +94,7 @@ f77 = test.detect_tool(fc) if f77: - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(F77 = '%(fc)s', tools = ['default', 'f77'], F77FILESUFFIXES = ['.f']) diff --git a/test/Fortran/F77FLAGS.py b/test/Fortran/F77FLAGS.py index 8e972ec..9b4c56c 100644 --- a/test/Fortran/F77FLAGS.py +++ b/test/Fortran/F77FLAGS.py @@ -78,12 +78,7 @@ if g77: directory = 'x' test.subdir(directory) - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(F77 = '%(fc)s', tools = ['default', 'f77'], F77FILESUFFIXES = [".f"]) diff --git a/test/Fortran/F90.py b/test/Fortran/F90.py index bbceaac..633b174 100644 --- a/test/Fortran/F90.py +++ b/test/Fortran/F90.py @@ -96,12 +96,7 @@ g90 = test.detect_tool(fc) if g90: - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(F90 = '%(fc)s') diff --git a/test/Fortran/F90FLAGS.py b/test/Fortran/F90FLAGS.py index 8eaa938..cf2b3b3 100644 --- a/test/Fortran/F90FLAGS.py +++ b/test/Fortran/F90FLAGS.py @@ -105,12 +105,7 @@ g90 = test.detect_tool(fc) if g90: - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(F90 = '%(fc)s') diff --git a/test/Fortran/F95.py b/test/Fortran/F95.py index 56c6edd..0912f71 100644 --- a/test/Fortran/F95.py +++ b/test/Fortran/F95.py @@ -98,12 +98,7 @@ g95 = test.detect_tool(fc) if g95: - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(F95 = '%(fc)s') diff --git a/test/Fortran/F95FLAGS.py b/test/Fortran/F95FLAGS.py index 525b8cc..cc5a5e3 100644 --- a/test/Fortran/F95FLAGS.py +++ b/test/Fortran/F95FLAGS.py @@ -111,12 +111,7 @@ if g95: # Exists only such that -Ix finds the directory... """) - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(F95 = '%(fc)s') diff --git a/test/Fortran/FORTRAN.py b/test/Fortran/FORTRAN.py index c03698f..577421e 100644 --- a/test/Fortran/FORTRAN.py +++ b/test/Fortran/FORTRAN.py @@ -90,12 +90,7 @@ f77 = test.detect_tool(fc) if f77: - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(FORTRAN = '%(fc)s') diff --git a/test/Fortran/FORTRANFLAGS.py b/test/Fortran/FORTRANFLAGS.py index 7dbc049..7b9f7d7 100644 --- a/test/Fortran/FORTRANFLAGS.py +++ b/test/Fortran/FORTRANFLAGS.py @@ -98,12 +98,7 @@ if g77: directory = 'x' test.subdir(directory) - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(FORTRAN = '%(fc)s') diff --git a/test/Fortran/SHF03.py b/test/Fortran/SHF03.py index 6502f49..d514f64 100644 --- a/test/Fortran/SHF03.py +++ b/test/Fortran/SHF03.py @@ -95,12 +95,7 @@ g03 = test.detect_tool(fc) if g03: - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(SHF03 = '%(fc)s') diff --git a/test/Fortran/SHF08.py b/test/Fortran/SHF08.py index 85f2bcd..0aed858 100644 --- a/test/Fortran/SHF08.py +++ b/test/Fortran/SHF08.py @@ -95,12 +95,7 @@ g08 = test.detect_tool(fc) if g08: - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(SHF08 = '%(fc)s') diff --git a/test/Fortran/SHF77.py b/test/Fortran/SHF77.py index ff2a0ca..3c2565b 100644 --- a/test/Fortran/SHF77.py +++ b/test/Fortran/SHF77.py @@ -94,12 +94,7 @@ f77 = test.detect_tool(fc) if f77: - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(SHF77 = '%(fc)s') diff --git a/test/Fortran/SHF77FLAGS.py b/test/Fortran/SHF77FLAGS.py index 79e46f3..1b9628c 100644 --- a/test/Fortran/SHF77FLAGS.py +++ b/test/Fortran/SHF77FLAGS.py @@ -78,12 +78,7 @@ if g77: directory = 'x' test.subdir(directory) - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(SHF77 = '%(fc)s') diff --git a/test/Fortran/SHF90.py b/test/Fortran/SHF90.py index 486b57b..46bf4ae 100644 --- a/test/Fortran/SHF90.py +++ b/test/Fortran/SHF90.py @@ -96,12 +96,7 @@ g90 = test.detect_tool(fc) if g90: - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(SHF90 = '%(fc)s') diff --git a/test/Fortran/SHF90FLAGS.py b/test/Fortran/SHF90FLAGS.py index d5066c6..0f9e2ba3 100644 --- a/test/Fortran/SHF90FLAGS.py +++ b/test/Fortran/SHF90FLAGS.py @@ -101,12 +101,7 @@ g90 = test.detect_tool(fc) if g90: - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(SHF90 = '%(fc)s') diff --git a/test/Fortran/SHF95.py b/test/Fortran/SHF95.py index 0b64923..6329c9e 100644 --- a/test/Fortran/SHF95.py +++ b/test/Fortran/SHF95.py @@ -95,12 +95,7 @@ g95 = test.detect_tool(fc) if g95: - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(SHF95 = '%(fc)s') diff --git a/test/Fortran/SHF95FLAGS.py b/test/Fortran/SHF95FLAGS.py index 8e75878..e573eb4 100644 --- a/test/Fortran/SHF95FLAGS.py +++ b/test/Fortran/SHF95FLAGS.py @@ -110,12 +110,7 @@ if g95: # Exists only such that -Ix finds the directory... """) - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(SHF95 = '%(fc)s') diff --git a/test/Fortran/SHFORTRAN.py b/test/Fortran/SHFORTRAN.py index d9ae55d..fdcba7f 100644 --- a/test/Fortran/SHFORTRAN.py +++ b/test/Fortran/SHFORTRAN.py @@ -89,12 +89,7 @@ fortran = test.detect_tool(fc) if fortran: - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(SHFORTRAN = '%(fc)s') diff --git a/test/Fortran/SHFORTRANFLAGS.py b/test/Fortran/SHFORTRANFLAGS.py index 8e6f019..7067c6f 100644 --- a/test/Fortran/SHFORTRANFLAGS.py +++ b/test/Fortran/SHFORTRANFLAGS.py @@ -94,12 +94,7 @@ if fortran: directory = 'x' test.subdir(directory) - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(SHFORTRAN = '%(fc)s') diff --git a/test/Ghostscript/GSFLAGS.py b/test/Ghostscript/GSFLAGS.py index 16ad6c1..c8e0668 100644 --- a/test/Ghostscript/GSFLAGS.py +++ b/test/Ghostscript/GSFLAGS.py @@ -82,12 +82,7 @@ gs = test.where_is(gs_executable) if gs: - test.write("wrapper.py", """import os -import sys -cmd = " ".join(sys.argv[1:]) -open('%s', 'ab').write("%%s\\n" %% cmd) -os.system(cmd) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """\ import os diff --git a/test/Java/JAR.py b/test/Java/JAR.py index 81664dc..98dfa38 100644 --- a/test/Java/JAR.py +++ b/test/Java/JAR.py @@ -124,12 +124,7 @@ where_jar = test.java_where_jar() -test.write("wrapper.py", """\ -import os -import sys -open('%s', 'ab').write("wrapper.py %%s\\n" %% " ".join(sys.argv[1:])) -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(tools = ['javac', 'jar'], diff --git a/test/Java/JAVAH.py b/test/Java/JAVAH.py index 81582d7..f647b03 100644 --- a/test/Java/JAVAH.py +++ b/test/Java/JAVAH.py @@ -105,12 +105,7 @@ if java_version: if test.javac_is_gcj: test.skip_test('Test not valid for gcj (gnu java); skipping test(s).\n') -test.write("wrapper.py", """\ -import os -import sys -open('%s', 'ab').write("wrapper.py %%s\\n" %% " ".join(sys.argv[1:])) -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(tools = ['javac', 'javah', 'install'], diff --git a/test/Java/RMIC.py b/test/Java/RMIC.py index 876ed80..5f5decd 100644 --- a/test/Java/RMIC.py +++ b/test/Java/RMIC.py @@ -111,12 +111,7 @@ if java_version.count('.') == 1: # Note, how we allow simple version strings like "5" and # "6" to successfully pass this test. if curver < (1, 8): - test.write("wrapper.py", """\ -import os -import sys -open('%s', 'ab').write("wrapper.py %%s\\n" %% " ".join(sys.argv[1:])) -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(tools = ['javac', 'rmic'], diff --git a/test/LEX/live.py b/test/LEX/live.py index 2abb8ce..3d697d5 100644 --- a/test/LEX/live.py +++ b/test/LEX/live.py @@ -42,11 +42,7 @@ if not lex: -test.write("wrapper.py", """import os -import sys -open('%s', 'wb').write(b"wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment() diff --git a/test/LINK/LINK.py b/test/LINK/LINK.py index 54c75fa..533163c 100644 --- a/test/LINK/LINK.py +++ b/test/LINK/LINK.py @@ -33,12 +33,7 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() -test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write(("wrapper.py\\n").encode()) -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment() diff --git a/test/LINK/SHLINK.py b/test/LINK/SHLINK.py index 7353996..9b546c7 100644 --- a/test/LINK/SHLINK.py +++ b/test/LINK/SHLINK.py @@ -34,12 +34,7 @@ _shlib = TestSCons._dll test = TestSCons.TestSCons() -test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write(b"wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment() diff --git a/test/M4/M4.py b/test/M4/M4.py index d2b8365..4306558 100644 --- a/test/M4/M4.py +++ b/test/M4/M4.py @@ -67,12 +67,7 @@ m4 = test.where_is('m4') if m4: - test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write(b"wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(tools=['default', 'm4'], diff --git a/test/RANLIB/RANLIB.py b/test/RANLIB/RANLIB.py index fbfe36c..8d64b36 100644 --- a/test/RANLIB/RANLIB.py +++ b/test/RANLIB/RANLIB.py @@ -39,12 +39,7 @@ ranlib = test.detect('RANLIB', 'ranlib') if not ranlib: test.skip_test("Could not find 'ranlib', skipping test.\n") -test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(LIBS = ['foo'], LIBPATH = ['.']) diff --git a/test/RANLIB/RANLIBFLAGS.py b/test/RANLIB/RANLIBFLAGS.py index 86e5283..0de0cdc 100644 --- a/test/RANLIB/RANLIBFLAGS.py +++ b/test/RANLIB/RANLIBFLAGS.py @@ -38,12 +38,7 @@ ranlib = test.detect('RANLIB', 'ranlib') if not ranlib: test.skip_test("Could not find 'ranlib', skipping test.\n") -test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(LIBS = ['foo'], LIBPATH = ['.']) diff --git a/test/SWIG/live.py b/test/SWIG/live.py index 7d79bae..5e95dc7 100644 --- a/test/SWIG/live.py +++ b/test/SWIG/live.py @@ -61,12 +61,7 @@ if sys.platform == 'win32' and sys.maxsize <= 2**32: else: swig_arch_var="" -test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """\ foo = Environment(SWIGFLAGS='-python', diff --git a/test/TAR/TAR.py b/test/TAR/TAR.py index 93c5cea..8aa2747 100644 --- a/test/TAR/TAR.py +++ b/test/TAR/TAR.py @@ -88,11 +88,7 @@ tar = test.detect('TAR', 'tar') if tar: - test.write("wrapper.py", """import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment() diff --git a/test/TAR/TARFLAGS.py b/test/TAR/TARFLAGS.py index 96d61fe..034539c 100644 --- a/test/TAR/TARFLAGS.py +++ b/test/TAR/TARFLAGS.py @@ -94,11 +94,7 @@ tar = test.detect('TAR', 'tar') if tar: - test.write("wrapper.py", """import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment() diff --git a/test/TEX/LATEX.py b/test/TEX/LATEX.py index 03d3a00..c6f58e6 100644 --- a/test/TEX/LATEX.py +++ b/test/TEX/LATEX.py @@ -96,11 +96,7 @@ latex = test.where_is('latex') if latex: - test.write("wrapper.py", """import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ import os diff --git a/test/TEX/LATEXFLAGS.py b/test/TEX/LATEXFLAGS.py index f693970..46e0479 100644 --- a/test/TEX/LATEXFLAGS.py +++ b/test/TEX/LATEXFLAGS.py @@ -80,11 +80,7 @@ latex = test.where_is('latex') if latex: - test.write("wrapper.py", """import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ import os diff --git a/test/TEX/PDFLATEX.py b/test/TEX/PDFLATEX.py index dbae623..dece385 100644 --- a/test/TEX/PDFLATEX.py +++ b/test/TEX/PDFLATEX.py @@ -96,11 +96,7 @@ pdflatex = test.where_is('pdflatex') if pdflatex: - test.write("wrapper.py", """import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ import os diff --git a/test/TEX/PDFLATEXFLAGS.py b/test/TEX/PDFLATEXFLAGS.py index deee9ed..ffed20b 100644 --- a/test/TEX/PDFLATEXFLAGS.py +++ b/test/TEX/PDFLATEXFLAGS.py @@ -80,11 +80,7 @@ pdflatex = test.where_is('pdflatex') if pdflatex: - test.write("wrapper.py", """import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ import os diff --git a/test/TEX/PDFTEX.py b/test/TEX/PDFTEX.py index 321a58a..5a958d5 100644 --- a/test/TEX/PDFTEX.py +++ b/test/TEX/PDFTEX.py @@ -83,11 +83,7 @@ pdftex = test.where_is('pdftex') if pdftex: - test.write("wrapper.py", """import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ import os diff --git a/test/TEX/PDFTEXFLAGS.py b/test/TEX/PDFTEXFLAGS.py index ce27e82..06dc780 100644 --- a/test/TEX/PDFTEXFLAGS.py +++ b/test/TEX/PDFTEXFLAGS.py @@ -73,11 +73,7 @@ pdftex = test.where_is('pdftex') if pdftex: - test.write("wrapper.py", """import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ import os diff --git a/test/TEX/TEX.py b/test/TEX/TEX.py index e1d634f..3e48419 100644 --- a/test/TEX/TEX.py +++ b/test/TEX/TEX.py @@ -86,11 +86,7 @@ tex = test.where_is('tex') if tex: - test.write("wrapper.py", """import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ import os diff --git a/test/TEX/TEXFLAGS.py b/test/TEX/TEXFLAGS.py index 7ae86ff..e21aaa9 100644 --- a/test/TEX/TEXFLAGS.py +++ b/test/TEX/TEXFLAGS.py @@ -73,11 +73,7 @@ tex = test.where_is('tex') if tex: - test.write("wrapper.py", """import os -import sys -open('%s', 'wb').write("wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) + test.file_fixture('wrapper.py') test.write('SConstruct', """ import os diff --git a/test/YACC/live.py b/test/YACC/live.py index e125daa..253a387 100644 --- a/test/YACC/live.py +++ b/test/YACC/live.py @@ -40,12 +40,7 @@ yacc = test.where_is('yacc') or test.where_is('bison') if not yacc: test.skip_test('No yacc or bison found; skipping test.\n') -test.write("wrapper.py", -"""import os -import sys -open('%s', 'wb').write(b"wrapper.py\\n") -os.system(" ".join(sys.argv[1:])) -""" % test.workpath('wrapper.out').replace('\\', '\\\\')) +test.file_fixture('wrapper.py') test.write('SConstruct', """ foo = Environment(YACCFLAGS='-d') |