summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2012-02-02 14:11:08 +0100
committerEric Anholt <eric@anholt.net>2012-09-17 12:32:51 -0700
commit5dafee1853b6eac164f69d4e65658dc34785ccf9 (patch)
tree5b6500bef94e0bf111d274e68a6007f21aa2d7a4
parent3f98ba9c43eabf6f88d15375cfc80ee35c425077 (diff)
downloadexternal_mesa3d-5dafee1853b6eac164f69d4e65658dc34785ccf9.zip
external_mesa3d-5dafee1853b6eac164f69d4e65658dc34785ccf9.tar.gz
external_mesa3d-5dafee1853b6eac164f69d4e65658dc34785ccf9.tar.bz2
dri: Reuse dri_test.c for stub glapi symbols for unit testing.
This file is used to provide stubs for the link test in gallium dri drivers. But the same stubs without the main can be used for making unit tests for code in a dri driver. Acked-by: Paul Berry <stereotype441@gmail.com>
-rw-r--r--src/mesa/drivers/dri/common/Makefile.am8
-rw-r--r--src/mesa/drivers/dri/common/dri_test.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/common/Makefile.am b/src/mesa/drivers/dri/common/Makefile.am
index d81bc0e..6e9d738 100644
--- a/src/mesa/drivers/dri/common/Makefile.am
+++ b/src/mesa/drivers/dri/common/Makefile.am
@@ -28,11 +28,17 @@ AM_CFLAGS = \
$(API_DEFINES) \
$(LIBDRM_CFLAGS)
-noinst_LTLIBRARIES = libdricommon.la
+noinst_LTLIBRARIES = \
+ libdricommon.la \
+ libdri_test_stubs.la
libdricommon_la_SOURCES = \
utils.c \
dri_util.c \
xmlconfig.c
+libdri_test_stubs_la_SOURCES = \
+ dri_test.c
+libdri_test_stubs_la_CFLAGS = $(AM_CFLAGS) -DNO_MAIN
+
sysconf_DATA = drirc
diff --git a/src/mesa/drivers/dri/common/dri_test.c b/src/mesa/drivers/dri/common/dri_test.c
index 793f0c3..3573285 100644
--- a/src/mesa/drivers/dri/common/dri_test.c
+++ b/src/mesa/drivers/dri/common/dri_test.c
@@ -82,8 +82,10 @@ _glthread_GetID(void)
return 0;
}
+#ifndef NO_MAIN
int main(int argc, char** argv)
{
void* p = __driDriverExtensions;
return (int)(unsigned long)p;
}
+#endif