summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-09-29 13:32:17 -0700
committerEric Anholt <eric@anholt.net>2009-09-29 13:40:44 -0700
commitc9eafa83c3dc04178545acc54b677420e8ae06fa (patch)
tree20d3409a1b9c85e94589c7d2edea21306f4d7323
parentdc1d9ed1a264441e67965a02d3438c33d5302b7b (diff)
Replace the copy-and-pasted header setup with consistent use of piglit-util.h.
-rw-r--r--tests/asmparsertest/asmparsertest.c9
-rw-r--r--tests/bugs/crash-cubemap-order.c12
-rw-r--r--tests/bugs/crash-texparameter-before-teximage.c11
-rw-r--r--tests/bugs/fdo10370.c9
-rw-r--r--tests/bugs/fdo14575.c14
-rw-r--r--tests/bugs/fdo20701.c10
-rw-r--r--tests/bugs/fdo22540.c11
-rw-r--r--tests/bugs/fdo23489.c8
-rw-r--r--tests/bugs/fdo23670-drawpix_stencil.c10
-rw-r--r--tests/bugs/fdo24066.c10
-rw-r--r--tests/bugs/fdo9833.c9
-rw-r--r--tests/bugs/point-sprite.c10
-rw-r--r--tests/bugs/r300-readcache.c12
-rw-r--r--tests/bugs/tex1d-2dborder.c12
-rw-r--r--tests/fbo/fbo-1d.c13
-rw-r--r--tests/fbo/fbo-3d.c12
-rw-r--r--tests/fbo/fbo-cubemap.c12
-rw-r--r--tests/fbo/fbo-generatemipmap.c12
-rw-r--r--tests/fbo/fbo-readpixels.c12
-rw-r--r--tests/general/bgra-sec-color-pointer.c11
-rw-r--r--tests/general/bgra-vert-attrib-pointer.c11
-rw-r--r--tests/general/clear-varray-2.0.c12
-rw-r--r--tests/general/depth_clamp.c9
-rw-r--r--tests/general/depthrange-clear.c9
-rw-r--r--tests/general/dlist-clear.c9
-rw-r--r--tests/general/draw-elements-base-vertex.c11
-rw-r--r--tests/general/linestipple.c12
-rw-r--r--tests/general/occlusion_query.c11
-rw-r--r--tests/general/pbo-drawpixels.c10
-rw-r--r--tests/general/pbo-teximage.c10
-rw-r--r--tests/general/provoking-vertex.c13
-rw-r--r--tests/general/read-front.c9
-rw-r--r--tests/general/scissor-copypixels.c9
-rw-r--r--tests/general/scissor-depth-clear.c9
-rw-r--r--tests/general/scissor-stencil-clear.c9
-rw-r--r--tests/general/stencil-drawpixels.c10
-rw-r--r--tests/general/sync_api.c13
-rw-r--r--tests/general/texgen.c12
-rw-r--r--tests/general/varray-disabled.c11
-rw-r--r--tests/general/vbo-map-remap.c10
-rw-r--r--tests/general/vbo-subdata-sync.c10
-rw-r--r--tests/general/windowoverlap.c12
-rw-r--r--tests/glslparsertest/glslparsertest.c11
-rw-r--r--tests/shaders/fp-abs-01.c13
-rw-r--r--tests/shaders/fp-abs-02.c13
-rw-r--r--tests/shaders/fp-condition_codes-01.c9
-rw-r--r--tests/shaders/fp-fog.c12
-rw-r--r--tests/shaders/fp-fragment-position.c11
-rw-r--r--tests/shaders/fp-generic.c12
-rw-r--r--tests/shaders/fp-incomplete-tex.c11
-rw-r--r--tests/shaders/fp-indirections.c10
-rw-r--r--tests/shaders/fp-indirections2.c10
-rw-r--r--tests/shaders/fp-kil.c11
-rw-r--r--tests/shaders/fp-lit-mask.c11
-rw-r--r--tests/shaders/fp-rfl.c11
-rw-r--r--tests/shaders/fp-set-01.c13
-rw-r--r--tests/shaders/fp-set-02.c13
-rw-r--r--tests/shaders/fp-unpack-01.c13
-rw-r--r--tests/shaders/glsl-bug-22603.c14
-rw-r--r--tests/shaders/glsl-deriv-varyings.c10
-rw-r--r--tests/shaders/glsl-derivs.c10
-rw-r--r--tests/shaders/glsl-dlist-getattriblocation.c10
-rw-r--r--tests/shaders/glsl-empty-vs-no-fs.c11
-rw-r--r--tests/shaders/glsl-fs-exp2.c14
-rw-r--r--tests/shaders/glsl-fs-fragcoord.c14
-rw-r--r--tests/shaders/glsl-fs-log2.c14
-rw-r--r--tests/shaders/glsl-fwidth.c10
-rw-r--r--tests/shaders/glsl-lod-bias.c10
-rw-r--r--tests/shaders/glsl-uniform-update.c14
-rw-r--r--tests/shaders/glsl-unused-varying.c14
-rw-r--r--tests/shaders/glsl-vs-if-bool.c14
-rw-r--r--tests/shaders/glsl-vs-if.c14
-rw-r--r--tests/shaders/glsl-vs-loop.c14
-rw-r--r--tests/shaders/trinity-fp1.c12
-rw-r--r--tests/shaders/vp-bad-program.c13
-rw-r--r--tests/shaders/vp-ignore-input.c11
-rw-r--r--tests/texturing/copytexsubimage.c10
-rw-r--r--tests/texturing/cubemap.c9
-rw-r--r--tests/texturing/depth-tex-compare.c10
-rw-r--r--tests/texturing/depth-tex-modes-glsl.c11
-rw-r--r--tests/texturing/depth-tex-modes.c10
-rw-r--r--tests/texturing/gen-compressed-teximage.c9
-rw-r--r--tests/texturing/gen-teximage.c9
-rw-r--r--tests/texturing/gen-texsubimage.c9
-rw-r--r--tests/texturing/getteximage-simple.c12
-rw-r--r--tests/texturing/lodbias.c12
-rw-r--r--tests/texturing/tex3d.c12
-rw-r--r--tests/texturing/texdepth.c12
-rw-r--r--tests/texturing/texrect-many.c14
-rw-r--r--tests/texturing/texredefine.c10
-rw-r--r--tests/texturing/tfp.c6
-rw-r--r--tests/util/piglit-util.h13
92 files changed, 26 insertions, 999 deletions
diff --git a/tests/asmparsertest/asmparsertest.c b/tests/asmparsertest/asmparsertest.c
index 55bd65450..dcbef6a6f 100644
--- a/tests/asmparsertest/asmparsertest.c
+++ b/tests/asmparsertest/asmparsertest.c
@@ -21,17 +21,8 @@
* DEALINGS IN THE SOFTWARE.
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
#include <ctype.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
#include "piglit-util.h"
#ifndef TRUE
diff --git a/tests/bugs/crash-cubemap-order.c b/tests/bugs/crash-cubemap-order.c
index e13df3754..d7d254c0e 100644
--- a/tests/bugs/crash-cubemap-order.c
+++ b/tests/bugs/crash-cubemap-order.c
@@ -6,20 +6,8 @@
* This bug existed in the R300 driver and was triggered by Sauerbraten.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
-
static int Width = 100, Height = 100;
static void Display(void)
diff --git a/tests/bugs/crash-texparameter-before-teximage.c b/tests/bugs/crash-texparameter-before-teximage.c
index 1770f30ec..ffa887605 100644
--- a/tests/bugs/crash-texparameter-before-teximage.c
+++ b/tests/bugs/crash-texparameter-before-teximage.c
@@ -7,17 +7,6 @@
* This bug was originally triggered by Glest.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
diff --git a/tests/bugs/fdo10370.c b/tests/bugs/fdo10370.c
index 6eb43220a..c89cfe4aa 100644
--- a/tests/bugs/fdo10370.c
+++ b/tests/bugs/fdo10370.c
@@ -3,14 +3,7 @@
* http://bugs.freedesktop.org/show_bug.cgi?id=10370
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
+#include "piglit-util.h"
static int Automatic = 0;
diff --git a/tests/bugs/fdo14575.c b/tests/bugs/fdo14575.c
index 476b395bd..3e6a6393c 100644
--- a/tests/bugs/fdo14575.c
+++ b/tests/bugs/fdo14575.c
@@ -30,19 +30,7 @@
*
* Tests that the driver doesn't fail when deleting a mapped buffer object.
*/
-
-#define GL_GLEXT_PROTOTYPES
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
+#include "piglit-util.h"
static int Automatic = 0;
diff --git a/tests/bugs/fdo20701.c b/tests/bugs/fdo20701.c
index ad3a5859d..b050009fa 100644
--- a/tests/bugs/fdo20701.c
+++ b/tests/bugs/fdo20701.c
@@ -34,16 +34,6 @@
* passes.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
#include "piglit-util.h"
static int Automatic = 0;
diff --git a/tests/bugs/fdo22540.c b/tests/bugs/fdo22540.c
index b01d9d8ca..9e9e94354 100644
--- a/tests/bugs/fdo22540.c
+++ b/tests/bugs/fdo22540.c
@@ -23,17 +23,6 @@
// author: Ben Holmes
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static GLboolean Automatic = GL_FALSE;
diff --git a/tests/bugs/fdo23489.c b/tests/bugs/fdo23489.c
index 4fb324b4f..d08e85395 100644
--- a/tests/bugs/fdo23489.c
+++ b/tests/bugs/fdo23489.c
@@ -3,14 +3,6 @@
* http://bugs.freedesktop.org/show_bug.cgi?id=23489
*/
-#include <string.h>
-
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static int Automatic = 0;
diff --git a/tests/bugs/fdo23670-drawpix_stencil.c b/tests/bugs/fdo23670-drawpix_stencil.c
index d4a4d7eed..8f9081029 100644
--- a/tests/bugs/fdo23670-drawpix_stencil.c
+++ b/tests/bugs/fdo23670-drawpix_stencil.c
@@ -24,16 +24,6 @@
* Shuang he <shuang.he@intel.com>
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/bugs/fdo24066.c b/tests/bugs/fdo24066.c
index 215dee0a2..4186d6d4c 100644
--- a/tests/bugs/fdo24066.c
+++ b/tests/bugs/fdo24066.c
@@ -32,16 +32,6 @@
* before a fragment program has been setup.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
#include "piglit-util.h"
#include "piglit-framework.h"
diff --git a/tests/bugs/fdo9833.c b/tests/bugs/fdo9833.c
index e78d27e07..b75a48e8c 100644
--- a/tests/bugs/fdo9833.c
+++ b/tests/bugs/fdo9833.c
@@ -3,14 +3,7 @@
* https://bugs.freedesktop.org/show_bug.cgi?id=9833
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
+#include "piglit-util.h"
static int Automatic = 0;
diff --git a/tests/bugs/point-sprite.c b/tests/bugs/point-sprite.c
index f30a37eda..5a8b1949a 100644
--- a/tests/bugs/point-sprite.c
+++ b/tests/bugs/point-sprite.c
@@ -28,16 +28,6 @@
* \author Ben Holmes
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static GLboolean Automatic = GL_FALSE;
diff --git a/tests/bugs/r300-readcache.c b/tests/bugs/r300-readcache.c
index ed0850656..ec02f6c18 100644
--- a/tests/bugs/r300-readcache.c
+++ b/tests/bugs/r300-readcache.c
@@ -15,20 +15,8 @@
* so this test is always automatic.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
-
static int Width = 100, Height = 100;
static GLfloat colors[8][3] = {
diff --git a/tests/bugs/tex1d-2dborder.c b/tests/bugs/tex1d-2dborder.c
index 9b41fcba5..e7b657b81 100644
--- a/tests/bugs/tex1d-2dborder.c
+++ b/tests/bugs/tex1d-2dborder.c
@@ -30,20 +30,8 @@
* 2D textures, which caused incorrect sampling of border colors.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
-
static int Width = 256, Height = 128;
static int Automatic = 0;
diff --git a/tests/fbo/fbo-1d.c b/tests/fbo/fbo-1d.c
index 198a11d2a..3e461f093 100644
--- a/tests/fbo/fbo-1d.c
+++ b/tests/fbo/fbo-1d.c
@@ -31,19 +31,6 @@
* succeeds.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
#define BUF_WIDTH 32
diff --git a/tests/fbo/fbo-3d.c b/tests/fbo/fbo-3d.c
index 3b1073eaa..bfed9a9b7 100644
--- a/tests/fbo/fbo-3d.c
+++ b/tests/fbo/fbo-3d.c
@@ -31,18 +31,6 @@
* of those inidivual depths to the window system framebuffer succeeds.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
#define BUF_WIDTH 32
diff --git a/tests/fbo/fbo-cubemap.c b/tests/fbo/fbo-cubemap.c
index 2a2e452cd..04c9cd8ef 100644
--- a/tests/fbo/fbo-cubemap.c
+++ b/tests/fbo/fbo-cubemap.c
@@ -31,18 +31,6 @@
* of those faces to the window system framebuffer succeeds.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
#define BUF_WIDTH 32
diff --git a/tests/fbo/fbo-generatemipmap.c b/tests/fbo/fbo-generatemipmap.c
index f1039fbb6..e29a30b83 100644
--- a/tests/fbo/fbo-generatemipmap.c
+++ b/tests/fbo/fbo-generatemipmap.c
@@ -30,18 +30,6 @@
* Tests that glGenerateMipmapEXT works correctly on a 2D texture.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
#define TEX_WIDTH 256
diff --git a/tests/fbo/fbo-readpixels.c b/tests/fbo/fbo-readpixels.c
index 6580212ce..c25801b49 100644
--- a/tests/fbo/fbo-readpixels.c
+++ b/tests/fbo/fbo-readpixels.c
@@ -31,18 +31,6 @@
* glReadPixels() versus glClear and immediate mode rendering.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
#define BUF_WIDTH 32
diff --git a/tests/general/bgra-sec-color-pointer.c b/tests/general/bgra-sec-color-pointer.c
index 072267722..bdef1389d 100644
--- a/tests/general/bgra-sec-color-pointer.c
+++ b/tests/general/bgra-sec-color-pointer.c
@@ -30,19 +30,8 @@
* with alpha blending.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
-
static GLboolean Automatic = GL_FALSE;
static GLfloat verts[12] = {225.0, 175.0, 0.0,
diff --git a/tests/general/bgra-vert-attrib-pointer.c b/tests/general/bgra-vert-attrib-pointer.c
index e4d8b1aa1..f68a95dc8 100644
--- a/tests/general/bgra-vert-attrib-pointer.c
+++ b/tests/general/bgra-vert-attrib-pointer.c
@@ -29,19 +29,8 @@
* two quads are drawn without blending and two are drawn with alpha blending.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
-
static GLboolean Automatic = GL_FALSE;
static GLint prog;
static GLint fs;
diff --git a/tests/general/clear-varray-2.0.c b/tests/general/clear-varray-2.0.c
index c4f6a2b23..ac9a0e042 100644
--- a/tests/general/clear-varray-2.0.c
+++ b/tests/general/clear-varray-2.0.c
@@ -32,18 +32,6 @@
* fd.o bug #21638
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include "GL/glew.h"
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
#define WIN_WIDTH 200
diff --git a/tests/general/depth_clamp.c b/tests/general/depth_clamp.c
index 5d0f0a625..8b66fedb3 100644
--- a/tests/general/depth_clamp.c
+++ b/tests/general/depth_clamp.c
@@ -34,15 +34,6 @@
* the same operations against the far plane.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
#include "piglit-util.h"
/* In case the headers have the old enum name but not the new */
diff --git a/tests/general/depthrange-clear.c b/tests/general/depthrange-clear.c
index c75b73ff5..11e6d29c4 100644
--- a/tests/general/depthrange-clear.c
+++ b/tests/general/depthrange-clear.c
@@ -31,15 +31,6 @@
* Caught a regression in the intel driver with the metaops clear code.
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/general/dlist-clear.c b/tests/general/dlist-clear.c
index eb9087943..152e580c7 100644
--- a/tests/general/dlist-clear.c
+++ b/tests/general/dlist-clear.c
@@ -32,15 +32,6 @@
* with the new metaops clear code.
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/general/draw-elements-base-vertex.c b/tests/general/draw-elements-base-vertex.c
index ee55a1efc..6465e2265 100644
--- a/tests/general/draw-elements-base-vertex.c
+++ b/tests/general/draw-elements-base-vertex.c
@@ -34,22 +34,13 @@
#include <windows.h>
#endif
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
#if !defined(_MSC_VER)
#include <stdint.h>
#endif
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#if defined(FREEGLUT)
+#if !defined(__APPLE__) && defined(FREEGLUT)
#include <GL/freeglut_ext.h>
#endif
-#endif
#include "piglit-util.h"
/* GLEW hasn't added support for this yet. */
diff --git a/tests/general/linestipple.c b/tests/general/linestipple.c
index 4c8724331..c3fc55ef3 100644
--- a/tests/general/linestipple.c
+++ b/tests/general/linestipple.c
@@ -26,20 +26,8 @@
* Test basic line stippling functionality.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
-
static int Width = 128, Height = 128;
static int Automatic = 0;
diff --git a/tests/general/occlusion_query.c b/tests/general/occlusion_query.c
index f008bcd01..c52c15456 100644
--- a/tests/general/occlusion_query.c
+++ b/tests/general/occlusion_query.c
@@ -29,17 +29,6 @@
* Simple test for GL_ARB_occlusion_query.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static int Width = 180, Height = 100;
diff --git a/tests/general/pbo-drawpixels.c b/tests/general/pbo-drawpixels.c
index 9047f08d8..9fbe1190d 100644
--- a/tests/general/pbo-drawpixels.c
+++ b/tests/general/pbo-drawpixels.c
@@ -31,16 +31,6 @@
* Caught a bug with the Intel driver with the metaops drawpixels code.
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/general/pbo-teximage.c b/tests/general/pbo-teximage.c
index 511435974..088b9efe5 100644
--- a/tests/general/pbo-teximage.c
+++ b/tests/general/pbo-teximage.c
@@ -30,16 +30,6 @@
* Tests that using a PBO as the unpack buffer for glTexImage works correctly.
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/general/provoking-vertex.c b/tests/general/provoking-vertex.c
index e87297b58..3d4fa2647 100644
--- a/tests/general/provoking-vertex.c
+++ b/tests/general/provoking-vertex.c
@@ -31,18 +31,11 @@
* Second tri using GL_LAST_VERTEX_CONVENTION_EXT.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#if defined(FREEGLUT)
+#include "piglit-util.h"
+
+#if !defined(__APPLE__) && defined(FREEGLUT)
#include <GL/freeglut_ext.h>
#endif
-#endif
-#include "piglit-util.h"
#ifndef APIENTRY
diff --git a/tests/general/read-front.c b/tests/general/read-front.c
index c4b17e738..3c10634c4 100644
--- a/tests/general/read-front.c
+++ b/tests/general/read-front.c
@@ -35,15 +35,6 @@
* used as a draw buffer.
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/general/scissor-copypixels.c b/tests/general/scissor-copypixels.c
index 46c2013bb..16dcdb45b 100644
--- a/tests/general/scissor-copypixels.c
+++ b/tests/general/scissor-copypixels.c
@@ -30,15 +30,6 @@
* Tests that glScissor properly affects glCopyPixels().
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/general/scissor-depth-clear.c b/tests/general/scissor-depth-clear.c
index 22f97f1d1..06cac3f84 100644
--- a/tests/general/scissor-depth-clear.c
+++ b/tests/general/scissor-depth-clear.c
@@ -30,15 +30,6 @@
* Tests that glScissor properly affects glCopyPixels().
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/general/scissor-stencil-clear.c b/tests/general/scissor-stencil-clear.c
index 8a4021a3f..a4eee8ed2 100644
--- a/tests/general/scissor-stencil-clear.c
+++ b/tests/general/scissor-stencil-clear.c
@@ -30,15 +30,6 @@
* Tests that glScissor properly affects glClear of the stencil buffer.
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/general/stencil-drawpixels.c b/tests/general/stencil-drawpixels.c
index 13cee1656..76e1f4035 100644
--- a/tests/general/stencil-drawpixels.c
+++ b/tests/general/stencil-drawpixels.c
@@ -30,16 +30,6 @@
* Tests that glDrawPixels(GL_STENCIL) minimally works.
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <assert.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/general/sync_api.c b/tests/general/sync_api.c
index d1d602769..9655e96ef 100644
--- a/tests/general/sync_api.c
+++ b/tests/general/sync_api.c
@@ -29,22 +29,15 @@
* Simple test of the API for GL_ARB_sync.
*/
-#include <stdio.h>
-#include <string.h>
#if !defined(_MSC_VER)
#include <stdint.h>
#endif
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#if defined(FREEGLUT)
+#include "piglit-util.h"
+
+#if !defined(__APPLE__) && defined(FREEGLUT)
#include <GL/freeglut_ext.h>
#endif
-#endif
-
-#include "piglit-util.h"
#define FAIL_ON_ERROR(string) \
do { \
diff --git a/tests/general/texgen.c b/tests/general/texgen.c
index 30bc6d610..5a27c9560 100644
--- a/tests/general/texgen.c
+++ b/tests/general/texgen.c
@@ -26,20 +26,8 @@
* Test a number of basic TexGen functions.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
-
static int Width = 128, Height = 128;
static int Automatic = 0;
static int CurrentTest = 0;
diff --git a/tests/general/varray-disabled.c b/tests/general/varray-disabled.c
index 188aa7cdd..ad4ab2fa4 100644
--- a/tests/general/varray-disabled.c
+++ b/tests/general/varray-disabled.c
@@ -34,17 +34,6 @@
* http://bugs.freedesktop.org/show_bug.cgi?id=19911
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static int Width = 128, Height = 128;
diff --git a/tests/general/vbo-map-remap.c b/tests/general/vbo-map-remap.c
index ad4f52c7c..b5c4dd2bf 100644
--- a/tests/general/vbo-map-remap.c
+++ b/tests/general/vbo-map-remap.c
@@ -24,16 +24,6 @@
* Ben Holmes <shranzel@hotmail.com>
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static GLboolean Automatic = GL_FALSE;
diff --git a/tests/general/vbo-subdata-sync.c b/tests/general/vbo-subdata-sync.c
index ea2751d15..3af255cf0 100644
--- a/tests/general/vbo-subdata-sync.c
+++ b/tests/general/vbo-subdata-sync.c
@@ -30,16 +30,6 @@
* Test for synchronizing behavior of glBufferSubDataARB, bug #23857.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static GLboolean Automatic = GL_FALSE;
diff --git a/tests/general/windowoverlap.c b/tests/general/windowoverlap.c
index b5c04cb6e..8d47c6f6f 100644
--- a/tests/general/windowoverlap.c
+++ b/tests/general/windowoverlap.c
@@ -30,20 +30,8 @@
* This test was prompted by http://bugs.freedesktop.org/show_bug.cgi?id=16123
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
-
static const int MainWidth = 128, MainHeight = 128;
static const int SubX = 32, SubY = 32;
static const int SubWidth = 64, SubHeight = 64;
diff --git a/tests/glslparsertest/glslparsertest.c b/tests/glslparsertest/glslparsertest.c
index cef86de36..93168e48f 100644
--- a/tests/glslparsertest/glslparsertest.c
+++ b/tests/glslparsertest/glslparsertest.c
@@ -31,19 +31,8 @@
* of those faces to the window system framebuffer succeeds.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
#include <errno.h>
#include <sys/stat.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
#include "piglit-util.h"
diff --git a/tests/shaders/fp-abs-01.c b/tests/shaders/fp-abs-01.c
index dca08396c..103dd9e09 100644
--- a/tests/shaders/fp-abs-01.c
+++ b/tests/shaders/fp-abs-01.c
@@ -28,19 +28,6 @@
* \author Ian Romanick <ian.d.romanick@intel.com>
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <time.h>
-#include <assert.h>
-
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
#include "piglit-util.h"
#include "piglit-framework.h"
diff --git a/tests/shaders/fp-abs-02.c b/tests/shaders/fp-abs-02.c
index bfd339592..991471953 100644
--- a/tests/shaders/fp-abs-02.c
+++ b/tests/shaders/fp-abs-02.c
@@ -28,19 +28,6 @@
* \author Ian Romanick <ian.d.romanick@intel.com>
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <time.h>
-#include <assert.h>
-
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
#include "piglit-util.h"
#include "piglit-framework.h"
diff --git a/tests/shaders/fp-condition_codes-01.c b/tests/shaders/fp-condition_codes-01.c
index 4e595f00f..f2536346a 100644
--- a/tests/shaders/fp-condition_codes-01.c
+++ b/tests/shaders/fp-condition_codes-01.c
@@ -29,15 +29,6 @@
* \author Ian Romanick <ian.d.romanick@intel.com>
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
#include "piglit-util.h"
#include "piglit-framework.h"
diff --git a/tests/shaders/fp-fog.c b/tests/shaders/fp-fog.c
index 7ad8cc871..25b4cd332 100644
--- a/tests/shaders/fp-fog.c
+++ b/tests/shaders/fp-fog.c
@@ -28,19 +28,9 @@
* \author Ian Romanick <ian.d.romanick@intel.com>
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#ifdef FREEGLUT
+#if !defined(__APPLE__) && defined(FREEGLUT)
#include <GL/freeglut_ext.h>
#endif
-#endif
#include "piglit-util.h"
static GLint prog = 0;
diff --git a/tests/shaders/fp-fragment-position.c b/tests/shaders/fp-fragment-position.c
index ddac4f240..e79a986a7 100644
--- a/tests/shaders/fp-fragment-position.c
+++ b/tests/shaders/fp-fragment-position.c
@@ -25,17 +25,6 @@
* Test fragment.position.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
#include "piglit-util.h"
#define NUM_PROGRAMS 4
diff --git a/tests/shaders/fp-generic.c b/tests/shaders/fp-generic.c
index 782d78c9f..05c4d6c64 100644
--- a/tests/shaders/fp-generic.c
+++ b/tests/shaders/fp-generic.c
@@ -41,18 +41,6 @@
* ...
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
/*
diff --git a/tests/shaders/fp-incomplete-tex.c b/tests/shaders/fp-incomplete-tex.c
index ed2229efc..3fa0d27ab 100644
--- a/tests/shaders/fp-incomplete-tex.c
+++ b/tests/shaders/fp-incomplete-tex.c
@@ -26,17 +26,6 @@
* sampling an incomplete texture image yields (0,0,0,1).
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
#define NUM_PROGRAMS 5
diff --git a/tests/shaders/fp-indirections.c b/tests/shaders/fp-indirections.c
index 68eac80ea..608a00d5e 100644
--- a/tests/shaders/fp-indirections.c
+++ b/tests/shaders/fp-indirections.c
@@ -25,16 +25,6 @@
*
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
#include "piglit-util.h"
static int Automatic = 0;
diff --git a/tests/shaders/fp-indirections2.c b/tests/shaders/fp-indirections2.c
index 76acbe30c..e104e49ce 100644
--- a/tests/shaders/fp-indirections2.c
+++ b/tests/shaders/fp-indirections2.c
@@ -32,16 +32,6 @@
* indirection counts up to the reported native limit.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
#include "piglit-util.h"
#include "piglit-framework.h"
diff --git a/tests/shaders/fp-kil.c b/tests/shaders/fp-kil.c
index 6ae3c2d13..d82c0eca8 100644
--- a/tests/shaders/fp-kil.c
+++ b/tests/shaders/fp-kil.c
@@ -25,17 +25,6 @@
* Test KIL instruction.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
#include "piglit-util.h"
#define NUM_PROGRAMS 2
diff --git a/tests/shaders/fp-lit-mask.c b/tests/shaders/fp-lit-mask.c
index 0cbbf747d..e9550c80e 100644
--- a/tests/shaders/fp-lit-mask.c
+++ b/tests/shaders/fp-lit-mask.c
@@ -25,17 +25,6 @@
* Test whether LIT honours the output mask.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static GLuint FragProg[15];
diff --git a/tests/shaders/fp-rfl.c b/tests/shaders/fp-rfl.c
index 5cc41f523..31258df71 100644
--- a/tests/shaders/fp-rfl.c
+++ b/tests/shaders/fp-rfl.c
@@ -28,19 +28,8 @@
* \author Ian Romanick <ian.d.romanick@intel.com>
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
#include <time.h>
-#include <assert.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
#include "piglit-util.h"
#include "piglit-framework.h"
diff --git a/tests/shaders/fp-set-01.c b/tests/shaders/fp-set-01.c
index 161e8c333..775ef2d9d 100644
--- a/tests/shaders/fp-set-01.c
+++ b/tests/shaders/fp-set-01.c
@@ -28,19 +28,6 @@
* \author Ian Romanick <ian.d.romanick@intel.com>
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <time.h>
-#include <assert.h>
-
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
#include "piglit-util.h"
#include "piglit-framework.h"
diff --git a/tests/shaders/fp-set-02.c b/tests/shaders/fp-set-02.c
index 7cb0e61e0..7609fdefc 100644
--- a/tests/shaders/fp-set-02.c
+++ b/tests/shaders/fp-set-02.c
@@ -32,19 +32,6 @@
* \author Ian Romanick <ian.d.romanick@intel.com>
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <time.h>
-#include <assert.h>
-
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
#include "piglit-util.h"
#include "piglit-framework.h"
diff --git a/tests/shaders/fp-unpack-01.c b/tests/shaders/fp-unpack-01.c
index a83e71e13..073449c81 100644
--- a/tests/shaders/fp-unpack-01.c
+++ b/tests/shaders/fp-unpack-01.c
@@ -28,19 +28,6 @@
* \author Ian Romanick <ian.d.romanick@intel.com>
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <time.h>
-#include <assert.h>
-
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
#include "piglit-util.h"
#include "piglit-framework.h"
diff --git a/tests/shaders/glsl-bug-22603.c b/tests/shaders/glsl-bug-22603.c
index a24985af8..972f5ed6b 100644
--- a/tests/shaders/glsl-bug-22603.c
+++ b/tests/shaders/glsl-bug-22603.c
@@ -30,20 +30,6 @@
*
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/stat.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
static GLboolean Automatic;
diff --git a/tests/shaders/glsl-deriv-varyings.c b/tests/shaders/glsl-deriv-varyings.c
index 7337e428e..30e33056e 100644
--- a/tests/shaders/glsl-deriv-varyings.c
+++ b/tests/shaders/glsl-deriv-varyings.c
@@ -28,16 +28,6 @@
* on varying values.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static GLboolean Automatic = GL_FALSE;
diff --git a/tests/shaders/glsl-derivs.c b/tests/shaders/glsl-derivs.c
index 5548532f0..44eb16701 100644
--- a/tests/shaders/glsl-derivs.c
+++ b/tests/shaders/glsl-derivs.c
@@ -28,16 +28,6 @@
* on varyings after other math has been used on them.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static GLboolean Automatic = GL_FALSE;
diff --git a/tests/shaders/glsl-dlist-getattriblocation.c b/tests/shaders/glsl-dlist-getattriblocation.c
index 7dd4a0113..c831303df 100644
--- a/tests/shaders/glsl-dlist-getattriblocation.c
+++ b/tests/shaders/glsl-dlist-getattriblocation.c
@@ -30,16 +30,6 @@
* \author Ian Romanick <ian.d.romanick@intel.com>
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
#include "piglit-framework.h"
diff --git a/tests/shaders/glsl-empty-vs-no-fs.c b/tests/shaders/glsl-empty-vs-no-fs.c
index 70fe40532..e317fa13c 100644
--- a/tests/shaders/glsl-empty-vs-no-fs.c
+++ b/tests/shaders/glsl-empty-vs-no-fs.c
@@ -33,17 +33,6 @@
*
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static GLboolean Automatic;
diff --git a/tests/shaders/glsl-fs-exp2.c b/tests/shaders/glsl-fs-exp2.c
index b96d02b37..3082a15fa 100644
--- a/tests/shaders/glsl-fs-exp2.c
+++ b/tests/shaders/glsl-fs-exp2.c
@@ -30,20 +30,6 @@
* Tests that exp2 produces the expected output in a fragment shader.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/stat.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/shaders/glsl-fs-fragcoord.c b/tests/shaders/glsl-fs-fragcoord.c
index bbf8216ff..ec351a838 100644
--- a/tests/shaders/glsl-fs-fragcoord.c
+++ b/tests/shaders/glsl-fs-fragcoord.c
@@ -30,20 +30,6 @@
* Tests that gl_FragCoord produces the expected output in a fragment shader.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/stat.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
#define WIN_WIDTH 256
diff --git a/tests/shaders/glsl-fs-log2.c b/tests/shaders/glsl-fs-log2.c
index 0b4d907d0..de147f997 100644
--- a/tests/shaders/glsl-fs-log2.c
+++ b/tests/shaders/glsl-fs-log2.c
@@ -30,20 +30,6 @@
* Tests that log2 produces the expected output in a fragment shader.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/stat.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/shaders/glsl-fwidth.c b/tests/shaders/glsl-fwidth.c
index 181038fd2..a63becbae 100644
--- a/tests/shaders/glsl-fwidth.c
+++ b/tests/shaders/glsl-fwidth.c
@@ -28,16 +28,6 @@
*
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static GLboolean Automatic = GL_FALSE;
diff --git a/tests/shaders/glsl-lod-bias.c b/tests/shaders/glsl-lod-bias.c
index 0a837a5e6..b0a7b036c 100644
--- a/tests/shaders/glsl-lod-bias.c
+++ b/tests/shaders/glsl-lod-bias.c
@@ -28,16 +28,6 @@
* that specifies a LOD bias.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static GLboolean Automatic = GL_FALSE;
diff --git a/tests/shaders/glsl-uniform-update.c b/tests/shaders/glsl-uniform-update.c
index e7116e4d0..2ecb291e6 100644
--- a/tests/shaders/glsl-uniform-update.c
+++ b/tests/shaders/glsl-uniform-update.c
@@ -34,20 +34,6 @@
* catches a bug found in the 965 driver in an app I was writing.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/stat.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/shaders/glsl-unused-varying.c b/tests/shaders/glsl-unused-varying.c
index ad69c13f9..46c9a28f2 100644
--- a/tests/shaders/glsl-unused-varying.c
+++ b/tests/shaders/glsl-unused-varying.c
@@ -34,20 +34,6 @@
* conditional in the fragment shader is required to trigger brw_wm_glsl.c.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/stat.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/shaders/glsl-vs-if-bool.c b/tests/shaders/glsl-vs-if-bool.c
index 10e798a39..a7d0378c1 100644
--- a/tests/shaders/glsl-vs-if-bool.c
+++ b/tests/shaders/glsl-vs-if-bool.c
@@ -30,20 +30,6 @@
* Tests that exp2 produces the expected output in a fragment shader.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/stat.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/shaders/glsl-vs-if.c b/tests/shaders/glsl-vs-if.c
index 24b677c75..1babacd7d 100644
--- a/tests/shaders/glsl-vs-if.c
+++ b/tests/shaders/glsl-vs-if.c
@@ -30,20 +30,6 @@
* Tests that exp2 produces the expected output in a fragment shader.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/stat.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/shaders/glsl-vs-loop.c b/tests/shaders/glsl-vs-loop.c
index 58702883c..72ca56fe4 100644
--- a/tests/shaders/glsl-vs-loop.c
+++ b/tests/shaders/glsl-vs-loop.c
@@ -37,20 +37,6 @@
* This was conceived as a test case for freedesktop.org bug #20171.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/stat.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
#define WIN_WIDTH 100
diff --git a/tests/shaders/trinity-fp1.c b/tests/shaders/trinity-fp1.c
index ab5365ae0..e44767afa 100644
--- a/tests/shaders/trinity-fp1.c
+++ b/tests/shaders/trinity-fp1.c
@@ -26,18 +26,6 @@
* \sa http://www.mail-archive.com/dri-devel%40lists.sourceforge.net/msg30180.html
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static GLuint TexDiffuse = 1;
diff --git a/tests/shaders/vp-bad-program.c b/tests/shaders/vp-bad-program.c
index 26299ae11..09fe2be5c 100644
--- a/tests/shaders/vp-bad-program.c
+++ b/tests/shaders/vp-bad-program.c
@@ -34,19 +34,6 @@
* Wine likes to do that to us to see how strict we are on the VP language.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#define GL_GLEXT_PROTOTYPES
-
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
static int automatic = 0;
diff --git a/tests/shaders/vp-ignore-input.c b/tests/shaders/vp-ignore-input.c
index 3429301b5..9885ad706 100644
--- a/tests/shaders/vp-ignore-input.c
+++ b/tests/shaders/vp-ignore-input.c
@@ -28,17 +28,6 @@
* writes a constant to gl_Position.
*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static GLboolean Automatic = GL_FALSE;
diff --git a/tests/texturing/copytexsubimage.c b/tests/texturing/copytexsubimage.c
index f970ab2eb..481c731b7 100644
--- a/tests/texturing/copytexsubimage.c
+++ b/tests/texturing/copytexsubimage.c
@@ -25,15 +25,7 @@
*
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#include <GL/glext.h>
-#endif
+#include "piglit-util.h"
#define WIN_WIDTH 200
#define WIN_HEIGHT 200
diff --git a/tests/texturing/cubemap.c b/tests/texturing/cubemap.c
index 896c718c5..b93728d66 100644
--- a/tests/texturing/cubemap.c
+++ b/tests/texturing/cubemap.c
@@ -25,15 +25,6 @@
*
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
#include "piglit-util.h"
static GLboolean Automatic = GL_FALSE;
diff --git a/tests/texturing/depth-tex-compare.c b/tests/texturing/depth-tex-compare.c
index 7318e0824..d9d01ab4d 100644
--- a/tests/texturing/depth-tex-compare.c
+++ b/tests/texturing/depth-tex-compare.c
@@ -31,16 +31,6 @@
* clear color (green) using the alpha value.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static GLboolean Automatic = GL_FALSE;
diff --git a/tests/texturing/depth-tex-modes-glsl.c b/tests/texturing/depth-tex-modes-glsl.c
index fbbde0db3..ff8b0f800 100644
--- a/tests/texturing/depth-tex-modes-glsl.c
+++ b/tests/texturing/depth-tex-modes-glsl.c
@@ -28,17 +28,6 @@
* INTENSITY, and ALPHA with programmable shaders.
*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static GLboolean Automatic = GL_FALSE;
diff --git a/tests/texturing/depth-tex-modes.c b/tests/texturing/depth-tex-modes.c
index 564c476bf..b3995aac5 100644
--- a/tests/texturing/depth-tex-modes.c
+++ b/tests/texturing/depth-tex-modes.c
@@ -28,16 +28,6 @@
* textures and texture rectangles.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static GLboolean Automatic = GL_FALSE;
diff --git a/tests/texturing/gen-compressed-teximage.c b/tests/texturing/gen-compressed-teximage.c
index 2300fed56..80c48937b 100644
--- a/tests/texturing/gen-compressed-teximage.c
+++ b/tests/texturing/gen-compressed-teximage.c
@@ -36,15 +36,6 @@
* existing texture.
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
#include "piglit-util.h"
#define WIN_WIDTH 512
diff --git a/tests/texturing/gen-teximage.c b/tests/texturing/gen-teximage.c
index e1d67e69a..e599ce665 100644
--- a/tests/texturing/gen-teximage.c
+++ b/tests/texturing/gen-teximage.c
@@ -36,15 +36,6 @@
* existing texture.
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
#include "piglit-util.h"
#define WIN_WIDTH 512
diff --git a/tests/texturing/gen-texsubimage.c b/tests/texturing/gen-texsubimage.c
index 64b51d1d6..18f641581 100644
--- a/tests/texturing/gen-texsubimage.c
+++ b/tests/texturing/gen-texsubimage.c
@@ -33,15 +33,6 @@
* in bug #17077.
*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
#include "piglit-util.h"
#define WIN_WIDTH 512
diff --git a/tests/texturing/getteximage-simple.c b/tests/texturing/getteximage-simple.c
index 4d5645f50..07b75eec4 100644
--- a/tests/texturing/getteximage-simple.c
+++ b/tests/texturing/getteximage-simple.c
@@ -10,20 +10,8 @@
* This used to crash for R300+bufmgr.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
-
static int Automatic = 0;
static int Width = 100, Height = 100;
static GLubyte data[4096]; /* 64*16*4 */
diff --git a/tests/texturing/lodbias.c b/tests/texturing/lodbias.c
index 17a8d278c..d87907a26 100644
--- a/tests/texturing/lodbias.c
+++ b/tests/texturing/lodbias.c
@@ -40,18 +40,6 @@
* Check clamping behaviour.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
#define SquareSize 32
diff --git a/tests/texturing/tex3d.c b/tests/texturing/tex3d.c
index 5859ac080..22f09e2df 100644
--- a/tests/texturing/tex3d.c
+++ b/tests/texturing/tex3d.c
@@ -26,18 +26,6 @@
* Tests 3D textures.
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
#include "piglit-util.h"
static int Width = 128, Height = 128;
diff --git a/tests/texturing/texdepth.c b/tests/texturing/texdepth.c
index 2d36fb653..535cffece 100644
--- a/tests/texturing/texdepth.c
+++ b/tests/texturing/texdepth.c
@@ -8,18 +8,6 @@
* - EXT_shadow_funcs
*/
-#define GL_GLEXT_PROTOTYPES
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
#define ROWS 4
diff --git a/tests/texturing/texrect-many.c b/tests/texturing/texrect-many.c
index 18db8c1e7..f41920c80 100644
--- a/tests/texturing/texrect-many.c
+++ b/tests/texturing/texrect-many.c
@@ -6,22 +6,8 @@
* (Prompted by a bug in R300 where the driver ran out of indirections).
*/
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
-
#include "piglit-util.h"
-
static int Width = 16*16, Height = 11*16;
static int Automatic = 0;
static int NumTextures = 16;
diff --git a/tests/texturing/texredefine.c b/tests/texturing/texredefine.c
index bae405065..5877477a8 100644
--- a/tests/texturing/texredefine.c
+++ b/tests/texturing/texredefine.c
@@ -27,17 +27,7 @@
* works correctly.
*/
-#include <assert.h>
-#include <string.h>
#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
#include "piglit-util.h"
diff --git a/tests/texturing/tfp.c b/tests/texturing/tfp.c
index 6515b471b..71152cc5e 100644
--- a/tests/texturing/tfp.c
+++ b/tests/texturing/tfp.c
@@ -35,12 +35,8 @@
* Neil Roberts <neil@linux.intel.com>.
*/
-#include "GL/glx.h"
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
#include "piglit-util.h"
+#include "GL/glx.h"
GLfloat tex_data[4][4] = {
{ 1.0, 0.0, 0.0, 1.0 },
diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
index 2ed0154b5..10c7b62f7 100644
--- a/tests/util/piglit-util.h
+++ b/tests/util/piglit-util.h
@@ -21,6 +21,19 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#include <GL/glew.h>
+#if defined(__APPLE__)
+#include <GLUT/glut.h>
+#else
+#include <GL/glut.h>
+#endif
+
#if defined(_MSC_VER)
#include <GL/glext.h>
#endif