Commit Graph

42 Commits

Author SHA1 Message Date
Hans Ulrich Niedermann
d65a7211d4 Add test-i18n.c i18n test program 2021-12-12 16:35:48 +01:00
Hans Ulrich Niedermann
2fa2726d91 The pedantic compilation flags might ignore some warnings 2021-11-17 19:30:53 +01:00
Hans Ulrich Niedermann
7c926d74b5 rearrange test-pedantic definitions 2021-11-14 21:26:56 +01:00
Hans Ulrich Niedermann
eef3638d22 tests: add pedantic compile tests for -std={c2x,c++20}
Add a pedantic C compile test for c2x in addition to
the existing ones for c90, c99, and c11.

Add a pedantic C++ compile test for c++20 in addition to
the existing ones for c++98, c++11, c++14, and c++17.
2021-11-03 21:18:55 +01:00
Hans Ulrich Niedermann
d7823edd44 tests: Always define, but only test conditionally
Always define the test programs, but only conditionally test them.

This makes certain that they can be build, that the sources are
added to the dist tarball, etc.
2021-11-03 21:18:55 +01:00
Hans Ulrich Niedermann
44a1b1a699 tests: Remove old pedantic compilation tests
These did not work with C++ on FreeBSD 13 anyway, due to
c++98 not working there, which the old pedantic compilation
just assumed was working without testing it in configure.

The new pedantic compilation tests offer a multitude of
language standards including c++98, but only tries building
the pedantic compilation tests for those language standards
for which configure has shown that building programs is
possible at all.
2021-11-03 21:18:55 +01:00
Hans Ulrich Niedermann
767ee8bad4 Avoid accidental include file name collisions
There are five libgphoto2 internal *.h include files inside the
source tree's `libgphoto2/` folder. Internal means they are part
of the libgphoto2 implementation, and are not part of the public
libgphoto2 API or ABI. These files have names which are so
generic that it is difficult to see from a `#include` statement
that the included file is actually part of libgphoto2:

    bayer-types.h
    bayer.h
    exif.h
    gamma.h
    jpeg.h

While building, an additional file is created inside the `libgphoto2/`
folder with a name which does hint to its relationship with libgphoto2:

    gphoto2-endian.h

To reduce the probability of accidental conflicts with include files
which might also be called the same very generic name, this changes
the use of these include files to a preprocessor directive like

    #include "libgphoto2/bayer.h>

instead of

    #include "bayer.h"

To enforce the need for the "libgphoto2/" part in the #include
preprocessor directive, this also removes the respective `-I`
arguments for the `libgphoto2` subdir (both in source tree and in
build tree) from `*_CPPFLAGS`.

This change was inspired by `libgphoto2/` and `camlibs/stv0680/`
containing very different include files both called `bayer.h`.
2021-10-11 09:20:50 +02:00
Hans Ulrich Niedermann
4316f75ed4 Remove obsolete gp2ddb (gphoto2 device database) idea
The gphoto2 device database (gp2ddb) was originally intended to
replace the device lists in the camlib code by a device list
maintained in a text file outside of the camlib C code.

This device list file could then be changed without
recompiling camlibs, at the cost of adding a simple gp2ddb
to internal binary representation compiler to libgphoto2.

This would have allowed a user to very easily add a new camera
model to the list of camera models supported by a specific
camlib, as long as that new camera model uses the same
protocol as already supported camera models do.

As the gp2ddb idea has never been developed any further in the
15 yearns since my initial commit from 2006, this idea appears
to be obsolete and can thus be removed from the codebase.
2021-04-01 20:07:08 +02:00
Hans Ulrich Niedermann
6f65d24796 Make sure both C and C++ programs including gphoto2 headers compile
Check that programs including libgphoto2 headers compile
when compiled for a number of different language standards:

    C:   ansi c99 c11
    C++: ansi c++98 c++11 c++14 c++17

