Commit Graph

31 Commits

Author SHA1 Message Date
Martchus 9744efda70 Ensure default testfiles directory for working copy exists 2017-11-17 23:36:36 +01:00
Martchus e283eea1f0 Prevent using executable of header-only lib for coverage 2017-11-15 19:13:36 +01:00
Martchus 2bb4aa36a4 Let tests find the testfiles from sources without extra args
Currently the path of the testfiles always had to be specified
either manually using the -p argument or by running the tests
via the build system targets. The first option is annoying and
the second option not so nice when using Qt Creator and the

This commit allows tests to find the testfiles from the source
directory automatically (as fallback). This is achieved by
creating a file containing the path of the source directory
with CMake. Note that this file can only be found if the working
directory is set to the binary directory (default in Qt Creator).
2017-10-30 23:01:07 +01:00
Martchus cb02d5c733 Add target for building all tests
This allows to build all tests at once without
adding them to "all" target. In contrast to the
check target, the tests are not executed.
2017-10-19 16:20:49 +02:00
Martchus a475ef8693 Make creating overall test coverage depend on awk script 2017-08-17 17:59:08 +02:00
Martchus e4709099d2 Prevent error in coverage target when building only static libs 2017-07-28 17:34:28 +02:00
Martchus c966e3fb1b Improve finding cppunit
* Add include dir
* Make library/include dir configurable via cache variable
2017-07-22 15:33:41 +02:00
Martchus 942c14ce3d Fix target include dirs
* Add include path of own header files for build
  and external use via imported target. Previously
  only include dirs required for external libs were
* Using global include dirs is no longer required.
* When PUBLIC_SHARED_INCLUDE_DIRS is empty, adding
  "${PUBLIC_SHARED_INCLUDE_DIRS}" to public include dirs
  does not leave INTERFACE_INCLUDE_DIRECTORIES property
  empty. Instead the source dir is added. So just don't
  use quotes here.
2017-07-11 22:02:27 +02:00
Martchus 442f7a9b25 Exclude generated files from coverage
* So files generated by moc or qdbusxml2cpp are not
  part of coverage statistics
* When filtering files, llvm-cov prints multiple tables
  showing coverage on function level.
  -> Generate overall coverage stats via awk.
2017-07-09 23:38:11 +02:00
Martchus 6f146072ea Allow overriding 3rd party libs/includes
So passwordfile can be told to use legacy OpenSSL
header in accordance with Qt 5 which still requires
OpenSSL 1.0
2017-07-04 22:44:32 +02:00
Martchus a4fc4024b5 Make tidy and coverage optional and disabled by default
* Prevent warnings about required tools being unavailable
  when tidy/coverage targets aren't desired anyways (eg.
  when packaging)
* Do not automatically execute tidy check when packaging
  in unclean environment
2017-06-20 23:38:45 +02:00
Martchus 57d5d04d9f Merge prof data of subprocesses created when executing tests
So coverage is accounted correctly when tests create subprocesses
of the application to be tested using execApp().
2017-06-20 23:19:49 +02:00
Martchus 1e14b09e64 Fix passing application path to tests 2017-06-19 14:15:44 +02:00
Martchus 64572e6860 Add general coverage target 2017-06-19 14:01:33 +02:00
Martchus 6807d899d2 Enable source code based coverage analysis 2017-06-18 16:17:44 +02:00
Martchus 2174dc516a Allow specifying target compile options via variable 2017-06-18 16:14:45 +02:00
Martchus ac348ee3b9 Find cppunit via pkg-config 2017-05-23 00:49:45 +02:00
Martchus 13ac2305d5 Allow not to link tests against cppunit 2017-05-23 00:10:27 +02:00
Martchus b74327d961 Move creation of check target to BasicConfig.cmake
* So other tests like tidy check can be added
* Even if there are no tests after all, the
  check target shoudn't cause any problems
2017-05-01 02:57:58 +02:00
Martchus daaedb7ba3 Fix issues in TestTarget.cmake
* Fix error message
* Improve comments
* Improve target names
* Fix working directory for check target
* Add info that calling enable_testing() on root
  level is required for check target to work
* Create workingdir for tests under binary dir to
  prevent polluting source dir
2017-03-27 22:12:20 +02:00
Martchus 2965f0cd00 Improve testing applications
library in addition to the application so tests can
link against it to check particular functions. This
replaces the current approach of linking against the
application directly which lead to linker errors.
2017-03-27 11:15:14 +02:00
Martchus fdbe874bcd Allow to disable excluding tests from all target 2017-03-23 20:31:57 +01:00
Martchus 64cc931555 Improve CMake modules 2017-02-11 02:30:46 +01:00
Martchus cb3b50c28c Allow overriding default CXX_STANDARD
to ease using newer C++ features in further
projects without setting the standard manually
for each target
2017-02-04 17:44:46 +01:00
Martchus 416008da1a Set compile definitions for tests 2016-11-26 13:06:27 +01:00
Martchus 00f7795dcd Link test target against neccassary libraries
In addition to previous libs, also link against
 - same libs as app/lib target
 - the app target itself if required
2016-09-20 20:52:29 +02:00
Martchus 7b946864a6 Remove pthread dependency from test target 2016-09-11 20:32:59 +02:00
Martchus fe4e4b2ef5 Fix issues concerning building/using static libraries
- Ensure static versions of 3rd party libs are
  found correctly
- Link tests against statically if only static
  libraries have been built
- Ensure standard lib is linked statically when
  static linkage is enabled
2016-08-19 16:14:55 +02:00
Martchus 17d22be584 Support testing applications 2016-07-30 22:34:31 +02:00
Martchus 8efe38dadf Improve details in the build system
- add target to run cross compiled Windows binaries with wine
- quit tests if --help has been specified
2016-07-16 23:04:22 +02:00
Martchus bd0cbd5802 reduce code duplication in build system
- get rid of qmake project file
- provide CMake modules for common tasks
- provide templates for *.desktop files
2016-04-16 02:11:05 +02:00