Skip to content

Commit

Permalink
Fix test/AS/nasm.py as it previously would only run with nasm version…
Browse files Browse the repository at this point in the history
… 0.98
  • Loading branch information
bdbaddog committed Aug 20, 2018
1 parent 90b2852 commit 9968415
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/AS/nasm.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@
test.skip_test("skipping test on non-Linux platform '%s'\n" % sys.platform)

try:
import popen2
stdout = popen2.popen2('nasm -v')[0]
import subprocess
stdout = subprocess.check_output(['nasm','-v'])
except OSError:
test.skip_test('could not determine nasm version; skipping test\n')
else:
version = stdout.read().split()[2]
if version[:4] != '0.98':
version = stdout.split()[2].split('.')
if int(version[0]) ==0 and int(version[1]) < 98:
test.skip_test("skipping test of nasm version %s\n" % version)

machine = os.uname()[4]
if not machine in ('i386', 'i486', 'i586', 'i686'):
if not machine in ('i386', 'i486', 'i586', 'i686', 'x86_64'):
fmt = "skipping test of nasm %s on non-x86 machine '%s'\n"
test.skip_test(fmt % (version, machine))

Expand All @@ -78,6 +78,8 @@

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'])
Expand All @@ -99,6 +101,7 @@
""")

test.write('eee_main.c', r"""
#include <stdio.h>
extern char name[];
int
Expand Down

0 comments on commit 9968415

Please sign in to comment.