gpgme: prerequisite for running tests under gpgme/tests/gpg

Seiya Kawashima skawashima at uchicago.edu
Thu Jun 9 19:04:58 CEST 2016


> The required keys are imported before the test and a dedicated gpg-agent
> is started.  For example the import is done by the Makefile.am targets
> ./private-keys-v1.d/gpg-sample.stamp
> and
>  ./pubring-stamp
> which are triggered by check-local, which is triggered by the
> check target (Automake created; check the created Makefile).

As you suggested, I took a look at the created Makefile under gpgme/tests/gpg and ran the commands like below on my machine, openSUSE 13.1 (Bottle) (x86_64). If I followed your suggestion correctly, all the tests pass. I appreciate your help on this matter.
~/Downloads/gpgme-1.6.0/tests/gpg>make clean
~/Downloads/gpgme-1.6.0/tests/gpg>make
~/Downloads/gpgme-1.6.0/tests/gpg>make check-TESTS
===================
All 23 tests passed
===================

Now I would like to make sure a couple of more things to understand the tests under gpgme/tests/gpg. Please forgive me if I miss something.

Now If I type the commands like below to run individual tests under gpgme/tests/gpg, would these tests be able to run ? I would need to take a closer look at the test files and the created Makefile but I believe that they would not run because the required keys are not imported. The required keys are imported by initial.test on the created Makefile. I believe that this would be expected or I must have missed a way to run individual tests on the created Makefile.
~/Downloads/gpgme-1.6.0/tests/gpg> ./t-decrypt
t-decrypt.c:65: GPGME: Decryption failed
~/Downloads/gpgme-1.6.0/tests/gpg> ./t-decrypt-verify 
t-decrypt-verify.c:123: GPGME: Decryption failed
~/Downloads/gpgme-1.6.0/tests/gpg> ./t-encrypt       
t-encrypt.c:60: GPGME: End of file
~/Downloads/gpgme-1.6.0/tests/gpg> ./t-encrypt-sign 
t-encrypt-sign.c:116: GPGME: End of file

Now if I compile a test under gpgme/tests/gpg without make command but simply compile the test like below, would the test be able to run ? I think that it would not run because the required keys are not imported. I believe that this would also be expected or again I must have missed a way to compile individual tests on the created Makefile.
~/Downloads/gpgme-1.6.0/tests/gpg> gcc t-decrypt.c -lgpgme
~/Downloads/gpgme-1.6.0/tests/gpg> ./a.out 
t-decrypt.c:65: GPGME: Decryption failed

Thank you
Seiya



More information about the Gnupg-devel mailing list