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>
This commit is contained in:
Eric Anholt
2012-02-02 14:11:08 +01:00
parent 3f98ba9c43
commit 5dafee1853
2 changed files with 9 additions and 1 deletions
+7 -1
View File
@@ -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
+2
View File
@@ -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