Home GnuPG

build: Add cmake files for building the tests

Description

build: Add cmake files for building the tests

* CMakeLists.txt: Enable AUTORCC. Add subdirectory tests to the build.
* cmake/modules/ECMAddTests.cmake, cmake/modules/ECMMarkAsTest.cmake,
cmake/modules/ECMMarkNonGuiExecutable.cmake: New.
* cmake/modules/G10CMakeSettings.cmake: Add option BUILD_TESTING.
* tests/CMakeLists.txt, tests/fixture.qrc, tests/fixture/gpg-agent.conf,
tests/fixture/gpg.conf: New.
* tests/pubdemo.asc: Move to ...
* tests/fixture/pubdemo.asc: here. Remove trailing empty line.
* tests/secdemo.asc: Move to ...
* tests/fixture/secdemo.asc: here.
* tests/Makefile.am, tests/final.test, tests/initial.test,
tests/start-stop-agent: Remove.
* tests/t-support.cpp (QGpgMETest::initTestCase): Extract test data
from fixture to temporary folder. Set GNUPGHOME to this folder. Import
pubdemo.asc and secdemo.asc.
* tests/t-support.h (QGpgMETest): Add member variable
mGnupgHomeTemplate.

This change adds support for building and running the tests.

The ECM cmake modules were copied from KDE's extra-cmake-modules. I have
just changed the copyright notices to GNU style (but without the (C))
and I have added the license text verbatim.

The changes in QGpgMETest remove the need to set up a GNUPGHOME with the
test keys in the build folder. Instead individual temporary folders are
used for each test case.

Details

Provenance
ikloeckerAuthored on Dec 17 2024, 5:19 PM
Parents
rGPGMEQT2e574603f8cb: build: Generate the export header
Branches
Unknown
Tags
Unknown

Event Timeline