diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CMakeLists.txt | 94 | ||||
-rw-r--r-- | lib/qa_runtime.cc | 63 |
2 files changed, 134 insertions, 23 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 0fe8c50..8baa38d 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -3,9 +3,10 @@ ######################################################################## include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${GRAS_SOURCE_DIR}/tests) set(GRAS_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../) +set(GRAS_BINARY_DIR ${CMAKE_BINARY_DIR}/gruel/src) +set(RUNTIME_SOURCE_DIR ${CMAKE_SOURCE_DIR}/gnuradio-core/src/lib/runtime) ######################################################################## # Setup NumaNuma @@ -36,31 +37,50 @@ list(APPEND gnuradio_core_sources ) #sources that are in tree that have not changed -set(runtime_srcs_dir ${CMAKE_SOURCE_DIR}/gnuradio-core/src/lib/runtime) list(APPEND gnuradio_core_sources - ${runtime_srcs_dir}/gr_sys_paths.cc - ${runtime_srcs_dir}/gr_message.cc - ${runtime_srcs_dir}/gr_msg_queue.cc - ${runtime_srcs_dir}/gr_msg_handler.cc + ${RUNTIME_SOURCE_DIR}/gr_sys_paths.cc + ${RUNTIME_SOURCE_DIR}/gr_message.cc + ${RUNTIME_SOURCE_DIR}/gr_msg_queue.cc + ${RUNTIME_SOURCE_DIR}/gr_msg_handler.cc ) ######################################################################## # Append gnuradio-core test sources ######################################################################## list(APPEND test_gnuradio_core_sources - ${GRAS_SOURCE_DIR}/tests/qa_gr_block.cc - ${GRAS_SOURCE_DIR}/tests/qa_gr_hier_block2.cc - ${GRAS_SOURCE_DIR}/tests/qa_gr_hier_block2_derived.cc - #${GRAS_SOURCE_DIR}/tests/qa_gr_buffer.cc - #${GRAS_SOURCE_DIR}/tests/qa_gr_flowgraph.cc - ${GRAS_SOURCE_DIR}/tests/qa_gr_top_block.cc - ${GRAS_SOURCE_DIR}/tests/qa_gr_io_signature.cc - #${GRAS_SOURCE_DIR}/tests/qa_gr_vmcircbuf.cc - ${GRAS_SOURCE_DIR}/tests/qa_block_tags.cc - ${GRAS_SOURCE_DIR}/tests/qa_runtime.cc - #${GRAS_SOURCE_DIR}/tests/qa_set_msg_handler.cc + ${RUNTIME_SOURCE_DIR}/qa_gr_block.cc + ${RUNTIME_SOURCE_DIR}/qa_gr_hier_block2.cc + ${RUNTIME_SOURCE_DIR}/qa_gr_hier_block2_derived.cc + #${RUNTIME_SOURCE_DIR}/qa_gr_buffer.cc + #${RUNTIME_SOURCE_DIR}/qa_gr_flowgraph.cc + ${RUNTIME_SOURCE_DIR}/qa_gr_top_block.cc + ${RUNTIME_SOURCE_DIR}/qa_gr_io_signature.cc + #${RUNTIME_SOURCE_DIR}/qa_gr_vmcircbuf.cc + ${RUNTIME_SOURCE_DIR}/qa_block_tags.cc + ${GRAS_SOURCE_DIR}/lib/qa_runtime.cc + #${RUNTIME_SOURCE_DIR}/qa_set_msg_handler.cc ) +#copy test headers to include dir +set(test_headers + ${RUNTIME_SOURCE_DIR}/qa_gr_block.h + ${RUNTIME_SOURCE_DIR}/qa_gr_hier_block2.h + ${RUNTIME_SOURCE_DIR}/qa_gr_hier_block2_derived.h + #${RUNTIME_SOURCE_DIR}/qa_gr_buffer.h + #${RUNTIME_SOURCE_DIR}/qa_gr_flowgraph.h + ${RUNTIME_SOURCE_DIR}/qa_gr_top_block.h + ${RUNTIME_SOURCE_DIR}/qa_gr_io_signature.h + #${RUNTIME_SOURCE_DIR}/qa_gr_vmcircbuf.h + ${RUNTIME_SOURCE_DIR}/qa_block_tags.h + ${RUNTIME_SOURCE_DIR}/qa_runtime.h + #${RUNTIME_SOURCE_DIR}/qa_set_msg_handler.h + ${RUNTIME_SOURCE_DIR}/gr_unittests.h +) +foreach(header ${test_headers}) + execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${header} ${GRAS_BINARY_DIR}/include) +endforeach(header) + + ######################################################################## # Find TSBE and add to libs ######################################################################## @@ -91,9 +111,22 @@ list(APPEND gnuradio_core_libs ${NUMANUMA_LIBRARIES}) ######################################################################## # Install runtime headers ######################################################################## +set(runtime_copy_headers + ${RUNTIME_SOURCE_DIR}/gr_sys_paths.h + ${RUNTIME_SOURCE_DIR}/gr_message.h + ${RUNTIME_SOURCE_DIR}/gr_msg_queue.h + ${RUNTIME_SOURCE_DIR}/gr_msg_handler.h + ${RUNTIME_SOURCE_DIR}/gr_complex.h +) + +#copy the headers to a place that is in the include path +foreach(runtime_copy_header ${runtime_copy_headers}) + execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${runtime_copy_header} ${GRAS_BINARY_DIR}/include) +endforeach(runtime_copy_header) + file(GLOB runtime_headers "${GRAS_SOURCE_DIR}/include/gnuradio/*") install(FILES - ${runtime_headers} + ${runtime_headers} ${runtime_copy_headers} DESTINATION ${GR_INCLUDE_DIR}/gnuradio COMPONENT "core_devel" ) @@ -102,11 +135,11 @@ install(FILES # Install swig headers ######################################################################## if(ENABLE_PYTHON) -file(GLOB runtime_swigs "${GRAS_SOURCE_DIR}/swig/*.i") -install(FILES - ${runtime_swigs} - DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig - COMPONENT "core_swig" + +set(runtime_copy_swigs + ${RUNTIME_SOURCE_DIR}/gr_message.i + ${RUNTIME_SOURCE_DIR}/gr_msg_queue.i + ${RUNTIME_SOURCE_DIR}/gr_msg_handler.i ) #makes swig doc generator happy @@ -115,4 +148,19 @@ execute_process( COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/runtime/nop.h ) +#copy the headers to a place that is in the include path +foreach(runtime_copy_header ${runtime_copy_swigs}) + execute_process( + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig/ + COMMAND ${CMAKE_COMMAND} -E copy ${runtime_copy_header} ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig/ + ) +endforeach(runtime_copy_header) + +file(GLOB runtime_swigs "${GRAS_SOURCE_DIR}/swig/*.i") +install(FILES + ${runtime_swigs} ${runtime_copy_swigs} + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig + COMPONENT "core_swig" +) + endif(ENABLE_PYTHON) diff --git a/lib/qa_runtime.cc b/lib/qa_runtime.cc new file mode 100644 index 0000000..711cf24 --- /dev/null +++ b/lib/qa_runtime.cc @@ -0,0 +1,63 @@ +/* + * Copyright 2002,2007,2011 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 + * directory into a single test suite. As you create new test cases, + * add them here. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <qa_runtime.h> +//#include <qa_gr_vmcircbuf.h> +#include <qa_gr_io_signature.h> +#include <qa_gr_block.h> +//#include <qa_gr_flowgraph.h> +#include <qa_gr_top_block.h> +#include <qa_gr_hier_block2.h> +#include <qa_gr_hier_block2_derived.h> +//#include <qa_gr_buffer.h> +#include <qa_block_tags.h> +//#include <qa_set_msg_handler.h> + +CppUnit::TestSuite * +qa_runtime::suite () +{ + CppUnit::TestSuite *s = new CppUnit::TestSuite ("runtime"); + + //s->addTest (qa_gr_vmcircbuf::suite ()); + s->addTest (qa_gr_io_signature::suite ()); + s->addTest (qa_gr_block::suite ()); + //s->addTest (qa_gr_flowgraph::suite ()); + s->addTest (qa_gr_top_block::suite ()); + s->addTest (qa_gr_hier_block2::suite ()); + s->addTest (qa_gr_hier_block2_derived::suite ()); + //s->addTest (qa_gr_buffer::suite ()); + //tags test relies on some unimplemented (minor) stuff + //get it working later ok? + //TODO s->addTest (qa_block_tags::suite ()); + //s->addTest (qa_set_msg_handler::suite ()); + + return s; +} |