mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-31 14:50:13 +01:00
Merge branch 'srcdir' into 'master'
Make it easier for cairo-test-suite to find the source dir See merge request cairo/cairo!328
This commit is contained in:
commit
5dafd74116
3 changed files with 29 additions and 3 deletions
14
test/README
14
test/README
|
|
@ -17,6 +17,11 @@ file, which, when viewed in a web browser makes it quite easy to
|
|||
visually see any failed renderings alongside the corresponding
|
||||
reference image, (and a diff image as well).
|
||||
|
||||
As some browsers do not permit Javascript to read from the local
|
||||
filesystem, the view-test-results.py script can used to view the
|
||||
results. It starts a http server serving the current directory before
|
||||
displaying the test results in a browser.
|
||||
|
||||
The test suite needs to be run before any code is committed and before
|
||||
any release. See below for hints and rules governing the use of the suite.
|
||||
|
||||
|
|
@ -36,6 +41,15 @@ CAIRO_TEST_TARGET environment variable, so for instance:
|
|||
This binary should be backwards-compatible with all library versions,
|
||||
allowing you to compare current versus past behaviour for any test.
|
||||
|
||||
The test suite needs to find the "test" directory in the source
|
||||
tree. The srcdir environment variable can be used to specify
|
||||
the location of this directory. If this environment variable is not
|
||||
set, the binary looks for the directory "srcdir" in the current
|
||||
directory. The meson build system symlinks "srcdir" in the
|
||||
$builddir/test directory to the "test" directory in the source
|
||||
tree. If this is not found the binary defaults to the current
|
||||
directory.
|
||||
|
||||
Tailoring tests running
|
||||
-----------------------
|
||||
There are some mechanisms to limit the tests run during "make test".
|
||||
|
|
|
|||
|
|
@ -196,9 +196,14 @@ _cairo_test_init (cairo_test_context_t *ctx,
|
|||
ctx->own_targets = TRUE;
|
||||
|
||||
ctx->srcdir = getenv ("srcdir");
|
||||
if (ctx->srcdir == NULL)
|
||||
ctx->srcdir = ".";
|
||||
|
||||
if (ctx->srcdir == NULL) {
|
||||
ctx->srcdir = ".";
|
||||
#if HAVE_SYS_STAT_H
|
||||
struct stat st;
|
||||
if (stat ("srcdir", &st) == 0 && (st.st_mode & S_IFDIR))
|
||||
ctx->srcdir = "srcdir";
|
||||
#endif
|
||||
}
|
||||
ctx->refdir = getenv ("CAIRO_REF_DIR");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -634,6 +634,13 @@ foreach file : html_files
|
|||
configure_file(input: file, output : file, copy: true)
|
||||
endforeach
|
||||
|
||||
if build_machine.system() != 'windows'
|
||||
run_command('ln', '-sf',
|
||||
meson.current_source_dir(),
|
||||
join_paths(meson.current_build_dir(), 'srcdir'),
|
||||
check: true)
|
||||
endif
|
||||
|
||||
env = environment()
|
||||
|
||||
env.set('srcdir', meson.current_source_dir())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue