diff options
author | Martin Braun <martin.braun@ettus.com> | 2018-05-06 22:13:02 -0700 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2018-06-21 20:48:26 +0200 |
commit | ade6558512d57b10a98d8594da2b58f1c763de4c (patch) | |
tree | 08c28cf5c12d3f402ea420a13b0dad4e688d5e17 /gr-analog/lib | |
parent | 259371cb60775e8e31d86f1dfc88696916efa770 (diff) |
analog: Replace QA test framework w/ Boost UTF
Diffstat (limited to 'gr-analog/lib')
-rw-r--r-- | gr-analog/lib/CMakeLists.txt | 27 | ||||
-rw-r--r-- | gr-analog/lib/qa_analog.cc | 36 | ||||
-rw-r--r-- | gr-analog/lib/qa_analog.h | 38 | ||||
-rw-r--r-- | gr-analog/lib/test_gr_analog.cc | 48 |
4 files changed, 10 insertions, 139 deletions
diff --git a/gr-analog/lib/CMakeLists.txt b/gr-analog/lib/CMakeLists.txt index a75d70337b..cc4864d6d1 100644 --- a/gr-analog/lib/CMakeLists.txt +++ b/gr-analog/lib/CMakeLists.txt @@ -132,25 +132,18 @@ endif(ENABLE_STATIC_LIBS) if(ENABLE_TESTING) include(GrTest) - include_directories(${CPPUNIT_INCLUDE_DIRS}) - link_directories(${CPPUNIT_LIBRARY_DIRS}) + include_directories( + ${GR_ANALOG_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ) list(APPEND test_gr_analog_sources - ${CMAKE_CURRENT_SOURCE_DIR}/test_gr_analog.cc - ${CMAKE_CURRENT_SOURCE_DIR}/qa_analog.cc - ) - - add_executable(test-gr-analog ${test_gr_analog_sources}) - - target_link_libraries( - test-gr-analog - gnuradio-runtime - gnuradio-analog - ${Boost_LIBRARIES} - ${CPPUNIT_LIBRARIES} ) + list(APPEND GR_TEST_TARGET_DEPS gnuradio-analog) - list(APPEND GR_TEST_TARGET_DEPS gnuradio-analog gnuradio-filter gnuradio-fft) - - GR_ADD_TEST(test_gr_analog test-gr-analog) + foreach(qa_file ${test_gr_analog_sources}) + GR_ADD_CPP_TEST("analog_${qa_file}" + ${CMAKE_CURRENT_SOURCE_DIR}/${qa_file} + ) + endforeach(qa_file) endif(ENABLE_TESTING) diff --git a/gr-analog/lib/qa_analog.cc b/gr-analog/lib/qa_analog.cc deleted file mode 100644 index c7c975a3e5..0000000000 --- a/gr-analog/lib/qa_analog.cc +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio 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 3, or (at your option) - * any later version. - * - * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -/* - * This class gathers together all the test cases for the gr-analog - * directory into a single test suite. As you create new test cases, - * add them here. - */ - -#include <qa_analog.h> - -CppUnit::TestSuite * -qa_gr_analog::suite() -{ - CppUnit::TestSuite *s = new CppUnit::TestSuite("gr-analog"); - - return s; -} diff --git a/gr-analog/lib/qa_analog.h b/gr-analog/lib/qa_analog.h deleted file mode 100644 index cdb5c78b94..0000000000 --- a/gr-analog/lib/qa_analog.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio 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 3, or (at your option) - * any later version. - * - * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _QA_GR_ANALOG_H_ -#define _QA_GR_ANALOG_H_ - -#include <gnuradio/attributes.h> -#include <cppunit/TestSuite.h> - -//! collect all the tests for the gr-analog directory - -class __GR_ATTR_EXPORT qa_gr_analog { - public: - //! return suite of tests for all of gr-analog directory - static CppUnit::TestSuite *suite(); -}; - - -#endif /* _QA_GR_ANALOG_H_ */ diff --git a/gr-analog/lib/test_gr_analog.cc b/gr-analog/lib/test_gr_analog.cc deleted file mode 100644 index 228a99e347..0000000000 --- a/gr-analog/lib/test_gr_analog.cc +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio 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 3, or (at your option) - * any later version. - * - * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <cppunit/TextTestRunner.h> -#include <cppunit/XmlOutputter.h> - -#include <gnuradio/unittests.h> -#include "qa_analog.h" -#include <iostream> -#include <fstream> - -int -main (int argc, char **argv) -{ - CppUnit::TextTestRunner runner; - std::ofstream xmlfile(get_unittest_path("gr_analog.xml").c_str()); - CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); - - runner.addTest(qa_gr_analog::suite()); - runner.setOutputter(xmlout); - - bool was_successful = runner.run("", false); - - return was_successful ? 0 : 1; -} |