Skip to content

Commit

Permalink
lit tests: Drop support for gdb < 8 and dependency on distutils pip p…
Browse files Browse the repository at this point in the history
…ackage

Fixes ldc-developers#4671.
  • Loading branch information
kinke committed Jun 8, 2024
1 parent 49e5732 commit ee300ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
2 changes: 0 additions & 2 deletions tests/debuginfo/print_gdb.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// REQUIRES: atleast_gdb80

// This test fails due to newer version of GDB, see https://github.com/ldc-developers/ldc/issues/4389
// XFAIL: FreeBSD

Expand Down
22 changes: 8 additions & 14 deletions tests/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import string
import re
import subprocess
import glob
from distutils.version import LooseVersion

# Cmake Boolean options
ON = True
Expand Down Expand Up @@ -203,19 +202,14 @@ if (platform.system() == 'Windows') and os.path.isfile( cdb ):
# Check whether GDB is present
if (platform.system() != 'Windows') and lit.util.which('gdb', config.environment['PATH']):
config.available_features.add('gdb')
gdb_dflags = ''
command = ['gdb', '--version']
p = subprocess.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, universal_newlines=True)
text = p.stdout.readline()
m = re.compile('[^0-9]*([0-9]+[0-9.]*).*').match(text)
if m is not None:
gdb_version = m.group(1)
if LooseVersion(gdb_version) < LooseVersion('7.8'):
gdb_dflags = '-dwarf-version=2'
elif LooseVersion(gdb_version) >= LooseVersion('8.0'):
config.available_features.add('atleast_gdb80')

gdb_dflags = '' # for gdb-version-dependant flags
#command = ['gdb', '--version']
#p = subprocess.Popen(command, stdout=subprocess.PIPE,
# stderr=subprocess.PIPE, universal_newlines=True)
#text = p.stdout.readline()
#m = re.compile('[^0-9]*([0-9]+[0-9.]*).*').match(text)
#if m is not None:
# gdb_version = m.group(1)
config.substitutions.append( ('%_gdb_dflags', gdb_dflags) )

if 'LD_LIBRARY_PATH' in os.environ:
Expand Down

0 comments on commit ee300ac

Please sign in to comment.