summaryrefslogtreecommitdiffstats
path: root/test/AS/ASCOMSTR.py
diff options
context:
space:
mode:
authorWilliam Blevins <wblevins001@gmail.com>2016-10-03 06:08:04 (GMT)
committerWilliam Blevins <wblevins001@gmail.com>2016-10-03 06:08:04 (GMT)
commit5587089a661a520a32c353ea886939cd63a0636a (patch)
tree22bf17e710505ff6f6bcf5cc4aa7badfc958d5f2 /test/AS/ASCOMSTR.py
parent6dd3fd8b838d18d65edd6e7adabf3a363437f8a9 (diff)
downloadSCons-5587089a661a520a32c353ea886939cd63a0636a.zip
SCons-5587089a661a520a32c353ea886939cd63a0636a.tar.gz
SCons-5587089a661a520a32c353ea886939cd63a0636a.tar.bz2
Moved common my<xxx>.py functions to global fixture and resolve byte/str.
Diffstat (limited to 'test/AS/ASCOMSTR.py')
-rw-r--r--test/AS/ASCOMSTR.py23
1 files changed, 6 insertions, 17 deletions
diff --git a/test/AS/ASCOMSTR.py b/test/AS/ASCOMSTR.py
index 39b963f..2aab94c 100644
--- a/test/AS/ASCOMSTR.py
+++ b/test/AS/ASCOMSTR.py
@@ -37,16 +37,7 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
-
-
-test.write('myas.py', r"""
-import sys
-infile = open(sys.argv[2], 'rb')
-outfile = open(sys.argv[1], 'wb')
-for l in [l for l in infile.readlines() if l != b"#as\n"]:
- outfile.write(l)
-sys.exit(0)
-""")
+test.file_fixture('mycompile.py')
if os.path.normcase('.s') == os.path.normcase('.S'):
alt_s_suffix = '.S'
@@ -56,7 +47,7 @@ else:
alt_asm_suffix = '.asm'
test.write('SConstruct', """
-env = Environment(ASCOM = r'%(_python_)s myas.py $TARGET $SOURCE',
+env = Environment(ASCOM = r'%(_python_)s mycompile.py as $TARGET $SOURCE',
ASCOMSTR = 'Assembling $TARGET from $SOURCE',
OBJSUFFIX = '.obj')
env.Object(target = 'test1', source = 'test1.s')
@@ -65,10 +56,10 @@ env.Object(target = 'test3', source = 'test3.asm')
env.Object(target = 'test4', source = 'test4%(alt_asm_suffix)s')
""" % locals())
-test.write('test1.s', "test1.s\n#as\n")
-test.write('test2'+alt_s_suffix, "test2.S\n#as\n")
-test.write('test3.asm', "test3.asm\n#as\n")
-test.write('test4'+alt_asm_suffix, "test4.ASM\n#as\n")
+test.write('test1.s', "test1.s\n/*as*/\n")
+test.write('test2'+alt_s_suffix, "test2.S\n/*as*/\n")
+test.write('test3.asm', "test3.asm\n/*as*/\n")
+test.write('test4'+alt_asm_suffix, "test4.ASM\n/*as*/\n")
test.run(stdout = test.wrap_stdout("""\
Assembling test1.obj from test1.s
@@ -82,8 +73,6 @@ test.must_match('test2.obj', "test2.S\n")
test.must_match('test3.obj', "test3.asm\n")
test.must_match('test4.obj', "test4.ASM\n")
-
-
test.pass_test()
# Local Variables: