]> sigrok.org Git - pulseview.git/commitdiff
Added empty unit testing framework
authorJoel Holdsworth <redacted>
Sun, 15 Jul 2012 15:48:59 +0000 (16:48 +0100)
committerJoel Holdsworth <redacted>
Mon, 3 Sep 2012 12:59:56 +0000 (13:59 +0100)
.gitignore
CMakeLists.txt
test/test.cpp [new file with mode: 0644]

index ea84893e20248b3c27d54277dd2606d5c9836ac0..9daf758c0293c7040e97580f533a560ef3cb1078 100644 (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
index 5f99a4bb7d41eae2b032135f859855d409be4f96..445cb630f01154c149398b54715bdc9ee5a15d57 100644 (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)
diff --git a/test/test.cpp b/test/test.cpp
new file mode 100644 (file)
index 0000000..2c278c0
--- /dev/null
@@ -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>