For each of these language standards, if the compiler does not
compile an empty example program, we do not test whether compiling
with the gphoto2/*.h headers included works.

This will work with GCC as the compiler, and also should work with
CLANG as the compiler as CLANG is mostly compatible in these matters.

On other compilers, the test compile of the empty program should
fail, and thus no checks with the gphoto2/*.h headers included will
be performed.

C90/ANSI C apparently does not define __STDC_VERSION__, so the
C source code needed to be changed to become ANSI C compatible.

In C++ pedantic compilation source, we now use actual C++ code
instead of relying on C code working when compiled as C++ code.

In Travis CI, we now actually require both C and C++.
2020-02-19 05:10:00 +01:00
Hans Ulrich Niedermann
2b294a074c tests/Makefile.am: Consistent comments and definitions
Consistently define test programs, and use comments to
structurize the tests/Makefile.am file.
2020-02-19 05:08:08 +01:00
Hans Ulrich Niedermann
94c0fdb0e1 Add print-libgphoto2-version program
The new print-libgphoto2-version program prints the complete
libgphoto2 version message in both short and verbose.

This functionality had not been available before, and we
want it for checking later changes to the camlib list part
of the version messages.
2020-02-15 02:56:38 +01:00
Marcus Meissner
9952f513f9 fixed building
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14798 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-02-26 07:28:38 +00:00
Marcus Meissner
ac04ac3bf4 added a test-endian to check our endianess macros
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14797 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-02-26 07:07:09 +00:00
Marcus Meissner
60038db2e4 cleaned up AM_CPPFLAGS and CPPFLAGS usage patterns.
AM_CPPFLAGS and CPPFLAGS are used both during build, so
no need to use merge them together in configure.
also move the -I$(xx) stuff into Makefile* to avoid
shell expansion issues.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14269 67ed7778-7388-44ab-90cf-0a291f65f57c
2013-03-10 14:59:08 +00:00
Hans Ulrich Niedermann
3664ae290f Also link against $(LIBLTDL) if linking against libgphoto2.la
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10794 67ed7778-7388-44ab-90cf-0a291f65f57c
2007-10-17 03:02:57 +00:00
Hans Ulrich Niedermann
85df1337a9 Rework testing of camera libs
* remove check-camera-list.sh script
* run test-camera-list at "make check" with not-yet-installed camlibs
* run test-camera-list at "make installcheck" with the installed camlibs
* rely on presence of working "env" command for these tests


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10582 67ed7778-7388-44ab-90cf-0a291f65f57c
2007-08-11 19:01:46 +00:00
Marcus Meissner
b96c54c9a5 revert to prev checkin
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9829 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-12-31 18:54:14 +00:00
Marcus Meissner
d4e727834d fixed warning for \' by just using '
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9828 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-12-31 18:36:23 +00:00
Hans Ulrich Niedermann
e64144813f make sure that the pedantic compilation tests work
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9768 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-12-29 11:01:45 +00:00
Hans Ulrich Niedermann
cb23f70b2a Use _GPHOTO2_INTERNAL_CODE to compile internal code, put GP_DEBUG there.
* GP_DEBUG now is only available if _GPHOTO2_INTERNAL_CODE is defined.
  * _GPHOTO2_INTERNAL_CODE is defined via AM_CPPFLAGS, so all code should
    be compiled correctly.
  * Users of GP_DEBUG external to the gphoto project should use something
    else.



git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9265 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-10-04 19:08:12 +00:00
Hans Ulrich Niedermann
f254047b9a separate between CPPFLAGS, CFLAGS, CXXFLAGS and their AM_ equivalent
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9258 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-10-03 20:01:36 +00:00
Hans Ulrich Niedermann
df143cc2e6 check for C++ compiler, define HAVE_GCC an HAVE_CXX, make test-pedantic-cxx depend on HAVE_CXX
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9254 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-10-03 14:01:21 +00:00
Hans Ulrich Niedermann
9a5a1357a4 compile C++ pedantic test case, add more header files
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9252 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-10-03 13:51:25 +00:00
Hans Ulrich Niedermann
ccf2a1ab38 add pedantic compilation test cases
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9250 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-10-03 13:33:43 +00:00
Hans Ulrich Niedermann
4b8a7c7514 configure/make cleanup removing about 60 lines of make/check/config code
* generate check- scripts from config.status
  * use libexecdir for print-* utilities
  * let utilsdir be defined from configure
  * require libexif >= 0.6.13; automatically update libgphoto2.pc with that.
  * get rid of "make check" local installation
  * moved some tests from "make check" to "make installcheck"
  * use one common rule file for "make installcheck"



git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9231 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-09-29 15:15:04 +00:00
Hans Ulrich Niedermann
30ac3cc51d get rid of a few GNU-make-isms (% rules)
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9219 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-09-28 02:31:30 +00:00
Hans Ulrich Niedermann
3a929bdabf do less 'make check' local test install hacks -> do 'make installcheck' instead
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9187 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-09-19 02:18:28 +00:00
Hans Ulrich Niedermann
2d2b54d23c Add experimental code for camlib-external database.
Read tests/ddb/README.ddb if you want to play with it.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9104 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-08-18 17:15:20 +00:00
Hans Ulrich Niedermann
b893f50556 let test-camera-list rely on libtool wrapper script to find the library; only install the required subdirectories for camera list; shorten path to test camlib dir to stay under 128 character limit; remove obsolete INCLUDES definition from Makefile.am
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@8334 67ed7778-7388-44ab-90cf-0a291f65f57c
2005-12-25 19:16:24 +00:00
Hans Ulrich Niedermann
4e74efa525 improve camera list test with error checks
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@8081 67ed7778-7388-44ab-90cf-0a291f65f57c
2005-06-12 15:00:09 +00:00
Hans Ulrich Niedermann
8bb0626d92 correctly link test programs
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@7931 67ed7778-7388-44ab-90cf-0a291f65f57c
2005-05-02 19:37:28 +00:00
Hans Ulrich Niedermann
33838dd319 test whether installing camlibs worked
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@7922 67ed7778-7388-44ab-90cf-0a291f65f57c
2005-04-29 22:33:50 +00:00
Hans Ulrich Niedermann
4f80662800 use $(top_builddir) instead of .../
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@6898 67ed7778-7388-44ab-90cf-0a291f65f57c
2003-10-27 22:45:25 +00:00
Arnaud Launay
a82a4595a1 use $(INTLLIBS), suggested by Lutz
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5500 67ed7778-7388-44ab-90cf-0a291f65f57c
2002-10-27 22:04:37 +00:00
Arnaud Launay
b0cf461c55 add locally compiled libintl to ld
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5499 67ed7778-7388-44ab-90cf-0a291f65f57c
2002-10-27 11:14:55 +00:00
Lutz Mueller
acf5e06244 Another include fix...
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@3412 67ed7778-7388-44ab-90cf-0a291f65f57c
2001-12-05 22:22:46 +00:00
Lutz Mueller
489b4f7d85 Fix includes.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@3410 67ed7778-7388-44ab-90cf-0a291f65f57c
2001-12-05 22:13:01 +00:00
Lutz Mueller
7f35c8640b Remove cruft.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@3178 67ed7778-7388-44ab-90cf-0a291f65f57c
2001-11-24 10:52:20 +00:00
Lutz Mueller
782d492d8c *** empty log message ***
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2498 67ed7778-7388-44ab-90cf-0a291f65f57c
2001-10-12 11:05:11 +00:00
Lutz Mueller
128a5df419 *** empty log message ***
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2497 67ed7778-7388-44ab-90cf-0a291f65f57c
2001-10-12 11:02:55 +00:00
Lutz Mueller
2904bec881 2001-08-19 Lutz M�ller <urc8@rz.uni-karlsruhe.de>
* tests/test-filesys.c: New
        * tests/Makefile.am: Compile test-filesys.c
        * libgphoto2/filesys.c: Several bugfixes - there are still bugs in
        there.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2014 67ed7778-7388-44ab-90cf-0a291f65f57c
2001-08-19 18:57:52 +00:00
Lutz Mueller
f2bc06c8d5 2001-08-17 Lutz M�ller <urc8@rz.uni-karlsruhe.de>
* tests/*: New
        * configure.in:
        * Makefile.am: Add tests to SUBDIRS and generate the Makefile
        * frontents/command-line/test.[c,h]: Removed
        * frontends/command-line/main.c:
        * frontents/command-line/Makefile.am: Reflect changes


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@1999 67ed7778-7388-44ab-90cf-0a291f65f57c
2001-08-17 22:35:50 +00:00