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.
add_cli_test(NAME "cli-diff-images.script")
add_cli_test(NAME "cli-diff-images-mismatch.script")
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")
--- /dev/null
+# 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"