)
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)
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})
${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)
--- /dev/null
+/*
+ * 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>