129 Commits

Author SHA1 Message Date
Corentin Noël
dca1d2a470 ci: Use Meson build system instead of autotools 2025-05-11 00:12:36 +02:00
Corentin Noël
2b83240b9b meson: Use IOLIBS and CAMLIBS environment variable for testing 2025-05-09 14:49:32 +02:00
Corentin Noël
2571c3f016 meson: Link test-i18n against intl 2025-05-09 09:50:32 +02:00
Corentin Noël
f5bb6c875c Add Meson build system 2025-01-08 10:10:36 +01:00
axxel
f41df32817 fix white-space and indentation inconsistencies (second round)
This is basically a continuation of the work from #1002 but her for the
camlibs directory. The purpose was to replace spaces as a means for
indentation with tab characters.

Note: there are some files which are still offending the general
rule but are (mostly) consistent within themselves. I let them be for
the moment. Fixing them would basically replace the whole file.

Also: there are still a ton of whitespace related inconsistencies like
"x=10" vs "x = 10" or "func(10)" vs "func (10)".

This is a whitespace only change (if you include newlines as whitespace).
2024-09-15 10:53:41 +02:00
Hans Ulrich Niedermann
6b595a34ad Define main function as "int main(void)" (with void) 2022-11-11 09:55:40 +01:00
Hans Ulrich Niedermann
6f5bd93820 Add test-init-localedir test program 2022-05-19 17:11:24 +02:00
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
e329fac278 tests: declare local variable local
Declare local variable local by declaring it static.

This avoids the clang warning about the variable not being declared
static.
2021-10-26 22:20:46 +02:00
Hans Ulrich Niedermann
aa9097e27c tests: include system headers before gphoto2 headers
In the pedantic compilation tests, include the system headers
before gphoto2 headers - which should be the way to do things.
2021-10-26 13:38:34 +02:00
Hans Ulrich Niedermann
f9a9024159 test-camera-list: Widen column for 4 digit number of camlibs
As the number of cameras in the list is about 2800 right now,
widening the column from 3 to 4 digits makes sense.
2021-10-13 22:27:22 +02:00
Hans Ulrich Niedermann
2f88b7788d test-camera-list: Add --help output 2021-10-13 22:24:22 +02: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
e2c0497dbe comment out unused constant/variable definition 2021-10-03 17:41:15 +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
Siim Meerits
456a1d598b Remove trailing whitespace from all *.h and *.c files. 2020-07-27 17:37:00 +03:00
Yuri Chornoivan
d385c32653 Fix minor typos 2020-05-25 12:32:37 +03: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
Hans Ulrich Niedermann
c02ffbc1f1 Add $(AM_MAKEFLAGS) for every $(MAKE)
For every $(MAKE) use in Makefile.am or Makefile-files, we
add $(AM_MAKEFLAGS) so we can pass the make flags to the
called make subprocess.
2020-01-18 19:33:16 +01:00
Marcus Meissner
29b16546b6 add log_remove func too 2017-06-03 17:50:04 +02:00
Marcus Meissner
033b9cf60e also use gp_log_remove_func, to test
https://github.com/gphoto/libgphoto2/pull/171
2017-06-03 11:35:21 +02:00
Marcus Meissner
452bf3f6d6 remove umlauts from files
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15020 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-06-27 05:16:32 +00:00
Marcus Meissner
e403964868 From: "Daniel P. Berrange" <dan@berrange.com>
The test-filesys.c code is calling gp_filesystem_get_folder and
passing in a 'const char **' instead of 'char **'. It then forgets
to free the heap-allocated result.




git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14892 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-04-11 19:56:23 +00:00
Marcus Meissner
098b80e900 fixed big endian
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14799 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-02-26 07:57:51 +00: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
b2e00b55c4 new fsf address
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14607 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-01-01 20:07:21 +00:00
Marcus Meissner
b15c00a672 test for duplicated names.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14591 67ed7778-7388-44ab-90cf-0a291f65f57c
2013-12-01 20:04:25 +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
Dan Fandrich
69465b70e3 Replaced C99-style comments
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@13311 67ed7778-7388-44ab-90cf-0a291f65f57c
2010-09-15 08:08:24 +00:00
Marcus Meissner
f39d48a509 use the new functions, fix logging
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12847 67ed7778-7388-44ab-90cf-0a291f65f57c
2010-03-26 21:24:37 +00:00
Marcus Meissner
76a2142364 logging functions are not varargs anymore
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12810 67ed7778-7388-44ab-90cf-0a291f65f57c
2010-03-20 22:24:24 +00:00
Dan Fandrich
7eb2debedc Removed unneeded and incorrect check for HAVE_FLEX_BISON
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12323 67ed7778-7388-44ab-90cf-0a291f65f57c
2009-07-31 08:12:23 +00:00
Dan Fandrich
f6c4c628f3 Fixed a bunch of C89 and SUS portability issues.
Fixed a buffer overflow in the AOX driver.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12305 67ed7778-7388-44ab-90cf-0a291f65f57c
2009-07-30 18:15:21 +00:00
Marcus Meissner
a3ee73043c * removed CameraFileInfoFile.name, adjusted users
and callers.
* added filename argument to put_file_func, 
  set_info_noop and set_file_noop functions.
adjusted all camlibs


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@11773 67ed7778-7388-44ab-90cf-0a291f65f57c
2009-01-25 20:30:53 +00:00
Marcus Meissner
0769632ad9 removed .cvsignore
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@11354 67ed7778-7388-44ab-90cf-0a291f65f57c
2008-09-26 12:27:36 +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
Hans Ulrich Niedermann
43e9290933 fix typo in path
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10581 67ed7778-7388-44ab-90cf-0a291f65f57c
2007-08-11 18:48:16 +00:00
Hans Ulrich Niedermann
74e4970f64 Fix typo, code cosmetics
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10580 67ed7778-7388-44ab-90cf-0a291f65f57c
2007-08-11 18:47:44 +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