mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
tests: add compatibility layer
Make test-lib-common.sh load test-lib-<$PLATFORM>.sh to create additional shim for platform specifics. Use test-lib-FREEBSD.sh to call GNU utilities instead of native ones. - amended by db following Tomi's suggestions
This commit is contained in:
parent
e1ddd27968
commit
9b7dbed58e
4 changed files with 28 additions and 0 deletions
3
configure
vendored
3
configure
vendored
|
@ -1199,6 +1199,9 @@ NOTMUCH_PYTHON=${python}
|
||||||
# Are the ruby development files (and ruby) available? If not skip
|
# Are the ruby development files (and ruby) available? If not skip
|
||||||
# building/testing ruby bindings.
|
# building/testing ruby bindings.
|
||||||
NOTMUCH_HAVE_RUBY_DEV=${have_ruby_dev}
|
NOTMUCH_HAVE_RUBY_DEV=${have_ruby_dev}
|
||||||
|
|
||||||
|
# Platform we are run on
|
||||||
|
PLATFORM=${platform}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Finally, after everything configured, inform the user how to continue.
|
# Finally, after everything configured, inform the user how to continue.
|
||||||
|
|
11
test/README
11
test/README
|
@ -33,6 +33,17 @@ chosen directory to your PATH before running the tests.
|
||||||
|
|
||||||
e.g. env PATH=/opt/gnu/bin:$PATH make test
|
e.g. env PATH=/opt/gnu/bin:$PATH make test
|
||||||
|
|
||||||
|
For FreeBSD you need to install latest gdb from ports or packages and
|
||||||
|
provide path to it in TEST_GDB environment variable before executing
|
||||||
|
the tests, native FreeBSD gdb does not not work. If you install
|
||||||
|
coreutils, which provides GNU versions of basic utils like 'date' and
|
||||||
|
'base64' on FreeBSD, the test suite will use these instead of the
|
||||||
|
native ones. This provides robustness against portability issues with
|
||||||
|
these system tools. Most often the tests are written, reviewed and
|
||||||
|
tested on Linux system so such portability issues arise from time to
|
||||||
|
time.
|
||||||
|
|
||||||
|
|
||||||
Running Tests
|
Running Tests
|
||||||
-------------
|
-------------
|
||||||
The easiest way to run tests is to say "make test", (or simply run the
|
The easiest way to run tests is to say "make test", (or simply run the
|
||||||
|
|
9
test/test-lib-FREEBSD.sh
Normal file
9
test/test-lib-FREEBSD.sh
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# If present, use GNU Coreutils instead of a native BSD utils
|
||||||
|
if command -v gdate >/dev/null
|
||||||
|
then
|
||||||
|
date () { gdate "$@"; }
|
||||||
|
base64 () { gbase64 "$@"; }
|
||||||
|
wc () { gwc "$@"; }
|
||||||
|
sed () { gsed "$@"; }
|
||||||
|
sha256sum () { gsha256sum "$@"; }
|
||||||
|
fi
|
|
@ -66,6 +66,11 @@ export LD_LIBRARY_PATH
|
||||||
# configure output
|
# configure output
|
||||||
. $notmuch_path/sh.config || exit 1
|
. $notmuch_path/sh.config || exit 1
|
||||||
|
|
||||||
|
# load OS specifics
|
||||||
|
if [ -e ./test-lib-$PLATFORM.sh ]; then
|
||||||
|
. ./test-lib-$PLATFORM.sh || exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if test -n "$valgrind"
|
if test -n "$valgrind"
|
||||||
then
|
then
|
||||||
make_symlink () {
|
make_symlink () {
|
||||||
|
|
Loading…
Reference in a new issue