From 51faf78eaf0d373f8a7d680a145855e98946e508 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 9 Aug 2012 12:46:20 -0700 Subject: [PATCH] Add a test to ensure "apitrace trim" performs proper dependency checking 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 | 1 + cli/CMakeLists.txt | 1 + cli/cli-trim-single-swapbuffers.script | 15 +++++++++++++++ 3 files changed, 17 insertions(+) create mode 100644 cli/cli-trim-single-swapbuffers.script diff --git a/cli/.gitignore b/cli/.gitignore index 5e96abe..422bc84 100644 --- a/cli/.gitignore +++ b/cli/.gitignore @@ -1,2 +1,3 @@ !*.trace +tri-trim.trace tri-out diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index 39a15c8..b36669c 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -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 index 0000000..19e10a8 --- /dev/null +++ b/cli/cli-trim-single-swapbuffers.script @@ -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" -- 2.43.0