test: Add build system support and a main function for unit tests
authorManuel Nickschas <sputnick@quassel-irc.org>
Mon, 24 Sep 2018 18:36:21 +0000 (20:36 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
commit8f2ee00f4edef1693628d3af0bdee84d725eb754
tree73ab8ee7f325d0d414e4ae08da09975e292429da
parent8111304ae2fa60ac1d20520cfdd3e5b4930bce8b
test: Add build system support and a main function for unit tests

Add a new CMake option BUILD_TESTING (defaults to OFF) that, if
enabled, will build unit tests and related requirements.

Add a new library Quassel::Test::Main that provides a main function
for test cases.

Add a new CMake macro quassel_add_test for making the adding of test
cases convenient by hiding most of the boilerplate.

Test cases should #include "testglobal.h", so they automatically have
access to GTest/GMock macros as well as the imported main function.
CMakeLists.txt
cmake/QuasselMacros.cmake
src/CMakeLists.txt
src/test/CMakeLists.txt [new file with mode: 0644]
src/test/main/CMakeLists.txt [new file with mode: 0644]
src/test/main/main.cpp [new file with mode: 0644]
src/test/main/testglobal.h [new file with mode: 0644]