aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYaron Cohen-Tal <yaronct@gmail.com>2015-07-18 12:00:06 +0300
committerYaron Cohen-Tal <yaronct@gmail.com>2015-07-18 17:39:12 +0300
commit773dd02f596b3f256bb1c0f65ac091db93a9518b (patch)
tree16e4d3260145e7f515bb97f2ab965e61ce0c63bf /test
parent8bbc0d40c6c4e023e71ac8bfe7f5898005cac920 (diff)
downloadlibepoxy-773dd02f596b3f256bb1c0f65ac091db93a9518b.tar.gz
Added makefiles to build with MSVC 2013, and fixed errors and warnings.
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.sources73
-rw-r--r--test/Makefile.vc68
-rw-r--r--test/khronos_typedefs_nonepoxy.c2
3 files changed, 143 insertions, 0 deletions
diff --git a/test/Makefile.sources b/test/Makefile.sources
new file mode 100644
index 0000000..a279e96
--- /dev/null
+++ b/test/Makefile.sources
@@ -0,0 +1,73 @@
+# Copyright © 2014 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+EGL_TESTS_PROGS = \
+ egl_has_extension_nocontext \
+ egl_gl \
+ egl_gles1_without_glx \
+ egl_gles2_without_glx
+
+EGL_GLX_TEST_PROGS = \
+ egl_and_glx_different_pointers_egl_glx \
+ egl_and_glx_different_pointers_egl \
+ egl_and_glx_different_pointers_glx
+
+GLX_TEST_PROGS = \
+ glx_beginend \
+ glx_public_api \
+ glx_public_api_core \
+ glx_glxgetprocaddress_nocontext \
+ glx_has_extension_nocontext \
+ glx_static
+
+GLX_NON_APPLE_PROGS = \
+ glx_alias_prefer_same_name \
+ glx_gles2
+
+WGL_TEST_PROGS = \
+ wgl_core_and_exts$(EXEEXT) \
+ wgl_per_context_funcptrs$(EXEEXT) \
+ wgl_usefontbitmaps$(EXEEXT) \
+ wgl_usefontbitmaps_unicode$(EXEEXT)
+
+GENERIC_TEST_PROGS = \
+ headerguards$(EXEEXT) \
+ miscdefines$(EXEEXT) \
+ khronos_typedefs$(EXEEXT)
+
+DLWRAP_SRC = dlwrap.c dlwrap.h
+
+KHRONOS_TYPEDEF_SRC = \
+ khronos_typedefs.c \
+ khronos_typedefs.h \
+ khronos_typedefs_nonepoxy.c
+
+EGL_COMMON_SRC = \
+ egl_common.c \
+ egl_common.h
+
+GLX_COMMON_SRC = \
+ glx_common.c \
+ glx_common.h
+
+WGL_COMMON_SRC = \
+ wgl_common.c \
+ wgl_common.h
diff --git a/test/Makefile.vc b/test/Makefile.vc
new file mode 100644
index 0000000..46974b6
--- /dev/null
+++ b/test/Makefile.vc
@@ -0,0 +1,68 @@
+# Copyright © 2015 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+# Note: To build and use libepoxy for Visual Studio prior to Visual Studio 2013,
+# you need to ensure that you have stdint.h, inttypes.h and stdbool.h
+# that will work for your installation of Visual Studio, which can be
+# found by the compiler. One possibility would be to use msinttypes
+# and adapting gnulib's stdbool.h.in for your use.
+
+!include ..\msvc\detectenv-msvc.mak
+!include Makefile.sources
+
+EXEEXT = .exe
+
+all: config.h wgl_common.lib $(GENERIC_TEST_PROGS) $(WGL_TEST_PROGS)
+
+LD_CFLAGS = /link
+LDFLAGS = /libpath:..\src epoxy.lib gdi32.lib user32.lib $(EXTRA_LDFLAGS)
+
+CFLAGS_INCLUDES_TESTS = /I.
+
+khronos_typedefs.exe: $(KHRONOS_TYPEDEF_SRC) config.h
+ $(CC) $(CFLAGS_ADD) $(CFLAGS_INCLUDES_TESTS) $(CFLAGS_C99_COMPAT) khronos_typedefs.c khronos_typedefs_nonepoxy.c /c
+ link /DEBUG $(EXTRA_LDFLAGS) $*.obj $*_nonepoxy.obj /out:$@
+ @if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
+
+wgl_usefontbitmaps_unicode.exe: wgl_usefontbitmaps.c wgl_common.lib config.h
+ $(CC) $(CFLAGS_ADD) $(CFLAGS_INCLUDES_TESTS) $(CFLAGS_C99_COMPAT) /DUNICODE wgl_usefontbitmaps.c /Fe$@ $(LD_CFLAGS) $(LDFLAGS) wgl_common.lib
+ @if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
+
+wgl_common.lib: $(WGL_COMMON_SRC)
+ $(CC) $(CFLAGS_ADD) $(CFLAGS_INCLUDES_TESTS) $(CFLAGS_C99_COMPAT) /c wgl_common.c
+ lib wgl_common.obj /out:$@
+
+.c$(EXEEXT):
+ $(CC) $(CFLAGS_ADD) $(CFLAGS_INCLUDES_TESTS) $(CFLAGS_C99_COMPAT) $< $(LD_CFLAGS) $(LDFLAGS) wgl_common.lib
+ @if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
+
+config.h:
+ @echo #define BUILD_WGL 1 > config.h
+
+clean:
+ @-del *.lib
+ @-del *.exp
+ @-del *.exe
+ @-if exist *.exe.manifest del *.exe.manifest
+ @-del *.ilk
+ @-del *.pdb
+ @-del *.obj
+ @-del config.h
diff --git a/test/khronos_typedefs_nonepoxy.c b/test/khronos_typedefs_nonepoxy.c
index 64d5a1b..5386101 100644
--- a/test/khronos_typedefs_nonepoxy.c
+++ b/test/khronos_typedefs_nonepoxy.c
@@ -56,8 +56,10 @@ get_system_typedef_sizes(uint32_t *sizes)
#else /* !HAVE_KHRPLATFORM_H */
+#ifndef _MSC_VER
/* Don't care -- this is a conditional case in test code. */
#pragma GCC diagnostic ignored "-Wsuggest-attribute=noreturn"
+#endif
void
get_system_typedef_sizes(uint32_t *sizes)