test: check for CAP_SYS_PTRACE before testing for an attached debugger

If we don't have the capability to ptrace, we are probably running inside a
container, not the debugger. Check this first so we don't disable forking
mode.

Make this conditional on libcap - where libcap is not available always assume
we *do not* have a debugger attached. This is easier than telling everyone who
runs the tests in a confined system to install libcap.

Fixes #1285
This commit is contained in:
Peter Hutterer 2021-06-10 16:11:43 +10:00 committed by Wim Taymans
parent 2d238f1d33
commit 7177d82c34
3 changed files with 19 additions and 1 deletions

View file

@ -323,6 +323,11 @@ sndfile_dep = dependency('sndfile', version : '>= 1.0.20', required : get_option
pulseaudio_dep = dependency('libpulse', required : get_option('libpulse'))
avahi_dep = dependency('avahi-client', required : get_option('avahi'))
cap_lib = dependency('libcap', required : false)
if cap_lib.found()
cdata.set('HAVE_LIBCAP', 1)
endif
gst_option = get_option('gstreamer')
gst_deps_def = {
'glib-2.0': {'version': '>=2.32.0'},