Commit 29bbf127 authored by Chad Versace's avatar Chad Versace

tests: Let each test define main()

Each test that did not define main() now does so using
PIGLIT_GL_TEST_MAIN().
Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarChad Versace <chad.versace@linux.intel.com>
parent 7b90e1b1
......@@ -30,8 +30,10 @@
#define TRUE (!FALSE)
#endif
int piglit_width = 250, piglit_height = 250;
int piglit_window_mode = GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH;
PIGLIT_GL_TEST_MAIN(
250 /*window_width*/,
250 /*window_height*/,
GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH)
char *
unix_line_endings(const char *input, size_t length)
......
......@@ -8,8 +8,10 @@
#include "piglit-util.h"
int piglit_width = 100, piglit_height = 100;
int piglit_window_mode = GLUT_DOUBLE | GLUT_RGBA;
PIGLIT_GL_TEST_MAIN(
100 /*window_width*/,
100 /*window_height*/,
GLUT_DOUBLE | GLUT_RGBA)
enum piglit_result
piglit_display(void)
......
......@@ -9,9 +9,10 @@
#include "piglit-util.h"
int piglit_width = 100, piglit_height = 100;
int piglit_window_mode = GLUT_DOUBLE | GLUT_RGBA;
PIGLIT_GL_TEST_MAIN(
100 /*window_width*/,
100 /*window_height*/,
GLUT_DOUBLE | GLUT_RGBA)
enum piglit_result
piglit_display(void)
......
......@@ -35,8 +35,11 @@
* \Author Yi Sun <yi.sun@intel.com>, Anuj Phogat <anuj.phogat@gmail.com>
*/
#include "piglit-util.h"
int piglit_width = 100, piglit_height = 100;
int piglit_window_mode = GLUT_RGB | GLUT_DOUBLE;
PIGLIT_GL_TEST_MAIN(
100 /*window_width*/,
100 /*window_height*/,
GLUT_RGB | GLUT_DOUBLE)
float color[7][4] = {
{ 0.1, 0.2, 0.3, 1.0 },
......
......@@ -5,8 +5,11 @@
#include "piglit-util.h"
int piglit_width = 128, piglit_height = 128;
int piglit_window_mode = GLUT_SINGLE | GLUT_RGB;
PIGLIT_GL_TEST_MAIN(
128 /*window_width*/,
128 /*window_height*/,
GLUT_SINGLE | GLUT_RGB)
#define BITMAP_WIDTH 1
#define BITMAP_HEIGHT 1
#define ALIGN 1
......
......@@ -32,8 +32,10 @@
*/
#include "piglit-util.h"
int piglit_width = 128, piglit_height = 128;
int piglit_window_mode = GLUT_SINGLE | GLUT_RGB;
PIGLIT_GL_TEST_MAIN(
128 /*window_width*/,
128 /*window_height*/,
GLUT_SINGLE | GLUT_RGB)
void
piglit_init(int argc, char**argv)
......
......@@ -36,8 +36,10 @@
#include "piglit-util.h"
int piglit_width = 128, piglit_height = 128;
int piglit_window_mode = GLUT_RGB;
PIGLIT_GL_TEST_MAIN(
128 /*window_width*/,
128 /*window_height*/,
GLUT_RGB)
static GLuint fb;
static GLuint tex;
......
......@@ -25,8 +25,10 @@
#include "piglit-util.h"
int piglit_width = 400, piglit_height = 300;
int piglit_window_mode = GLUT_DOUBLE | GLUT_RGB;
PIGLIT_GL_TEST_MAIN(
400 /*window_width*/,
300 /*window_height*/,
GLUT_DOUBLE | GLUT_RGB)
static GLuint vBuffer;
......
......@@ -5,8 +5,10 @@
#include "piglit-util.h"
int piglit_width = 250, piglit_height = 250;
int piglit_window_mode = GLUT_SINGLE | GLUT_RGB;
PIGLIT_GL_TEST_MAIN(
250 /*window_width*/,
250 /*window_height*/,
GLUT_SINGLE | GLUT_RGB)
enum piglit_result
piglit_display(void)
......
......@@ -26,9 +26,10 @@
#include "piglit-util.h"
int piglit_width = 100;
int piglit_height = 100;
int piglit_window_mode = GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_STENCIL;
PIGLIT_GL_TEST_MAIN(
100 /*window_width*/,
100 /*window_height*/,
GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_STENCIL)
void
piglit_init(int argc, char **argv)
......
......@@ -26,9 +26,10 @@
#include "piglit-util.h"
int piglit_width = 100;
int piglit_height = 100;
int piglit_window_mode = GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_STENCIL;
PIGLIT_GL_TEST_MAIN(
100 /*window_width*/,
100 /*window_height*/,
GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_STENCIL)
void
piglit_init(int argc, char **argv)
......
......@@ -35,10 +35,10 @@
#include "piglit-util.h"
#include "piglit-framework.h"
int piglit_window_mode = GLUT_RGBA;
int piglit_width = 16;
int piglit_height = 16;
PIGLIT_GL_TEST_MAIN(
16 /*window_width*/,
16 /*window_height*/,
GLUT_RGBA)
enum piglit_result piglit_display(void)
{
......
......@@ -40,9 +40,10 @@
#define TEST_COLS 5
#define BOX_SIZE (1 << (TEST_COLS + 1))
int piglit_width = (BOX_SIZE + 2) * TEST_COLS + 1;
int piglit_height = (BOX_SIZE + 1) + 1;
int piglit_window_mode = GLUT_RGB | GLUT_DOUBLE;
PIGLIT_GL_TEST_MAIN(
(BOX_SIZE + 2) * TEST_COLS + 1 /*window_width*/,
(BOX_SIZE + 1) + 1 /*window_height*/,
GLUT_RGB | GLUT_DOUBLE)
static GLuint tex[1];
......
......@@ -26,10 +26,10 @@
#include "piglit-util.h"
int piglit_width = 100;
int piglit_height = 100;
int piglit_window_mode = GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_STENCIL;
PIGLIT_GL_TEST_MAIN(
100 /*window_width*/,
100 /*window_height*/,
GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_STENCIL)
enum piglit_result
piglit_display(void)
......
#include "piglit-util.h"
int piglit_width = 512, piglit_height = 512;
int piglit_window_mode = GLUT_RGBA;
PIGLIT_GL_TEST_MAIN(
512 /*window_width*/,
512 /*window_height*/,
GLUT_RGBA)
void
piglit_init(int argc, char *argv[])
......
......@@ -5,8 +5,10 @@
#include "piglit-util.h"
int piglit_width = 100, piglit_height = 100;
int piglit_window_mode = GLUT_DOUBLE | GLUT_RGBA;
PIGLIT_GL_TEST_MAIN(
100 /*window_width*/,
100 /*window_height*/,
GLUT_DOUBLE | GLUT_RGBA)
enum piglit_result
piglit_display(void)
......
......@@ -35,9 +35,10 @@
#define TEST_COLS 6
#define TEST_ROWS 2
int piglit_window_mode = GLUT_DOUBLE | GLUT_RGB;
int piglit_width = 1 + ((BOX_SIZE + 1) * TEST_COLS);
int piglit_height = 1 + ((BOX_SIZE + 1) * TEST_ROWS);
PIGLIT_GL_TEST_MAIN(
1 + ((BOX_SIZE + 1) * TEST_COLS) /*window_width*/,
1 + ((BOX_SIZE + 1) * TEST_ROWS) /*window_height*/,
GLUT_DOUBLE | GLUT_RGB)
static float maxSize = 0.0f;
static GLuint tex;
......
......@@ -18,8 +18,10 @@
#include "piglit-util.h"
#include "piglit-framework.h"
int piglit_width = 100, piglit_height = 100;
int piglit_window_mode = GLUT_DOUBLE | GLUT_RGBA;
PIGLIT_GL_TEST_MAIN(
100 /*window_width*/,
100 /*window_height*/,
GLUT_DOUBLE | GLUT_RGBA)
static GLfloat colors[8][3] = {
{ 1.0, 1.0, 1.0 },
......
......@@ -33,8 +33,10 @@
#include "piglit-util.h"
#include "piglit-framework.h"
int piglit_width = 256, piglit_height = 128;
int piglit_window_mode = GLUT_RGB | GLUT_DOUBLE;
PIGLIT_GL_TEST_MAIN(
256 /*window_width*/,
128 /*window_height*/,
GLUT_RGB | GLUT_DOUBLE)
static const GLfloat TextureColor[3] = { 1.0, 0.5, 0.0 };
......
......@@ -30,10 +30,10 @@
#include "piglit-util.h"
int piglit_width = 400, piglit_height = 400;
int piglit_window_mode = GLUT_RGB | GLUT_DOUBLE;
PIGLIT_GL_TEST_MAIN(
400 /*window_width*/,
400 /*window_height*/,
GLUT_RGB | GLUT_DOUBLE)
static void
make_texture(void)
......
......@@ -33,10 +33,10 @@
#include "piglit-util.h"
#include "piglit-framework.h"
int piglit_window_mode = GLUT_DOUBLE | GLUT_RGB;
int piglit_width = 100, piglit_height = 100;
PIGLIT_GL_TEST_MAIN(
100 /*window_width*/,
100 /*window_height*/,
GLUT_DOUBLE | GLUT_RGB)
enum piglit_result
piglit_display(void)
......
......@@ -34,9 +34,11 @@
#include "piglit-util.h"
#define BUF_WIDTH 32
int piglit_width = 50;
int piglit_height = 20;
int piglit_window_mode = GLUT_DOUBLE | GLUT_DEPTH;
PIGLIT_GL_TEST_MAIN(
50 /*window_width*/,
20 /*window_height*/,
GLUT_DOUBLE | GLUT_DEPTH)
static int
create_1d_fbo(void)
......
......@@ -35,9 +35,11 @@
#define BUF_WIDTH 32
#define BUF_HEIGHT 32
int piglit_width = 200;
int piglit_height = 100;
int piglit_window_mode = GLUT_DOUBLE | GLUT_RGB;
PIGLIT_GL_TEST_MAIN(
200 /*window_width*/,
100 /*window_height*/,
GLUT_DOUBLE | GLUT_RGB)
#define NUM_DEPTHS 6
#define POT_DEPTHS 8
......
......@@ -33,9 +33,10 @@
#include "piglit-util.h"
int piglit_width = 128;
int piglit_height = 128;
int piglit_window_mode = GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE;
PIGLIT_GL_TEST_MAIN(
128 /*window_width*/,
128 /*window_height*/,
GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE)
enum piglit_result
piglit_display(void)
......
......@@ -30,10 +30,10 @@
#include "piglit-util.h"
#include "fbo-formats.h"
int piglit_width = 128;
int piglit_height = 64;
int piglit_window_mode = GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE;
PIGLIT_GL_TEST_MAIN(
128 /*window_width*/,
64 /*window_height*/,
GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE)
/**
* Draw a quad with alpha testing
......
......@@ -31,9 +31,11 @@
#include "piglit-util.h"
#define BUF_WIDTH 32
int piglit_width = 32;
int piglit_height = 32;
int piglit_window_mode = GLUT_DOUBLE | GLUT_DEPTH | GLUT_ALPHA;
PIGLIT_GL_TEST_MAIN(
32 /*window_width*/,
32 /*window_height*/,
GLUT_DOUBLE | GLUT_DEPTH | GLUT_ALPHA)
static void create_fbo(GLuint *out_tex)
{
......
......@@ -30,9 +30,12 @@
#include "piglit-util.h"
#define BUF_WIDTH 32
int piglit_width = 32;
int piglit_height = 32;
int piglit_window_mode = GLUT_DOUBLE | GLUT_DEPTH | GLUT_ALPHA;
PIGLIT_GL_TEST_MAIN(
32 /*window_width*/,
32 /*window_height*/,
GLUT_DOUBLE | GLUT_DEPTH | GLUT_ALPHA)
GLuint prog;
static const char *vs_source =
......
......@@ -37,9 +37,11 @@
#define BUF_WIDTH 32
#define BUF_HEIGHT 32
int piglit_width = 200;
int piglit_height = 100;
int piglit_window_mode = GLUT_DOUBLE | GLUT_RGB;
PIGLIT_GL_TEST_MAIN(
200 /*window_width*/,
100 /*window_height*/,
GLUT_DOUBLE | GLUT_RGB)
#define NUM_LAYERS 6
......
......@@ -33,9 +33,10 @@
#include "piglit-util.h"
int piglit_width = 100, piglit_height = 100;
int piglit_window_mode = GLUT_DOUBLE | GLUT_RGB;
PIGLIT_GL_TEST_MAIN(
100 /*window_width*/,
100 /*window_height*/,
GLUT_DOUBLE | GLUT_RGB)
/* Test binding and return error code */
static GLenum
......
......@@ -30,10 +30,10 @@
#include "piglit-util.h"
#include "fbo-formats.h"
int piglit_width = 128;
int piglit_height = 64;
int piglit_window_mode = GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE;
PIGLIT_GL_TEST_MAIN(
128 /*window_width*/,
64 /*window_height*/,
GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE)
static void blend(const float *rect, const float *src, const float *dst, const float *blendcol,