Commit Graph

24 Commits

Author SHA1 Message Date
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
  added.
* 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
When LINK_TESTS_AGAINST_APP_TARGET set, create a
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