aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/799.cpp2
-rw-r--r--tests/box2d/Benchmark.cpp17
-rw-r--r--tests/bullet/Demos/Benchmarks/main.cpp16
-rw-r--r--tests/cubegeom_glew.c309
-rw-r--r--tests/fannkuch.cpp4
-rw-r--r--tests/freetype/src/autofit/afdummy.c4
-rw-r--r--tests/freetype/src/autofit/aftypes.h2
-rw-r--r--tests/freetype/src/cff/cffcmap.c8
-rw-r--r--tests/freetype/src/cid/cidload.c17
-rw-r--r--tests/freetype/src/pfr/pfrcmap.c4
-rw-r--r--tests/freetype/src/psaux/t1cmap.c14
-rw-r--r--tests/freetype/src/raster/ftraster.c3
-rw-r--r--tests/freetype/src/winfonts/winfnt.c9
-rw-r--r--tests/life.c23
-rw-r--r--tests/lua/COPYRIGHT34
-rw-r--r--tests/lua/Makefile250
-rw-r--r--tests/lua/README6
-rw-r--r--tests/lua/doc/contents.html533
-rw-r--r--tests/lua/doc/logo.gifbin0 -> 4232 bytes
-rw-r--r--tests/lua/doc/lua.1116
-rw-r--r--tests/lua/doc/lua.css83
-rw-r--r--tests/lua/doc/luac.1118
-rw-r--r--tests/lua/doc/manual.css26
-rw-r--r--tests/lua/doc/manual.html10507
-rw-r--r--tests/lua/doc/osi-certified-72x60.pngbin0 -> 3774 bytes
-rw-r--r--tests/lua/doc/readme.html412
-rw-r--r--tests/lua/lua.ll78513
-rw-r--r--tests/lua/src/Makefile191
-rw-r--r--tests/lua/src/lapi.c1284
-rw-r--r--tests/lua/src/lapi.h24
-rw-r--r--tests/lua/src/lauxlib.c959
-rw-r--r--tests/lua/src/lauxlib.h212
-rw-r--r--tests/lua/src/lbaselib.c458
-rw-r--r--tests/lua/src/lbitlib.c211
-rw-r--r--tests/lua/src/lcode.c881
-rw-r--r--tests/lua/src/lcode.h83
-rw-r--r--tests/lua/src/lcorolib.c155
-rw-r--r--tests/lua/src/lctype.c52
-rw-r--r--tests/lua/src/lctype.h95
-rw-r--r--tests/lua/src/ldblib.c398
-rw-r--r--tests/lua/src/ldebug.c580
-rw-r--r--tests/lua/src/ldebug.h34
-rw-r--r--tests/lua/src/ldo.c673
-rw-r--r--tests/lua/src/ldo.h46
-rw-r--r--tests/lua/src/ldump.c173
-rw-r--r--tests/lua/src/lfunc.c161
-rw-r--r--tests/lua/src/lfunc.h33
-rw-r--r--tests/lua/src/lgc.c1213
-rw-r--r--tests/lua/src/lgc.h157
-rw-r--r--tests/lua/src/linit.c67
-rw-r--r--tests/lua/src/liolib.c665
-rw-r--r--tests/lua/src/llex.c527
-rw-r--r--tests/lua/src/llex.h78
-rw-r--r--tests/lua/src/llimits.h309
-rw-r--r--tests/lua/src/lmathlib.c279
-rw-r--r--tests/lua/src/lmem.c99
-rw-r--r--tests/lua/src/lmem.h57
-rw-r--r--tests/lua/src/loadlib.c725
-rw-r--r--tests/lua/src/lobject.c287
-rw-r--r--tests/lua/src/lobject.h607
-rw-r--r--tests/lua/src/lopcodes.c107
-rw-r--r--tests/lua/src/lopcodes.h288
-rw-r--r--tests/lua/src/loslib.c323
-rw-r--r--tests/lua/src/lparser.c1638
-rw-r--r--tests/lua/src/lparser.h119
-rw-r--r--tests/lua/src/lstate.c322
-rw-r--r--tests/lua/src/lstate.h228
-rw-r--r--tests/lua/src/lstring.c185
-rw-r--r--tests/lua/src/lstring.h46
-rw-r--r--tests/lua/src/lstrlib.c1019
-rw-r--r--tests/lua/src/ltable.c588
-rw-r--r--tests/lua/src/ltable.h41
-rw-r--r--tests/lua/src/ltablib.c283
-rw-r--r--tests/lua/src/ltm.c77
-rw-r--r--tests/lua/src/ltm.h57
-rw-r--r--tests/lua/src/lua.c497
-rw-r--r--tests/lua/src/lua.h444
-rw-r--r--tests/lua/src/lua.hpp9
-rw-r--r--tests/lua/src/luac.c432
-rw-r--r--tests/lua/src/luaconf.h551
-rw-r--r--tests/lua/src/lualib.h55
-rw-r--r--tests/lua/src/lundump.c258
-rw-r--r--tests/lua/src/lundump.h28
-rw-r--r--tests/lua/src/lvm.c867
-rw-r--r--tests/lua/src/lvm.h44
-rw-r--r--tests/lua/src/lzio.c76
-rw-r--r--tests/lua/src/lzio.h65
-rw-r--r--tests/python/python.le32.bcbin0 -> 7810608 bytes
-rw-r--r--tests/python/readme.txt16
-rwxr-xr-xtests/runner.py776
-rw-r--r--tests/skinning_test_no_simd.cpp13
-rw-r--r--tests/zlib/benchmark.c14
92 files changed, 33288 insertions, 78981 deletions
diff --git a/tests/799.cpp b/tests/799.cpp
index 56032133..6c4c9b18 100644
--- a/tests/799.cpp
+++ b/tests/799.cpp
@@ -7,7 +7,7 @@
#include <netinet/in.h>
#ifdef EMSCRIPTEN
-#include <net/arpa/inet.h>
+#include <arpa/inet.h>
#endif
#define uint16 uint16_t
diff --git a/tests/box2d/Benchmark.cpp b/tests/box2d/Benchmark.cpp
index 8ebf0457..6853a3dc 100644
--- a/tests/box2d/Benchmark.cpp
+++ b/tests/box2d/Benchmark.cpp
@@ -10,8 +10,8 @@
// Turn this on to include the y-position of the top box in the output.
#define DEBUG 0
-#define WARMUP 64
-#define FRAMES 333
+int WARMUP;
+int FRAMES;
typedef struct {
float mean;
@@ -52,7 +52,18 @@ result_t measure(clock_t times[FRAMES]) {
return r;
}
-int main() {
+int main(int argc, char **argv) {
+ int arg = argc > 1 ? argv[1][0] - '0' : 3;
+ switch(arg) {
+ case 0: return 0; break;
+ case 1: WARMUP = 5; FRAMES = 35; break;
+ case 2: WARMUP = 32; FRAMES = 161; break;
+ case 3: WARMUP = 64; FRAMES = 333; break;
+ case 4: WARMUP = 5*64; FRAMES = 7*333; break;
+ case 5: WARMUP = 10*64; FRAMES = 17*333; break;
+ default: printf("error: %d\\n", arg); return -1;
+ }
+
// Define the gravity vector.
b2Vec2 gravity(0.0f, -10.0f);
diff --git a/tests/bullet/Demos/Benchmarks/main.cpp b/tests/bullet/Demos/Benchmarks/main.cpp
index c92ef5e0..5526a31a 100644
--- a/tests/bullet/Demos/Benchmarks/main.cpp
+++ b/tests/bullet/Demos/Benchmarks/main.cpp
@@ -27,12 +27,22 @@ subject to the following restrictions:
#define NUM_DEMOS 7
-#define NUM_TESTS 200
extern bool gDisableDeactivation;
-int main(int argc,char** argv)
-{
+int main(int argc, char **argv) {
+ int NUM_TESTS;
+ int arg = argc > 1 ? argv[1][0] - '0' : 3;
+ switch(arg) {
+ case 0: return 0; break;
+ case 1: NUM_TESTS = 0; break;
+ case 2: NUM_TESTS = 7; break;
+ case 3: NUM_TESTS = 33; break;
+ case 4: NUM_TESTS = 5*33; break;
+ case 5: NUM_TESTS = 7*35; break;
+ default: printf("error: %d\\n", arg); return -1;
+ }
+
gDisableDeactivation = true;
BenchmarkDemo1 benchmarkDemo1;
diff --git a/tests/cubegeom_glew.c b/tests/cubegeom_glew.c
new file mode 100644
index 00000000..22ef5d74
--- /dev/null
+++ b/tests/cubegeom_glew.c
@@ -0,0 +1,309 @@
+/*
+THIS WORK, INCLUDING THE SOURCE CODE, DOCUMENTATION
+AND RELATED MEDIA AND DATA, IS PLACED INTO THE PUBLIC DOMAIN.
+
+THE ORIGINAL AUTHOR IS KYLE FOLEY.
+
+THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY
+OF ANY KIND, NOT EVEN THE IMPLIED WARRANTY OF
+MERCHANTABILITY. THE AUTHOR OF THIS SOFTWARE,
+ASSUMES _NO_ RESPONSIBILITY FOR ANY CONSEQUENCE
+RESULTING FROM THE USE, MODIFICATION, OR
+REDISTRIBUTION OF THIS SOFTWARE.
+*/
+
+#include "SDL/SDL.h"
+#include "GL/glew.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+void verify() {
+ int width = 640, height = 480;
+ unsigned char *data = (unsigned char*)malloc(width*height*4);
+ glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
+ int sum = 0;
+ for (int x = 0; x < width*height*4; x++) {
+ if (x % 4 != 3) sum += x * data[x];
+ }
+#if EMSCRIPTEN
+ int result = sum;
+ REPORT_RESULT();
+#endif
+}
+
+int main(int argc, char *argv[])
+{
+ int temp; // testing
+
+ SDL_Surface *screen;
+ if ( SDL_Init(SDL_INIT_VIDEO) != 0 ) {
+ printf("Unable to initialize SDL: %s\n", SDL_GetError());
+ return 1;
+ }
+
+ SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+ screen = SDL_SetVideoMode( 640, 480, 24, SDL_OPENGL );
+ if ( !screen ) {
+ printf("Unable to set video mode: %s\n", SDL_GetError());
+ return 1;
+ }
+
+ glClearColor( 0, 0, 0, 0 );
+ glClear( GL_COLOR_BUFFER_BIT );
+
+ // Create a texture
+
+ GLuint texture;
+ glGenTextures( 1, &texture );
+ glBindTexture( GL_TEXTURE_2D, texture );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
+ GLubyte textureData[16*16*4];
+ for (int x = 0; x < 16; x++) {
+ for (int y = 0; y < 16; y++) {
+ *((int*)&textureData[(x*16 + y) * 4]) = x*16 + ((y*16) << 8);
+ }
+ }
+ glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, textureData );
+
+ // Create a second texture
+
+ GLuint texture2;
+ glGenTextures( 1, &texture2 );
+ glBindTexture( GL_TEXTURE_2D, texture2 );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
+ GLubyte texture2Data[] = { 0xff, 0, 0, 0xff,
+ 0, 0xff, 0, 0xaa,
+ 0, 0, 0xff, 0x55,
+ 0x80, 0x90, 0x70, 0 };
+ glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, texture2Data );
+
+ // BEGIN
+
+ glewInit();
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ // original: glFrustum(-0.6435469817188064, 0.6435469817188064 ,-0.48266022190470925, 0.48266022190470925 ,0.5400000214576721, 2048);
+ glFrustum(-0.6435469817188064, 0.1435469817188064 ,-0.48266022190470925, 0.88266022190470925 ,0.5400000214576721, 2048);
+ glRotatef(-30, 1, 1, 1);
+ //GLfloat pm[] = { 1.372136116027832, 0, 0, 0, 0, 0.7910231351852417, 0, 0, -0.6352481842041016, 0.29297152161598206, -1.0005275011062622, -1, 0, 0, -1.080284833908081, 0 };
+ //glLoadMatrixf(pm);
+
+ glMatrixMode(GL_MODELVIEW);
+ GLfloat matrixData[] = { -1, 0, 0, 0,
+ 0, 0,-1, 0,
+ 0, 1, 0, 0,
+ 0, 0, 0, 1 };
+ glLoadMatrixf(matrixData);
+ //glTranslated(-512,-512,-527); // XXX this should be uncommented, but if it is then nothing is shown
+
+ glEnable(GL_CULL_FACE);
+ glEnable(GL_DEPTH_TEST);
+
+ glClear(GL_DEPTH_BUFFER_BIT);
+
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glEnableClientState(GL_COLOR_ARRAY);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+
+ glActiveTexture(GL_TEXTURE0);
+
+ glGetBooleanv(GL_VERTEX_ARRAY, &temp); assert(!temp);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glGetBooleanv(GL_VERTEX_ARRAY, &temp); assert(temp);
+
+ GLuint arrayBuffer, elementBuffer;
+ glGenBuffers(1, &arrayBuffer);
+ glGenBuffers(1, &elementBuffer);
+
+ GLubyte arrayData[] = {
+/*
+[0, 0, 0, 67] ==> 128 float
+[0, 0, 128, 67] ==> 256 float
+[0, 0, 0, 68] ==> 512 float
+[0, 0, 128, 68] ==> 1024 float
+
+[vertex x ] [vertex y ] [vertex z ] [nr] [texture u ] [texture v ] [lm u ] [lm v ] [color r,g,b,a ] */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, // 0
+ 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, // 1
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 2
+ 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 3
+ 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, // 4
+ 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 128, 67, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, // 5
+ 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 128, 67, 0, 0, 0, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 6
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 7
+ 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 8
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 9
+ 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 128, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 10
+ 0, 0, 0, 0, 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 11
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 12
+ 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 128, 67, 0, 0, 0, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 13
+ 0, 0, 128, 68, 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 128, 67, 0, 0, 128, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 14
+ 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 128, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 15
+
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 12