Skip to content

Commit

Permalink
Merge pull request #158 from rossburton/master
Browse files Browse the repository at this point in the history
Improvements to the test suite
  • Loading branch information
ebassi authored Mar 12, 2018
2 parents 6c6fcd3 + f9098b0 commit 6769ba2
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 17 deletions.
12 changes: 6 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ AS_CASE([$host_os],

[darwin*], [
build_wgl=no
build_apple=yes
has_znow=no
EPOXY_LINK_LIBS=""
],
Expand Down Expand Up @@ -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])
Expand All @@ -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"],

Expand Down
8 changes: 4 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Empty file modified src/gen_dispatch.py
100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
$()
Expand All @@ -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
Expand Down
9 changes: 6 additions & 3 deletions test/meson.build
Original file line number Diff line number Diff line change
@@ -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()
Expand Down Expand Up @@ -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
Expand All @@ -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 = [
Expand Down

0 comments on commit 6769ba2

Please sign in to comment.