Test callsets.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 17 Mar 2012 15:44:02 +0000 (15:44 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 17 Mar 2012 15:44:02 +0000 (15:44 +0000)
18 files changed:
traces/CMakeLists.txt
traces/callset-default.script [new file with mode: 0644]
traces/callset-draw.script [new file with mode: 0644]
traces/callset-fbo.script [new file with mode: 0644]
traces/callset-file.script [new file with mode: 0644]
traces/callset-frame.script [new file with mode: 0644]
traces/callset-range-step.script [new file with mode: 0644]
traces/callset-range.script [new file with mode: 0644]
traces/callset-set-comma.script [new file with mode: 0644]
traces/callset-single.script [new file with mode: 0644]
traces/callset-wildcard-draw.script [new file with mode: 0644]
traces/callset-wildcard-fbo.script [new file with mode: 0644]
traces/callset-wildcard-frame.script [new file with mode: 0644]
traces/callset-wildcard-step.script [new file with mode: 0644]
traces/callset-wildcard.script [new file with mode: 0644]
traces/callset.calls [new file with mode: 0644]
traces/mkscript.py [new file with mode: 0755]
traces/tri.trace [new file with mode: 0644]

index 5262164282a9799b2e58fb4bd6fdcd69a8cacbf4..c1e0500d20418113b840159f77e722e734a3f8b7 100644 (file)
@@ -1,5 +1,7 @@
 file (GLOB scripts RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.script)
 
+list (SORT scripts)
+
 foreach (script ${scripts})
     add_test(
         NAME ${script}
diff --git a/traces/callset-default.script b/traces/callset-default.script
new file mode 100644 (file)
index 0000000..524e59f
--- /dev/null
@@ -0,0 +1,35 @@
+dump --verbose tri.trace
+0 glXQueryExtension(dpy = 0xfc52b0, errorb = NULL, event = NULL) = True
+1 glXChooseFBConfig(dpy = 0xfc52b0, screen = 0, attribList = {GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, GLX_ALPHA_SIZE, 1, GLX_DOUBLEBUFFER, 1, 0}, nitems = &12) = {0xfe3620, 0xfe3710, 0xfe53e0, 0xfe54d0, 0xfe38f0, 0xfe39e0, 0xfe3e90, 0xfe56b0, 0xfe57a0, 0xfe5c50, 0xfe3f80, 0xfe5d40}
+2 glXGetVisualFromFBConfig(dpy = 0xfc52b0, config = 0xfe3620) = &{visual = 0xfd00e8, visualid = 154, screen = 0, depth = 24, c_class = 4, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size = 256, bits_per_rgb = 8}
+3 glXCreateNewContext(dpy = 0xfc52b0, config = 0xfe3620, renderType = GLX_RGBA_TYPE, shareList = NULL, direct = True) = 0xfdd650
+4 glXIsDirect(dpy = 0xfc52b0, ctx = 0xfdd650) = True
+5 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+6 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+7 glGetString(name = GL_RENDERER) = "Mesa DRI Mobile Intel\2\556 GM45 Express Chipset "
+8 glGetString(name = GL_VERSION) = "2.1 Mesa 7.11.2"
+9 glGetString(name = GL_VENDOR) = "Tungsten Graphics, Inc"
+10 glClearColor(red = 0.3, green = 0.1, blue = 0.3, alpha = 0)
+11 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+12 glViewport(x = 0, y = 0, width = 250, height = 250)
+13 glMatrixMode(mode = GL_PROJECTION)
+14 glLoadIdentity()
+15 glOrtho(left = -1, right = 1, bottom = -1, top = 1, zNear = -0.5, zFar = 1000)
+16 glMatrixMode(mode = GL_MODELVIEW)
+17 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+18 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+19 glClear(mask = GL_COLOR_BUFFER_BIT)
+20 glBegin(mode = GL_TRIANGLES)
+21 glColor3f(red = 0.8, green = 0, blue = 0)
+22 glVertex3f(x = -0.9, y = -0.9, z = -30)
+23 glColor3f(red = 0, green = 0.9, blue = 0)
+24 glVertex3f(x = 0.9, y = -0.9, z = -30)
+25 glColor3f(red = 0, green = 0, blue = 0.7)
+26 glVertex3f(x = 0, y = 0.9, z = -30)
+27 glEnd()
+28 glFlush()
+29 glFlush()
+30 glXSwapBuffers(dpy = 0xfc52b0, drawable = 44040194)
+
+31 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+32 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
diff --git a/traces/callset-draw.script b/traces/callset-draw.script
new file mode 100644 (file)
index 0000000..729d6d8
--- /dev/null
@@ -0,0 +1,3 @@
+dump --verbose --calls=draw tri.trace
+19 glClear(mask = GL_COLOR_BUFFER_BIT)
+27 glEnd()
diff --git a/traces/callset-fbo.script b/traces/callset-fbo.script
new file mode 100644 (file)
index 0000000..3a6cff4
--- /dev/null
@@ -0,0 +1,3 @@
+dump --verbose --calls=fbo tri.trace
+30 glXSwapBuffers(dpy = 0xfc52b0, drawable = 44040194)
+
diff --git a/traces/callset-file.script b/traces/callset-file.script
new file mode 100644 (file)
index 0000000..3adbb33
--- /dev/null
@@ -0,0 +1,6 @@
+dump --verbose --calls=@callset.calls tri.trace
+1 glXChooseFBConfig(dpy = 0xfc52b0, screen = 0, attribList = {GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, GLX_ALPHA_SIZE, 1, GLX_DOUBLEBUFFER, 1, 0}, nitems = &12) = {0xfe3620, 0xfe3710, 0xfe53e0, 0xfe54d0, 0xfe38f0, 0xfe39e0, 0xfe3e90, 0xfe56b0, 0xfe57a0, 0xfe5c50, 0xfe3f80, 0xfe5d40}
+3 glXCreateNewContext(dpy = 0xfc52b0, config = 0xfe3620, renderType = GLX_RGBA_TYPE, shareList = NULL, direct = True) = 0xfdd650
+5 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+30 glXSwapBuffers(dpy = 0xfc52b0, drawable = 44040194)
+
diff --git a/traces/callset-frame.script b/traces/callset-frame.script
new file mode 100644 (file)
index 0000000..406215f
--- /dev/null
@@ -0,0 +1,3 @@
+dump --verbose --calls=frame tri.trace
+30 glXSwapBuffers(dpy = 0xfc52b0, drawable = 44040194)
+
diff --git a/traces/callset-range-step.script b/traces/callset-range-step.script
new file mode 100644 (file)
index 0000000..b77c13a
--- /dev/null
@@ -0,0 +1,5 @@
+dump --verbose --calls=2-11/3 tri.trace
+2 glXGetVisualFromFBConfig(dpy = 0xfc52b0, config = 0xfe3620) = &{visual = 0xfd00e8, visualid = 154, screen = 0, depth = 24, c_class = 4, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size = 256, bits_per_rgb = 8}
+5 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+8 glGetString(name = GL_VERSION) = "2.1 Mesa 7.11.2"
+11 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
diff --git a/traces/callset-range.script b/traces/callset-range.script
new file mode 100644 (file)
index 0000000..efde494
--- /dev/null
@@ -0,0 +1,7 @@
+dump --verbose --calls=2-7 tri.trace
+2 glXGetVisualFromFBConfig(dpy = 0xfc52b0, config = 0xfe3620) = &{visual = 0xfd00e8, visualid = 154, screen = 0, depth = 24, c_class = 4, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size = 256, bits_per_rgb = 8}
+3 glXCreateNewContext(dpy = 0xfc52b0, config = 0xfe3620, renderType = GLX_RGBA_TYPE, shareList = NULL, direct = True) = 0xfdd650
+4 glXIsDirect(dpy = 0xfc52b0, ctx = 0xfdd650) = True
+5 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+6 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+7 glGetString(name = GL_RENDERER) = "Mesa DRI Mobile Intel\2\556 GM45 Express Chipset "
diff --git a/traces/callset-set-comma.script b/traces/callset-set-comma.script
new file mode 100644 (file)
index 0000000..b7e3e3f
--- /dev/null
@@ -0,0 +1,6 @@
+dump --verbose --calls=1,2,3,5,7 tri.trace
+1 glXChooseFBConfig(dpy = 0xfc52b0, screen = 0, attribList = {GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, GLX_ALPHA_SIZE, 1, GLX_DOUBLEBUFFER, 1, 0}, nitems = &12) = {0xfe3620, 0xfe3710, 0xfe53e0, 0xfe54d0, 0xfe38f0, 0xfe39e0, 0xfe3e90, 0xfe56b0, 0xfe57a0, 0xfe5c50, 0xfe3f80, 0xfe5d40}
+2 glXGetVisualFromFBConfig(dpy = 0xfc52b0, config = 0xfe3620) = &{visual = 0xfd00e8, visualid = 154, screen = 0, depth = 24, c_class = 4, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size = 256, bits_per_rgb = 8}
+3 glXCreateNewContext(dpy = 0xfc52b0, config = 0xfe3620, renderType = GLX_RGBA_TYPE, shareList = NULL, direct = True) = 0xfdd650
+5 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+7 glGetString(name = GL_RENDERER) = "Mesa DRI Mobile Intel\2\556 GM45 Express Chipset "
diff --git a/traces/callset-single.script b/traces/callset-single.script
new file mode 100644 (file)
index 0000000..4dcad3f
--- /dev/null
@@ -0,0 +1,2 @@
+dump --verbose --calls=10 tri.trace
+10 glClearColor(red = 0.3, green = 0.1, blue = 0.3, alpha = 0)
diff --git a/traces/callset-wildcard-draw.script b/traces/callset-wildcard-draw.script
new file mode 100644 (file)
index 0000000..d73ea5a
--- /dev/null
@@ -0,0 +1,3 @@
+dump --verbose --calls=*/draw tri.trace
+19 glClear(mask = GL_COLOR_BUFFER_BIT)
+27 glEnd()
diff --git a/traces/callset-wildcard-fbo.script b/traces/callset-wildcard-fbo.script
new file mode 100644 (file)
index 0000000..a31ccff
--- /dev/null
@@ -0,0 +1,3 @@
+dump --verbose --calls=*/fbo tri.trace
+30 glXSwapBuffers(dpy = 0xfc52b0, drawable = 44040194)
+
diff --git a/traces/callset-wildcard-frame.script b/traces/callset-wildcard-frame.script
new file mode 100644 (file)
index 0000000..dfc956d
--- /dev/null
@@ -0,0 +1,3 @@
+dump --verbose --calls=*/frame tri.trace
+30 glXSwapBuffers(dpy = 0xfc52b0, drawable = 44040194)
+
diff --git a/traces/callset-wildcard-step.script b/traces/callset-wildcard-step.script
new file mode 100644 (file)
index 0000000..104924b
--- /dev/null
@@ -0,0 +1,9 @@
+dump --verbose --calls=*/5 tri.trace
+0 glXQueryExtension(dpy = 0xfc52b0, errorb = NULL, event = NULL) = True
+5 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+10 glClearColor(red = 0.3, green = 0.1, blue = 0.3, alpha = 0)
+15 glOrtho(left = -1, right = 1, bottom = -1, top = 1, zNear = -0.5, zFar = 1000)
+20 glBegin(mode = GL_TRIANGLES)
+25 glColor3f(red = 0, green = 0, blue = 0.7)
+30 glXSwapBuffers(dpy = 0xfc52b0, drawable = 44040194)
+
diff --git a/traces/callset-wildcard.script b/traces/callset-wildcard.script
new file mode 100644 (file)
index 0000000..71dc6e6
--- /dev/null
@@ -0,0 +1,35 @@
+dump --verbose --calls=* tri.trace
+0 glXQueryExtension(dpy = 0xfc52b0, errorb = NULL, event = NULL) = True
+1 glXChooseFBConfig(dpy = 0xfc52b0, screen = 0, attribList = {GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, GLX_ALPHA_SIZE, 1, GLX_DOUBLEBUFFER, 1, 0}, nitems = &12) = {0xfe3620, 0xfe3710, 0xfe53e0, 0xfe54d0, 0xfe38f0, 0xfe39e0, 0xfe3e90, 0xfe56b0, 0xfe57a0, 0xfe5c50, 0xfe3f80, 0xfe5d40}
+2 glXGetVisualFromFBConfig(dpy = 0xfc52b0, config = 0xfe3620) = &{visual = 0xfd00e8, visualid = 154, screen = 0, depth = 24, c_class = 4, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size = 256, bits_per_rgb = 8}
+3 glXCreateNewContext(dpy = 0xfc52b0, config = 0xfe3620, renderType = GLX_RGBA_TYPE, shareList = NULL, direct = True) = 0xfdd650
+4 glXIsDirect(dpy = 0xfc52b0, ctx = 0xfdd650) = True
+5 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+6 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+7 glGetString(name = GL_RENDERER) = "Mesa DRI Mobile Intel\2\556 GM45 Express Chipset "
+8 glGetString(name = GL_VERSION) = "2.1 Mesa 7.11.2"
+9 glGetString(name = GL_VENDOR) = "Tungsten Graphics, Inc"
+10 glClearColor(red = 0.3, green = 0.1, blue = 0.3, alpha = 0)
+11 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+12 glViewport(x = 0, y = 0, width = 250, height = 250)
+13 glMatrixMode(mode = GL_PROJECTION)
+14 glLoadIdentity()
+15 glOrtho(left = -1, right = 1, bottom = -1, top = 1, zNear = -0.5, zFar = 1000)
+16 glMatrixMode(mode = GL_MODELVIEW)
+17 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+18 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+19 glClear(mask = GL_COLOR_BUFFER_BIT)
+20 glBegin(mode = GL_TRIANGLES)
+21 glColor3f(red = 0.8, green = 0, blue = 0)
+22 glVertex3f(x = -0.9, y = -0.9, z = -30)
+23 glColor3f(red = 0, green = 0.9, blue = 0)
+24 glVertex3f(x = 0.9, y = -0.9, z = -30)
+25 glColor3f(red = 0, green = 0, blue = 0.7)
+26 glVertex3f(x = 0, y = 0.9, z = -30)
+27 glEnd()
+28 glFlush()
+29 glFlush()
+30 glXSwapBuffers(dpy = 0xfc52b0, drawable = 44040194)
+
+31 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+32 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
diff --git a/traces/callset.calls b/traces/callset.calls
new file mode 100644 (file)
index 0000000..bedc65d
--- /dev/null
@@ -0,0 +1,3 @@
+1
+3-5/2
+*/frame
diff --git a/traces/mkscript.py b/traces/mkscript.py
new file mode 100755 (executable)
index 0000000..78f28fa
--- /dev/null
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+##########################################################################
+#
+# Copyright 2012 Jose Fonseca
+# All Rights Reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+##########################################################################/
+
+'''Script generator'''
+
+
+import optparse
+import subprocess
+import sys
+
+
+def main():
+
+    # Parse command line options
+    optparser = optparse.OptionParser(
+        usage='\n\t%prog [OPTIONS] -- [ARGS] ...',
+        version='%%prog')
+    optparser.add_option(
+        '--apitrace', metavar='PROGRAM',
+        type='string', dest='apitrace', default='apitrace',
+        help='path to apitrace executable')
+    (options, args) = optparser.parse_args(sys.argv[1:])
+    if not args:
+        optparser.error('an argument must be specified')
+
+    sys.stdout.write(' '.join(args) + '\n')
+    sys.stdout.flush()
+    cmd = [options.apitrace] + args
+    p = subprocess.Popen(cmd)
+    p.wait()
+    sys.exit(p.returncode)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/traces/tri.trace b/traces/tri.trace
new file mode 100644 (file)
index 0000000..f39b0e1
Binary files /dev/null and b/traces/tri.trace differ