[cairo] [PATCH v4 0/5] test: Don't ignore test output files when written to the wrong directory

Bryce W. Harrington b.harrington at samsung.com
Sun Sep 8 13:10:03 PDT 2013


Several tests write output files into the test/ directory rather than
test/output as they should.  This hasn't been noticeable because the
.gitignore file makes *.out.* files not show up when running git
status.  (Except for one of pdf-mime-data's pdf output files.)

One patch in this set corrects .gitignore so these stray output files
are no longer hidden.  The other fixes up all the tests to write them
into test/output.

[Update v4]
* Squash three commits from v3 that were implementing various requests
  from earlier code reviews.
* Further consolidate _cairo_test_mkdir to cairo_test_mkdir.
* Add missing implementation to make more tests move their output to
  output dir
* Change commit message of last commit from "test:" to "svg, test:" as
  per review comments (although it doesn't actually affect any svg code)

[Update v3]
Each test now attempts to mkdir the output path before executing, and
uses the current working dir if the output path can't be created.  This
follows the pattern of the ps-eps.c and fallback-resolution.c tests.

Each of these tests implemented copies of a private _cairo_test_mkdir()
routine; this is now promoted to cairo-test.* so more tests can utilize
it.

Tests that directly write output files, now put these into the directory
specified as CAIRO_TEST_OUTPUT_DIR (which is currently defined as
"output").

Test results run before and after this patchset are as follows:

                    Before      After      Delta
 ---------------------------------------------------
 Tests run:         24499       24499	       0
 Passed:            15378       15378	       0
 Failed:            3846         3846	       0
 Expected Failed:   429	          429	       0
 Error:             0	            1	      +1
 Crashed:           1204         1203	      -1
 Untested:          3642         3642	       0
 Total:             24499       24499	       0

The test that changed is one that just randomly errors or crashes, and
can be safely ignored.

Bryce Harrington (5):
  test: Don't ignore test output files left in test directory
  test: Fix several tests to place output files in the output directory
  test: Make cairo_test_mkdir() usable throughout tests.  Rename    
    _cairo_test_mkdir to cairo_test_mkdir and make it non-static.
  test: Ensure output dirs exist, falling back to current dir if needed
  svg, test: Refer to output filename by variable, not a hardcoded
    value

 test/.gitignore            |    4 ----
 test/cairo-test.c          |   10 +++++-----
 test/cairo-test.h          |    4 ++++
 test/create-for-stream.c   |   14 +++++++++++---
 test/fallback-resolution.c |   20 +-------------------
 test/multi-page.c          |   10 +++++++---
 test/pdf-features.c        |    7 ++++++-
 test/pdf-mime-data.c       |   13 +++++++++----
 test/pdf-surface-source.c  |    8 +++++++-
 test/png.c                 |    9 ++++++++-
 test/ps-eps.c              |   20 +-------------------
 test/ps-features.c         |    9 ++++++---
 test/ps-surface-source.c   |    8 +++++++-
 test/svg-clip.c            |    7 ++++++-
 test/svg-surface-source.c  |    8 +++++++-
 test/svg-surface.c         |    9 +++++++--
 16 files changed, 92 insertions(+), 68 deletions(-)

-- 
1.7.9.5


More information about the cairo mailing list