gphoto2
gphoto2 copied to clipboard
tests/testsuite test037 requires that gphoto2 is built with libexif support
Describe the bug
As described in https://github.com/gphoto/gphoto2/issues/420, the gphoto2
tests/testsuite
bash script runs its test037
unconditionally, which means that the test suite requires that gphoto2
is built with libexif
support.
However, the buildsystem and the gphoto2
source code still support building gphoto2
without libexif
support.
libgphoto2 and gphoto2 version
[user@host gphoto2]$ ./_build/master/gphoto2/gphoto2 --version | tail -n3
gphoto2 2.5.27.1 gcc, popt(m), no exif, cdk, aa, jpeg, readline
libgphoto2 2.5.27 standard camlibs, gcc, ltdl, EXIF
libgphoto2_port 0.12.0 iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi, gcc, ltdl, EXIF, USB, serial lockdev locking
[user@host gphoto2]$ git rev-parse HEAD
96dbd34de5393f6da6d402836af4aec1a7d9c573
[user@host gphoto2]$
To Reproduce Steps to reproduce the behavior:
- run
configure
- If libexif has been detected by
pkg-config
during theconfigure
run, remove theHAVE_LIBEXIF
definition fromconfig.h
to trick the build into building withoutlibexif
support. - run
make check
- verify the
make check
has not updatedconfig.h
with anHAVE_LIBEXIF
definition
Possible resolutions
Either
- add a new feature to the
tests/testsuite
shell script to teach it about skipping some tests under some build conditions - turn building with
libexif
from optional to mandatory (looks easier to implement, and reduces the overall complexity of the build)
I do not want to make that decision on my own.
OK, regarding easier to implement... well... teaching tests/testsuite
to skip some tests if necessary is not that difficult.
Possible parts of an implementation:
- AM_CONDITIONAL([LIBEXIF], [...]) in configure.ac
- In tests/Makefile.am,
if HAVE_EXIF
else
endif
exporting an env var likeSKIP_TESTS=test037
to thetestsuite
process, orTEST_FEATURES="exif foo bar"
. - The
tests/data/*.param
files could containSKIP_UNLESS=exif
whichtestsuite
then needs to honor. - If the
SKIP_UNLESS
value threatens to need a boolean expression ofTEST_FEATURES
, I would tend towards implementing the boolean complexity using nestedif HAVE_FOO
AM_CONDITIONAL
s and then passing a single identifier string for that boolean expression viaTEST_FEATURES
, which would then be used as the value ofSKIP_UNLESS
.
If we anticipate other test cases which could make use of that kind of mechanism, I would implement it.
On the other hand, the goal of reducing build complexity would be best served by always requiring libexif
.