tests: Add a test for the internal locking
authorWerner Koch <wk@gnupg.org>
Thu, 9 Jan 2014 18:14:09 +0000 (19:14 +0100)
committerWerner Koch <wk@gnupg.org>
Fri, 24 Jan 2014 15:01:25 +0000 (16:01 +0100)
commitff91ec934ed52294cddcd7dcfacc04721a0487bf
tree5a793224d62b52d028348df1ab11f96df27b32e3
parent24e65d715812cea28732397870cb1585b8435521
tests: Add a test for the internal locking

* src/global.c (external_lock_test): New.
(_gcry_vcontrol): Call new function with formerly reserved code 61.

* tests/t-common.h: New. Taken from current libgpg-error.
* tests/t-lock.c: New.  Based on t-lock.c from libgpg-error.
* configure.ac (HAVE_PTHREAD): Set macro to 1 if defined.
(AC_CHECK_FUNCS): Check for flockfile.
* tests/Makefile.am (tests_bin): Add t-lock.
(noinst_HEADERS): Add t-common.h
(LDADD): Move value to ...
(default_ldadd): new.
(t_lock_LDADD): New.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit fa42c61a84996b6a7574c32233dfd8d9f254d93a)

Resolved conflicts:
* src/ath.c: Remove as not anymore used in 1.7.
* tests/Makefile.am: Merge.

Changes:

        * src/global.c (external_lock_test): Use the gpgrt function
          for locking.

        Changed subject because here we are only adding the test case.
configure.ac
src/global.c
tests/Makefile.am
tests/t-common.h [new file with mode: 0644]
tests/t-lock.c [new file with mode: 0644]