]> git.cworth.org Git - apitrace-tests/commitdiff
Add a test to ensure "apitrace trim" performs proper dependency checking
authorCarl Worth <cworth@cworth.org>
Thu, 9 Aug 2012 19:46:20 +0000 (12:46 -0700)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 1 Dec 2012 10:11:31 +0000 (10:11 +0000)
Here we trim a trace by specifying (with --calls) only the final
glXSwapBuffers and then test that we can still produce a matching
image from the trace. This will only succeed if "apitrace trim"
performs dependency checking and includes many previous calls.

Of course, historically "apitrace trim" performed no such dependency
checks, so older versions of apitrace are expected to fail this test.

cli/.gitignore
cli/CMakeLists.txt
cli/cli-trim-single-swapbuffers.script [new file with mode: 0644]

index 5e96abe539bfe0d2cd8842cea777431acfd49c67..422bc8407ef1f1e3303a6c743b88423a061753c6 100644 (file)
@@ -1,2 +1,3 @@
 !*.trace
+tri-trim.trace
 tri-out
index 39a15c86ef55d454086f8242b5341c97e1143b5e..b36669cc52e86b1eed54fb3b86a30c8dd1d993ef 100644 (file)
@@ -24,3 +24,4 @@ endfunction ()
 
 add_cli_test(NAME "cli-diff-images.script")
 add_cli_test(NAME "cli-diff-images-mismatch.script")
+add_cli_test(NAME "cli-trim-single-swapbuffers.script")
diff --git a/cli/cli-trim-single-swapbuffers.script b/cli/cli-trim-single-swapbuffers.script
new file mode 100644 (file)
index 0000000..19e10a8
--- /dev/null
@@ -0,0 +1,15 @@
+# First, trim the trace to the final glxSwapBuffers call
+
+apitrace trim --calls=27 tri.trace
+
+# Then dump the image and compare to our reference
+
+rm_and_mkdir ./tri-out
+apitrace dump-images -o ./tri-out/tri tri-trim.trace
+apitrace diff-images -v ./tri-ref ./tri-out
+
+# In addition to getting the return value indicating no error, let's
+# also require that "apitrace diff-images" gave us the output we
+# expect.
+
+expect "Comparing ./tri-ref/tri0000000027.png and ./tri-out/tri0000000027.png ... MATCH\n"