Added empty unit testing framework

This commit is contained in:
Joel Holdsworth 2012-07-15 16:48:59 +01:00
parent a429590b40
commit f0fa92c6c4
3 changed files with 43 additions and 1 deletions

3
.gitignore vendored
View File

@ -1,10 +1,13 @@
sigrok-qt2
sigrok-qt2-test
# CMake cruft
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
CTestTestfile.cmake
Makefile
Testing/
# qt generated code
*.qrc.depends

View File

@ -10,7 +10,7 @@ pkg_check_modules(PKGDEPS REQUIRED
)
find_package(Qt4 REQUIRED)
find_package(Boost 1.46 REQUIRED)
find_package(Boost 1.46 COMPONENTS unit_test_framework REQUIRED)
set(VERSION 0.1.0)
@ -45,6 +45,10 @@ set(sigrok-qt2_RESOURCES
sigrok-qt2.qrc
)
set(sigrok-qt2_TEST_SOURCES
test/test.cpp
)
set(QT_USE_QTOPENGL TRUE)
qt4_wrap_cpp(sigrok-qt2_HEADERS_MOC ${sigrok-qt2_HEADERS})
@ -79,3 +83,16 @@ target_link_libraries(sigrok-qt2
${PKGDEPS_LIBRARIES}
${QT_LIBRARIES}
)
add_definitions(-DBOOST_TEST_DYN_LINK)
add_executable(sigrok-qt2-test
${sigrok-qt2_TEST_SOURCES}
)
target_link_libraries(sigrok-qt2-test
${Boost_LIBRARIES}
)
enable_testing()
add_test(test ${CMAKE_CURRENT_BINARY_DIR}/sigrok-qt2-test)

22
test/test.cpp Normal file
View File

@ -0,0 +1,22 @@
/*
* This file is part of the sigrok project.
*
* Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>