diff --git a/CHANGES.txt b/CHANGES.txt index cebc9728ff..85c494e7ba 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -52,6 +52,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER cl.exe-compatible command line switches. - Some manpage cleanup for the gettext and pdf/ps builders. - Some clarifications in the User Guide "Environments" chapter. + - Fix nasm test for missing include file, cleanup. From Alex James: - On Darwin, PermissionErrors are now handled while trying to access diff --git a/RELEASE.txt b/RELEASE.txt index d27c18ad6c..71c52eb5a4 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -55,6 +55,8 @@ FIXES /etc/paths.d. This may occur if SCons is invoked in a sandboxed environment (such as Nix). +- Fix nasm test for missing include file, cleanup. + IMPROVEMENTS ------------ diff --git a/test/AS/nasm.py b/test/AS/nasm.py index 4d93c7f897..09090b6e60 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 @@ test = TestSCons.TestSCons() nasm = test.where_is('nasm') - if not nasm: test.skip_test('nasm not found; skipping test\n') @@ -77,25 +75,26 @@ 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 @@ test.write('eee_main.c', r""" #include +#include + extern char name[]; int @@ -129,20 +130,16 @@ } """) -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: