summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2024-10-05 14:24:55 (GMT)
committerMats Wichmann <mats@linux.com>2024-10-06 18:03:51 (GMT)
commitfab319152a9a6e7e71da740558dd76af681a0096 (patch)
tree81e1f0849113d87f9317ff289ec21bcf54d129dd /test
parentfc36781173e80c99774284c653557c6cb9675c88 (diff)
downloadSCons-fab319152a9a6e7e71da740558dd76af681a0096.zip
SCons-fab319152a9a6e7e71da740558dd76af681a0096.tar.gz
SCons-fab319152a9a6e7e71da740558dd76af681a0096.tar.bz2
Fix nasm test [skip appveyor]
Fix reported problem of missing header (no declaration for exit()). Clean up to current styles. Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test')
-rw-r--r--test/AS/nasm.py51
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: