diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2013-04-09 12:00:46 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2013-04-09 12:00:46 -0700 |
commit | 0442f56a40c82a67705a108cdbbbedc85a84dc1d (patch) | |
tree | b570ea5c96304f3b38d9657a0b14c3e288fa8202 | |
parent | 52d7f2bdb1e27cb43754d46edf1c7a8942853ae7 (diff) | |
parent | ac0866b9ca84895ed0496b8abc35b9754cc6b1e6 (diff) |
Merge remote-tracking branch 'tom/next' into next
Conflicts:
gnuradio-runtime/lib/pmt/CMakeLists.txt
-rw-r--r-- | gnuradio-runtime/lib/CMakeLists.txt | 6 | ||||
-rw-r--r-- | gnuradio-runtime/lib/gr_block_registry.cc | 30 | ||||
-rw-r--r-- | gnuradio-runtime/lib/pmt/CMakeLists.txt | 36 | ||||
-rw-r--r-- | gnuradio-runtime/swig/CMakeLists.txt | 1 | ||||
-rw-r--r-- | gr-blocks/python/qa_file_metadata.py | 4 |
5 files changed, 54 insertions, 23 deletions
diff --git a/gnuradio-runtime/lib/CMakeLists.txt b/gnuradio-runtime/lib/CMakeLists.txt index ee80ed4d5b..fd4e169daf 100644 --- a/gnuradio-runtime/lib/CMakeLists.txt +++ b/gnuradio-runtime/lib/CMakeLists.txt @@ -60,8 +60,8 @@ include_directories(${GNURADIO_RUNTIME_INCLUDE_DIRS} ######################################################################## # Include subdirs rather to populate to the sources lists. ######################################################################## -GR_INCLUDE_SUBDIRECTORY(messages) GR_INCLUDE_SUBDIRECTORY(pmt) +GR_INCLUDE_SUBDIRECTORY(messages) GR_INCLUDE_SUBDIRECTORY(thread) ######################################################################## @@ -136,6 +136,7 @@ endif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)") list(APPEND gnuradio_runtime_libs volk + gnuradio-pmt ${Boost_LIBRARIES} ${LOG4CPP_LIBRARIES} ) @@ -269,13 +270,14 @@ list(APPEND test_gnuradio_runtime_sources qa_sincos.cc pmt/qa_pmt.cc pmt/qa_pmt_prims.cc + ${CMAKE_CURRENT_BINARY_DIR}/pmt/qa_pmt_unv.cc ) include_directories(${CPPUNIT_INCLUDE_DIRS}) link_directories(${CPPUNIT_LIBRARY_DIRS}) add_library(test-gnuradio-runtime SHARED ${test_gnuradio_runtime_sources}) -target_link_libraries(test-gnuradio-runtime gnuradio-runtime ${CPPUNIT_LIBRARIES} ${Boost_LIBRARIES} ${LOG4CPP_LIBRARIES}) +target_link_libraries(test-gnuradio-runtime gnuradio-runtime gnuradio-pmt ${CPPUNIT_LIBRARIES} ${Boost_LIBRARIES} ${LOG4CPP_LIBRARIES}) ######################################################################## # Build the test executable diff --git a/gnuradio-runtime/lib/gr_block_registry.cc b/gnuradio-runtime/lib/gr_block_registry.cc index eaa770dcaf..a80673691a 100644 --- a/gnuradio-runtime/lib/gr_block_registry.cc +++ b/gnuradio-runtime/lib/gr_block_registry.cc @@ -1,3 +1,25 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012-2013 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. + */ + #include <gr_basic_block.h> #include <gr_block_registry.h> #include <gr_tpb_detail.h> @@ -32,7 +54,7 @@ void gr_block_registry::block_unregister(gr_basic_block* block){ d_ref_map = pmt::dict_delete(d_ref_map, pmt::intern(block->symbol_name())); if(block->alias_set()){ d_ref_map = pmt::dict_delete(d_ref_map, pmt::intern(block->alias())); - } + } } std::string gr_block_registry::register_symbolic_name(gr_basic_block* block){ @@ -44,14 +66,14 @@ std::string gr_block_registry::register_symbolic_name(gr_basic_block* block){ } void gr_block_registry::register_symbolic_name(gr_basic_block* block, std::string name){ - if(dict_has_key(d_ref_map, pmt::intern(name))){ + if(pmt::dict_has_key(d_ref_map, pmt::intern(name))){ throw std::runtime_error("symbol already exists, can not re-use!"); } - d_ref_map = dict_add(d_ref_map, pmt::intern(name), pmt::make_any(block)); + d_ref_map = pmt::dict_add(d_ref_map, pmt::intern(name), pmt::make_any(block)); } gr_basic_block_sptr gr_block_registry::block_lookup(pmt::pmt_t symbol){ - pmt::pmt_t ref = dict_ref(d_ref_map, symbol, pmt::PMT_NIL); + pmt::pmt_t ref = pmt::dict_ref(d_ref_map, symbol, pmt::PMT_NIL); if(pmt::eq(ref, pmt::PMT_NIL)){ throw std::runtime_error("block lookup failed! block not found!"); } diff --git a/gnuradio-runtime/lib/pmt/CMakeLists.txt b/gnuradio-runtime/lib/pmt/CMakeLists.txt index 3c1a2dec03..30a62ead7f 100644 --- a/gnuradio-runtime/lib/pmt/CMakeLists.txt +++ b/gnuradio-runtime/lib/pmt/CMakeLists.txt @@ -72,21 +72,27 @@ add_custom_command( WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) -list(APPEND gnuradio_runtime_sources - ${CMAKE_CURRENT_BINARY_DIR}/pmt_unv.cc - ${CMAKE_CURRENT_SOURCE_DIR}/pmt.cc - ${CMAKE_CURRENT_SOURCE_DIR}/pmt_io.cc - ${CMAKE_CURRENT_SOURCE_DIR}/pmt_pool.cc - ${CMAKE_CURRENT_SOURCE_DIR}/pmt_serialize.cc +set(pmt_sources + ${CMAKE_CURRENT_BINARY_DIR}/pmt_unv.cc + ${CMAKE_CURRENT_SOURCE_DIR}/pmt.cc + ${CMAKE_CURRENT_SOURCE_DIR}/pmt_io.cc + ${CMAKE_CURRENT_SOURCE_DIR}/pmt_pool.cc + ${CMAKE_CURRENT_SOURCE_DIR}/pmt_serialize.cc +) + +list(APPEND gnuradio_pmt_libs + ${Boost_LIBRARIES} + ${LOG4CPP_LIBRARIES} +) + +add_library(gnuradio-pmt SHARED ${pmt_sources}) +target_link_libraries(gnuradio-pmt ${gnuradio_pmt_libs}) + +GR_LIBRARY_FOO(gnuradio-pmt RUNTIME_COMPONENT "runtime" DEVEL_COMPONENT "runtime_devel") + +add_dependencies(gnuradio-pmt + pmt_generated ) -if(ENABLE_TESTING) - list(APPEND test_gnuradio_runtime_sources - ${CMAKE_CURRENT_BINARY_DIR}/qa_pmt_unv.cc - ${CMAKE_CURRENT_SOURCE_DIR}/qa_pmt_prims.cc - ${CMAKE_CURRENT_SOURCE_DIR}/qa_pmt.cc - ) -endif(ENABLE_TESTING) +# Testing is handled in gnuradio-runtime tests one level down. -add_custom_target(pmt_generated - DEPENDS ${PMT_SERIAL_TAGS_H} ${CMAKE_CURRENT_BINARY_DIR}/pmt_unv_int.h) diff --git a/gnuradio-runtime/swig/CMakeLists.txt b/gnuradio-runtime/swig/CMakeLists.txt index 930f1fa2b0..3bff08383f 100644 --- a/gnuradio-runtime/swig/CMakeLists.txt +++ b/gnuradio-runtime/swig/CMakeLists.txt @@ -34,6 +34,7 @@ set(GR_SWIG_INCLUDE_DIRS link_directories(${Boost_LIBRARY_DIRS}) set(GR_SWIG_LIBRARIES + gnuradio-pmt gnuradio-runtime ${LOG4CPP_LIBRARIES} ) diff --git a/gr-blocks/python/qa_file_metadata.py b/gr-blocks/python/qa_file_metadata.py index 3112ea69b0..de571303f7 100644 --- a/gr-blocks/python/qa_file_metadata.py +++ b/gr-blocks/python/qa_file_metadata.py @@ -79,7 +79,7 @@ class test_file_metadata(gr_unittest.TestCase): info = parse_file_metadata.parse_header(header, False) extra_str = handle.read(info["extra_len"]) - self.assertGreater(len(extra_str), 0) + self.assertEquals(len(extra_str) > 0, True) handle.close() try: @@ -158,7 +158,7 @@ class test_file_metadata(gr_unittest.TestCase): info = parse_file_metadata.parse_header(header, False) extra_str = handle.read(info["extra_len"]) - self.assertGreater(len(extra_str), 0) + self.assertEquals(len(extra_str) > 0, True) handle.close() try: |