summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-08-30 16:47:28 +1000
committerDave Airlie <airlied@redhat.com>2010-08-30 16:48:44 +1000
commit14a60aad03bf8e7ee9922c81a813ee8d936851eb (patch)
tree1874907c2e13e1be8603c4126bca16d9046872f3
parentf9c8bc1109e177b187906dc3125ac0e5b3fcf92a (diff)
piglit/glean: split out fragprog1 and vertProg1 tests.
This makes them a lot easier to see what is going wrong on a test by test basic, and follows what Eric did for glsl1. It also generics the genearte-glsl1 script to take a cpp and suffix.
-rwxr-xr-xgenerate-glean-tests.py (renamed from generate-glsl1.py)28
-rw-r--r--tests/all.tests16
-rw-r--r--tests/glean-fragProg1.tests48
-rw-r--r--tests/glean-vertProg1.tests45
-rw-r--r--tests/glean/tfragprog1.cpp4
-rw-r--r--tests/glean/tglsl1.cpp4
-rw-r--r--tests/glean/tvertprog1.cpp3
7 files changed, 138 insertions, 10 deletions
diff --git a/generate-glsl1.py b/generate-glean-tests.py
index e332de5b..c0e49796 100755
--- a/generate-glsl1.py
+++ b/generate-glean-tests.py
@@ -25,11 +25,35 @@
# Authors:
# Eric Anholt <eric@anholt.net>
+from getopt import getopt, GetoptError
+
import os
import re
+import sys
+
+def usage():
+ USAGE = """\
+Usage %(progName) [cppfile] [add_prefix]
+
+cppfile: path to glean cppfile to parse
+add_suffix: prefix to have in test name i.e. glsl1 -> add_glsl1
+"""
+ print USAGE % {'progName':sys.argv[0]}
+ sys.exit(1)
def main():
- fileIN = open('tests/glean/tglsl1.cpp', 'r')
+
+ try:
+ options, args = getopt(sys.argv[1:], "hdt:n:x:", [ "help", "dry-run", "tests=", "name=", "exclude-tests=" ])
+ except GetoptError:
+ usage()
+
+ if len(args) != 2:
+ usage()
+
+ suffix = args[1]
+
+ fileIN = open(args[0], 'r')
line = fileIN.readline()
next_is_name = False
@@ -43,7 +67,7 @@ def main():
name = re.sub(r'".*',
r'',
name)
- print "add_glsl1('" + name + "')"
+ print "add_" + suffix + "('" + name + "')"
next_is_name = False
if line == " {\n":
next_is_name = True
diff --git a/tests/all.tests b/tests/all.tests
index 4b0d5f1d..52d9c979 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -24,7 +24,6 @@ glean['clipFlat'] = GleanTest('clipFlat')
glean['depthStencil'] = GleanTest('depthStencil')
glean['fbo'] = GleanTest('fbo')
glean['fpexceptions'] = GleanTest('fpexceptions')
-glean['fragProg1'] = GleanTest('fragProg1')
glean['getString'] = GleanTest('getString')
glean['logicOp'] = GleanTest('logicOp')
glean['maskedClear'] = GleanTest('maskedClear')
@@ -59,14 +58,25 @@ glean['texture_srgb'] = GleanTest('texture_srgb')
glean['texUnits'] = GleanTest('texUnits')
glean['vertArrayBGRA'] = GleanTest('vertArrayBGRA')
glean['vertattrib'] = GleanTest('vertattrib')
-glean['vertProg1'] = GleanTest('vertProg1')
def add_glsl1(name):
testname = 'glsl1-' + name
glean[testname] = GleanTest('glsl1')
- glean[testname].env['GLSL_TEST'] = name
+ glean[testname].env['PIGLIT_TEST'] = name
execfile(os.path.dirname(__file__) + '/glean-glsl1.tests')
+def add_fp1(name):
+ testname = 'fp1-' + name
+ glean[testname] = GleanTest('fragProg1')
+ glean[testname].env['PIGLIT_TEST'] = name
+execfile(os.path.dirname(__file__) + '/glean-fragProg1.tests')
+
+def add_vp1(name):
+ testname = 'vp1-' + name
+ glean[testname] = GleanTest('vertProg1')
+ glean[testname].env['PIGLIT_TEST'] = name
+execfile(os.path.dirname(__file__) + '/glean-vertProg1.tests')
+
mesa = Group()
add_plain_test(mesa, 'crossbar')
diff --git a/tests/glean-fragProg1.tests b/tests/glean-fragProg1.tests
new file mode 100644
index 00000000..4ecfaa15
--- /dev/null
+++ b/tests/glean-fragProg1.tests
@@ -0,0 +1,48 @@
+add_fp1('ABS test')
+add_fp1('ADD test')
+add_fp1('ADD with saturation')
+add_fp1('CMP test')
+add_fp1('COS test')
+add_fp1('COS test 2')
+add_fp1('DP3 test')
+add_fp1('DP4 test')
+add_fp1('DPH test')
+add_fp1('DST test')
+add_fp1('EX2 test')
+add_fp1('FLR test')
+add_fp1('FRC test')
+add_fp1('LG2 test')
+add_fp1('LIT test 1')
+add_fp1('LIT test 2 (degenerate case: 0 ^ 0 -> 1)')
+add_fp1('LIT test 3 (case x < 0)')
+add_fp1('MAD test')
+add_fp1('MAX test')
+add_fp1('MIN test')
+add_fp1('MOV test')
+add_fp1('MUL test')
+add_fp1('masked MUL test')
+add_fp1('POW test (exponentiation)')
+add_fp1('RCP test (reciprocal)')
+add_fp1('/* check that RCP result is replicated across XYZW */')
+add_fp1('RSQ test 1 (reciprocal square root)')
+add_fp1('RSQ test 2 (reciprocal square root of negative value)')
+add_fp1('SCS test')
+add_fp1('SGE test')
+add_fp1('SIN test')
+add_fp1('SIN test 2')
+add_fp1('SLT test')
+add_fp1('SUB test (with swizzle)')
+add_fp1('SUB with saturation')
+add_fp1('SWZ test')
+add_fp1('swizzled move test')
+add_fp1('swizzled add test')
+add_fp1('XPD test 1')
+add_fp1('Z-write test')
+add_fp1('Divide by zero test')
+add_fp1('Infinity / nan test')
+add_fp1('ARB_fog_linear test')
+add_fp1('Computed fog linear test')
+add_fp1('ARB_fog_exp test')
+add_fp1('Computed fog exp test')
+add_fp1('ARB_fog_exp2 test')
+add_fp1('Computed fog exp2 test')
diff --git a/tests/glean-vertProg1.tests b/tests/glean-vertProg1.tests
new file mode 100644
index 00000000..0b0cbcbc
--- /dev/null
+++ b/tests/glean-vertProg1.tests
@@ -0,0 +1,45 @@
+add_fp1('ABS test')
+add_fp1('ADD test')
+add_fp1('ARL test')
+add_fp1('DP3 test')
+add_fp1('DP4 test')
+add_fp1('DPH test')
+add_fp1('DST test')
+add_fp1('EX2 test')
+add_fp1('EXP test')
+add_fp1('FLR test')
+add_fp1('FRC test')
+add_fp1('LG2 test')
+add_fp1('LIT test 1')
+add_fp1('LIT test 2 (degenerate case: 0 ^ 0 -> 1)')
+add_fp1('LIT test 3 (case x < 0)')
+add_fp1('LOG test')
+add_fp1('MAD test')
+add_fp1('MAX test')
+add_fp1('MIN test')
+add_fp1('MOV test (with swizzle)')
+add_fp1('MUL test (with swizzle and masking)')
+add_fp1('POW test (exponentiation)')
+add_fp1('RCP test (reciprocal)')
+add_fp1('RSQ test 1 (reciprocal square root)')
+add_fp1('RSQ test 2 (reciprocal square root of negative value)')
+add_fp1('SGE test')
+add_fp1('SLT test')
+add_fp1('SUB test (with swizzle)')
+add_fp1('SWZ test 1')
+add_fp1('SWZ test 2')
+add_fp1('SWZ test 3')
+add_fp1('SWZ test 4')
+add_fp1('SWZ test 5')
+add_fp1('XPD test 1')
+add_fp1('XPD test 2 (same src/dst arg)')
+add_fp1('Position write test (compute position from texcoord)')
+add_fp1('Z-write test')
+add_fp1('State reference test 1 (material ambient)')
+add_fp1('State reference test 2 (light products)')
+add_fp1('State reference test 3 (fog params)')
+add_fp1('Divide by zero test')
+add_fp1('Infinity / nan test')
+add_fp1('static const char *badprog =')
+add_fp1('glBindProgramARB_func(GL_VERTEX_PROGRAM_ARB, 99);')
+add_fp1('static const GLfloat vertcoords[4][3] = {')
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 17aeb6a3..8f96d176 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -38,7 +38,7 @@
// But this test is good for regression testing to be sure that particular or
// unique programs work correctly.
-
+#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cmath>
@@ -1055,7 +1055,7 @@ void
FragmentProgramTest::runOne(MultiTestResult &r, Window &w)
{
// to test a single sub-test, set the name here:
- const char *single = NULL;
+ const char *single = getenv("PIGLIT_TEST");
(void) w;
setup();
diff --git a/tests/glean/tglsl1.cpp b/tests/glean/tglsl1.cpp
index d50c507d..5369507a 100644
--- a/tests/glean/tglsl1.cpp
+++ b/tests/glean/tglsl1.cpp
@@ -32,7 +32,7 @@
#define GL_GLEXT_PROTOTYPES
-#include <stdlib.h>
+#include <cstdlib>
#include <cassert>
#include <cstring>
#include <math.h>
@@ -4737,7 +4737,7 @@ GLSLTest::runOne(MultiTestResult &r, Window &w)
}
// If you just want to run a single sub-test, assign the name to singleTest.
- const char *singleTest = getenv("GLSL_TEST");
+ const char *singleTest = getenv("PIGLIT_TEST");
if (singleTest) {
env->log << "glsl1: Running single test: " << singleTest << "\n";
for (int i = 0; Programs[i].name; i++) {
diff --git a/tests/glean/tvertprog1.cpp b/tests/glean/tvertprog1.cpp
index 8d955e1e..7a4adcba 100644
--- a/tests/glean/tvertprog1.cpp
+++ b/tests/glean/tvertprog1.cpp
@@ -31,6 +31,7 @@
//
// See tfragprog.cpp for comments (this test is very similar).
+#include <cstdlib>
#include <cassert>
#include <cmath>
#include <cstring>
@@ -1106,7 +1107,7 @@ void
VertexProgramTest::runOne(MultiTestResult &r, Window &w)
{
// to test a single sub-test, set the name here:
- const char *single = NULL;
+ const char *single = getenv("PIGLIT_TEST");
(void) w;
setup();