Carl Worth [Mon, 13 Aug 2012 02:42:35 +0000 (19:42 -0700)]
trim-head: New test to ensure "apitrace trim" drops all calls after range
This test ensures that all calls beyond the user-specified range are
correctly dropped. It also ensures that uninteresting calls are
trimmed, (since the glxsimple trace includes many of those).
Carl Worth [Mon, 13 Aug 2012 00:50:04 +0000 (17:50 -0700)]
Make glxsimple loop over all drawing methods multiple times
We now have 3 different drawing methods, each performed two times, and
in a total of 6 different colors. Looping over theese things twice
means that we can trim out a single frame of any one method and ensure
that "apitrace trim" has some non-trivial trimming to do both before
and after the frame of interest.
Carl Worth [Mon, 13 Aug 2012 00:09:15 +0000 (17:09 -0700)]
Add the source of a very simple program using OpenGL through GLX.
We'll use this program to generate traces for use in the test suite,
(to exercise using "apitrace trim" to trim away unused textures,
shader programs, etc.).
There is a Makefile here, for convenience to any test writers wanting
to expand this program. Note that this Makefile us intentionally not
integrated with the cmake setup of the apitrace-tests project. That's
because it is not expected that this test program should be built or
run as a standard part of the test suite. Instead, useful trace files
generated from glxsimple will be directly committed to the
apitrace-tests repository.
Carl Worth [Mon, 13 Aug 2012 00:00:38 +0000 (17:00 -0700)]
cli: Use new --call-nos=no call to "apitrace dump-images" for consistent results
Recent "apitrace trim" is now dropping uninteresting calls by
default. This means that the call numbers of rendering operations are
changing. Consequently, image comparisons were failing not due to
image-content differences, but simply because the filenames (with
embedded call numbers in them) no longer matched.
We can avoid this problem by using the --call-nos=no option which was
added to "apitrace dump-images" in very recent versions.
Carl Worth [Thu, 9 Aug 2012 19:46:20 +0000 (12:46 -0700)]
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.
Carl Worth [Wed, 8 Aug 2012 23:18:21 +0000 (16:18 -0700)]
Add a test that "apitrace diff-images" flags mismatching images.
With this test we add a new EXPECT_FAILURE: attribute to the script
syntax to indicate that a particular apitrace command in the script is
expected to fail. This requires manually invoking the Popen
constructor rather than using subprocess.check_output, (which is
*close* to what we need but fails to assign the output when raising an
exception).
We also remove the globbing from the CMakeLists.txt file to get a
manual ordering of the tests (rather than executing in alphabetic
order).
Carl Worth [Wed, 8 Aug 2012 22:18:23 +0000 (15:18 -0700)]
Add a new 'cli' subdirectory for higher-level testing of apitrace CLI.
As described in the README, this new directory is for tests that
perform higher-level testing of the apitrace command-line interface
than either of the existing traces or apps directories.
Compared to traces, these new tests can do higher-level things like
dumping images from traces, comparing images, etc.
Compared to apps, these tests are intended to be portable across
multiple targets. (This isn't actually the case yet because commands
like "apitrace dump-images" currently work only on OpenGL. Also, even
when that is fixed, we will also need to then extend these tests to
have traces for each supported target for testing.)
In this commit, the only new test exercises "apitrace dump-images" and
"apitrace diff-images" on a simple trace file with one frame,
(tri.trace grabbed from apps/gl).
Carl Worth [Tue, 7 Aug 2012 22:47:53 +0000 (15:47 -0700)]
Add more README documentation on how existing test drivers are structured.
More than once, I've reverse-engineered how the test suite uses test
drivers (app_driver.py and tool_driver.py) to invoke scripts within
the apps/ and traces/ directory. In order to save my future-self some
work in doing this yet again, I've written some documentation in
README.markdown in each directory.
Hopefully this documentation will be useful for anyone wanting to
write additional tests.