diff options
author | Joseph Brill <48932340+jcbrill@users.noreply.github.com> | 2024-10-20 11:19:05 (GMT) |
---|---|---|
committer | Joseph Brill <48932340+jcbrill@users.noreply.github.com> | 2024-10-20 11:19:05 (GMT) |
commit | c815981f684ee98483b5fe85675e01954ff81aff (patch) | |
tree | 55350a63e5f3d97b5f802ebbce23c9e8896dfec5 /test | |
parent | da65616846b54e1e84d508823b58740dcbf9d3ca (diff) | |
parent | 29730012bd763884ae664a3981f3fa717dabf90a (diff) | |
download | SCons-c815981f684ee98483b5fe85675e01954ff81aff.zip SCons-c815981f684ee98483b5fe85675e01954ff81aff.tar.gz SCons-c815981f684ee98483b5fe85675e01954ff81aff.tar.bz2 |
Merge branch 'master' into jbrill-msvs-tests
Diffstat (limited to 'test')
-rw-r--r-- | test/AS/nasm.py | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/test/AS/nasm.py b/test/AS/nasm.py index 4d93c7f..09090b6 100644 --- a/test/AS/nasm.py +++ b/test/AS/nasm.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 correct use of the live 'nasm' assembler. @@ -39,7 +38,6 @@ _exe = TestSCons._exe test = TestSCons.TestSCons() nasm = test.where_is('nasm') - if not nasm: test.skip_test('nasm not found; skipping test\n') @@ -77,25 +75,26 @@ for k, v in format_map.items(): test.file_fixture('wrapper.py') -test.write('SConstruct', """ -eee = Environment(tools = ['gcc', 'gnulink', 'nasm'], - CFLAGS = ['-m32'], - LINKFLAGS = '-m32', - ASFLAGS = '-f %(nasm_format)s') -fff = eee.Clone(AS = r'%(_python_)s wrapper.py ' + WhereIs('nasm')) -eee.Program(target = 'eee', source = ['eee.asm', 'eee_main.c']) -fff.Program(target = 'fff', source = ['fff.asm', 'fff_main.c']) -""" % locals()) - -test.write('eee.asm', -""" +test.write('SConstruct', f"""\ +_ = DefaultEnvironment(tools=[]) +eee = Environment( + tools=['gcc', 'gnulink', 'nasm'], + CFLAGS=['-m32'], + LINKFLAGS='-m32', + ASFLAGS='-f {nasm_format}', +) +fff = eee.Clone(AS=r'{_python_} wrapper.py ' + WhereIs('nasm')) +eee.Program(target='eee', source=['eee.asm', 'eee_main.c']) +fff.Program(target='fff', source=['fff.asm', 'fff_main.c']) +""") + +test.write('eee.asm', """\ global name name: db 'eee.asm',0 """) -test.write('fff.asm', -""" +test.write('fff.asm', """\ global name name: db 'fff.asm',0 @@ -103,6 +102,8 @@ name: test.write('eee_main.c', r""" #include <stdio.h> +#include <stdlib.h> + extern char name[]; int @@ -129,20 +130,16 @@ main(int argc, char *argv[]) } """) -test.run(arguments = 'eee' + _exe, stderr = None) - -test.run(program = test.workpath('eee'), stdout = "eee_main.c eee.asm\n") +test.run(arguments='eee' + _exe, stderr=None) +test.run(program=test.workpath('eee'), stdout="eee_main.c eee.asm\n") test.must_not_exist('wrapper.out') -test.run(arguments = 'fff' + _exe) - -test.run(program = test.workpath('fff'), stdout = "fff_main.c fff.asm\n") +test.run(arguments='fff' + _exe) +test.run(program=test.workpath('fff'), stdout="fff_main.c fff.asm\n") test.must_match('wrapper.out', "wrapper.py\n") - - test.pass_test() # Local Variables: |