summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gmail.com>2018-03-12 12:17:47 +0000
committerGitHub <noreply@github.com>2018-03-12 12:17:47 +0000
commit6769ba25bc2c5db15ef1485133df8ae6999a78b3 (patch)
treed156627e9ca0103870de7350e3994f3bbdc3b9ae
parent6c6fcd3b12ab44f97e57ba8a8c35447570f633f8 (diff)
parentf9098b0c1866eba179ad124884aeb146eae30d0a (diff)
downloadlibepoxy-6769ba25bc2c5db15ef1485133df8ae6999a78b3.tar.gz
Merge pull request #158 from rossburton/master
Improvements to the test suite
-rw-r--r--configure.ac12
-rw-r--r--meson.build8
-rw-r--r--meson_options.txt4
-rwxr-xr-x[-rw-r--r--]src/gen_dispatch.py0
-rw-r--r--test/Makefile.am8
-rw-r--r--test/meson.build9
6 files changed, 24 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index ee882c5..1af6445 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,7 +137,6 @@ AS_CASE([$host_os],
[darwin*], [
build_wgl=no
- build_apple=yes
has_znow=no
EPOXY_LINK_LIBS=""
],
@@ -177,11 +176,6 @@ if test x$build_wgl = xyes; then
AC_DEFINE([BUILD_WGL], [1], [build WGL tests])
fi
-AM_CONDITIONAL(BUILD_APPLE, test x$build_apple = xyes)
-if test x$build_apple = xyes; then
- AC_DEFINE([BUILD_APPLE], [1], [build APPLE is apple (for testing)])
-fi
-
AM_CONDITIONAL(HAS_ZNOW, test x$has_znow = xyes)
AC_CHECK_LIB([GLESv1_CM], [glFlush], [has_gles1=yes], [has_gles1=no])
@@ -190,6 +184,12 @@ AM_CONDITIONAL(HAS_GLES1, test x$has_gles1 = xyes)
AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])
AC_SUBST([DLOPEN_LIBS])
+savelibs=$LIBS
+LIBS=$DLOPEN_LIBS
+AC_CHECK_FUNCS([dlvsym], [have_dlvsym=1], [have_dlvsym=0])
+AM_CONDITIONAL(HAVE_DLVSYM, test $have_dlvsym = 1)
+LIBS=$savelibs
+
VISIBILITY_CFLAGS=""
AS_CASE(["$host"],
diff --git a/meson.build b/meson.build
index b2ebaef..ceac94f 100644
--- a/meson.build
+++ b/meson.build
@@ -81,15 +81,12 @@ endif
# The remaining platform specific API for GL/GLES are enabled
# depending on the platform we're building for
if host_system == 'windows'
- build_apple = false
build_wgl = true
has_znow = true
elif host_system == 'darwin'
- build_apple = true
build_wgl = false
has_znow = false
else
- build_apple = false
build_wgl = false
has_znow = true
endif
@@ -242,7 +239,10 @@ libepoxy_inc = [
subdir('include/epoxy')
subdir('src')
-subdir('test')
+
+if get_option('tests')
+ subdir('test')
+endif
if get_option('docs')
doxygen = find_program('doxygen', required: false)
diff --git a/meson_options.txt b/meson_options.txt
index b5d7c98..dc30e68 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -15,3 +15,7 @@ option('x11',
type: 'boolean',
value: true,
description: 'Enable X11 support (GLX or EGL-X11)')
+option('tests',
+ type: 'boolean',
+ value: true,
+ description: 'Build the test suite')
diff --git a/src/gen_dispatch.py b/src/gen_dispatch.py
index 28dad2b..28dad2b 100644..100755
--- a/src/gen_dispatch.py
+++ b/src/gen_dispatch.py
diff --git a/test/Makefile.am b/test/Makefile.am
index d0c1a5d..1513099 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -96,7 +96,7 @@ endif
if BUILD_EGL
if BUILD_GLX
-if !BUILD_APPLE
+if HAVE_DLVSYM
EGL_AND_GLX_TESTS = \
egl_gl \
egl_and_glx_different_pointers_egl_glx \
@@ -107,8 +107,8 @@ endif
endif
endif
-if !BUILD_APPLE
-GLX_NON_APPLE_TESTS = \
+if HAVE_DLVSYM
+GLX_DLVSYM_TESTS = \
glx_alias_prefer_same_name \
glx_gles2 \
$()
@@ -122,7 +122,7 @@ GLX_TESTS = \
glx_has_extension_nocontext \
glx_static \
$(GLX_SHARED_ZNOW) \
- $(GLX_NON_APPLE_TESTS) \
+ $(GLX_DLVSYM_TESTS) \
$()
GLX_UTIL_LIB = libglx_common.la
diff --git a/test/meson.build b/test/meson.build
index c5788b4..62f2f3d 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -1,3 +1,6 @@
+dl_dep = cc.find_library('dl', required: false)
+has_dlvsym = cc.has_function('dlvsym', dependencies: dl_dep)
+
has_gles1 = gles1_dep.found()
has_gles2 = gles2_dep.found()
build_x11_tests = enable_x11 and x11_dep.found()
@@ -92,8 +95,8 @@ if build_glx
[ 'glx_has_extension_nocontext', [ 'glx_has_extension_nocontext.c' ], [], [], true ],
[ 'glx_static', [ 'glx_static.c' ], [ '-DNEEDS_TO_BE_STATIC'], [ '-static' ], libtype == 'static' ],
[ 'glx_shared_znow', [ 'glx_static.c', ], [], [ '-Wl,-z,now' ], has_znow ],
- [ 'glx_alias_prefer_same_name', [ 'glx_alias_prefer_same_name.c', 'dlwrap.c', 'dlwrap.h' ], [], [ '-rdynamic' ], not build_apple ],
- [ 'glx_gles2', [ 'glx_gles2.c', 'dlwrap.c', 'dlwrap.h' ], [], [ '-rdynamic' ], not build_apple ],
+ [ 'glx_alias_prefer_same_name', [ 'glx_alias_prefer_same_name.c', 'dlwrap.c', 'dlwrap.h' ], [], [ '-rdynamic' ], has_dlvsym ],
+ [ 'glx_gles2', [ 'glx_gles2.c', 'dlwrap.c', 'dlwrap.h' ], [], [ '-rdynamic' ], has_dlvsym ],
]
foreach test: glx_tests
@@ -114,7 +117,7 @@ if build_glx
endif
endforeach
- if not build_apple
+ if has_dlvsym
# GLX/EGL tests
if build_egl
glx_egl_sources = [