Line data Source code
1 : #ifndef ELEKTRA_PLUGIN_CRYPTO_GPGAGENT_TEARDOWN_H
2 : #define ELEKTRA_PLUGIN_CRYPTO_GPGAGENT_TEARDOWN_H
3 :
4 : /**
5 : * @file
6 : *
7 : * @brief common method for shutting down the gpg-agent in unit tests
8 : *
9 : * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
10 : *
11 : */
12 :
13 1 : static inline void test_teardown (void)
14 : {
15 1 : int status = system ("gpg-connect-agent --quiet KILLAGENT /bye");
16 1 : if (status != 0)
17 : {
18 0 : fprintf (stderr, "Terminating gpg-agent returned with status ā%dā", status);
19 : }
20 1 : }
21 :
22 : #endif
|