* tests/json/t-json.c: Remove var definitions inside a for statement.
--
This useful C99 feature seems to work only in recent gcc versions. We
can't use it; see gnupg/doc/HACKING.
GnuPG-bug-id: 5088
* tests/gpg/t-support.h (check_gpg_version, compare_versions),
(parse_version_string, parse_version_number): Remove version
check code.
* tests/json/t-json.c (check_gpg_version, compare_versions),
(parse_version_string, parse_version_number): Add.
--
t-support header was not a good place for this. It should
go into a library e.g. gpgrt in the future. For now we
can keep it close to where it is needed.
* tests/json/t-json.c (test_contains): Try all siblings of
the haystack child.
--
This fixes the case where we don't match against the
first child because the order might have changed or
a new element was inserted at the top. Then we
have to try out also all the siblings.
* t-json.c (tests): Register new tests.
* t-createkey.in.json,
t-createkey.out.json,
t-decrypt-verify.in.json,
t-decrypt-verify.out.json,
t-decrypt.in.json,
t-decrypt.out.json,
t-delete.in.json,
t-delete.out.json,
t-encrypt-sign.in.json,
t-encrypt-sign.out.json,
t-encrypt.in.json,
t-encrypt.out.json,
t-export-secret-info.in.json,
t-export-secret-info.out.json,
t-export.in.json,
t-export.out.json,
t-json.c,
t-keylist-secret.in.json,
t-keylist-secret.out.json,
t-keylist.in.json,
t-keylist.out.json,
t-verify.in.json,
t-verify.out.json,
t-version.in.json,
t-version.out.json: New.
--
Except for help and getmore there is now a test for each command.
* tests/json/t-json.c (test_contains): When searching for "*" accept
every string.
--
This allows it to write tests that check for the existence of
a string value but don't care about the contents. E.g. for Data.
* tests/json/t-json.c (main): Skip if version is not at least
2.2.0
--
In the past new tests often failed when a modern GPGME was
used with old GnuPG's.
This should avoid the hassle for packagers without the
requirement that we test against old versions.
* configure.ac: Configure makefile.
* tests/Makefile.am: Run json tests if gpg tests are run.
* tests/json/t-json.c: New testrunner for json tests.
* tests/json/t-config.in, tests/json/t-config.out: First test.
--
The idea of this test runner is that it only looks for parts
in the output. This should allow it to write robust tests
that check for the basics in the output but don't fail when
the output is extended or slightly changed.