diff options
Diffstat (limited to 'gr-howto-write-a-block/python')
-rw-r--r-- | gr-howto-write-a-block/python/.gitignore | 9 | ||||
-rw-r--r-- | gr-howto-write-a-block/python/CMakeLists.txt | 44 | ||||
-rw-r--r-- | gr-howto-write-a-block/python/Makefile.am | 31 | ||||
-rw-r--r-- | gr-howto-write-a-block/python/__init__.py | 5 | ||||
-rw-r--r-- | gr-howto-write-a-block/python/run_tests.in | 74 |
5 files changed, 49 insertions, 114 deletions
diff --git a/gr-howto-write-a-block/python/.gitignore b/gr-howto-write-a-block/python/.gitignore deleted file mode 100644 index bf03975bb..000000000 --- a/gr-howto-write-a-block/python/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/Makefile -/Makefile.in -/.deps -/.libs -/*.la -/*.lo -/*.pyc -/*.pyo -/run_tests diff --git a/gr-howto-write-a-block/python/CMakeLists.txt b/gr-howto-write-a-block/python/CMakeLists.txt new file mode 100644 index 000000000..5da80ef15 --- /dev/null +++ b/gr-howto-write-a-block/python/CMakeLists.txt @@ -0,0 +1,44 @@ +# Copyright 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. + +######################################################################## +# Include python install macros +######################################################################## +include(GrPython) +if(NOT PYTHONINTERP_FOUND) + return() +endif() + +######################################################################## +# Install python sources +######################################################################## +GR_PYTHON_INSTALL( + FILES + __init__.py + DESTINATION ${GR_PYTHON_DIR}/howto +) + +######################################################################## +# Handle the unit tests +######################################################################## +include(GrTest) + +set(GR_TEST_TARGET_DEPS gnuradio-howto) +set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig) +GR_ADD_TEST(qa_howto ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_howto.py) diff --git a/gr-howto-write-a-block/python/Makefile.am b/gr-howto-write-a-block/python/Makefile.am deleted file mode 100644 index c216cca29..000000000 --- a/gr-howto-write-a-block/python/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright 2004,2010 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 $(top_srcdir)/Makefile.common - -TESTS = run_tests -EXTRA_DIST = run_tests.in - -modpython_PYTHON = \ - __init__.py - -noinst_PYTHON = \ - qa_howto.py diff --git a/gr-howto-write-a-block/python/__init__.py b/gr-howto-write-a-block/python/__init__.py index d4a41c271..86395851d 100644 --- a/gr-howto-write-a-block/python/__init__.py +++ b/gr-howto-write-a-block/python/__init__.py @@ -18,6 +18,11 @@ # The presence of this file turns this directory into a Python package +''' +This is the GNU Radio HOWTO module. Place your Python package +description here (python/__init__.py). +''' + # ---------------------------------------------------------------- # Temporary workaround for ticket:181 (swig+python problem) import sys diff --git a/gr-howto-write-a-block/python/run_tests.in b/gr-howto-write-a-block/python/run_tests.in deleted file mode 100644 index 2c32539c7..000000000 --- a/gr-howto-write-a-block/python/run_tests.in +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh - -# All this strange PYTHONPATH manipulation is required to run our -# tests using our just built shared library and swig-generated python -# code prior to installation. - -# build tree == src tree unless you're doing a VPATH build. -# If you don't know what a VPATH build is, you're not doing one. Relax... - -prefix=@prefix@ -exec_prefix=@exec_prefix@ - -# Where to look in the build tree for our shared library -libbld=@abs_top_builddir@/lib -# Where to look in the build tree for swig generated python code -libswig=@abs_top_builddir@/swig -# Where to look in the src tree for hand written python code -py=@abs_top_srcdir@/python - -# Where to look for installed GNU Radio python modules -# FIXME this is wrong on a distcheck. We really need to ask gnuradio-core -# where it put its python files. -installed_pythondir=@pythondir@ -installed_pyexecdir=@pyexecdir@ - -PYTHONPATH="$libbld:$libbld/.libs:$libswig:$libswig/.libs:$py:$installed_pythondir:$installed_pyexecdir:$PYTHONPATH" -echo $PYTHONPATH - -export PYTHONPATH - -case "@host_os@" in - darwin*) - # FIXME: Code for Darwin guessed but not tested - # Special Code for executing on Darwin / Mac OS X only - if [ "$DYLD_LIBRARY_PATH" = "" ] - then - DYLD_LIBRARY_PATH=$libbld/.libs - else - DYLD_LIBRARY_PATH=$libbld/.libs:$DYLD_LIBRARY_PATH - fi - export DYLD_LIBRARY_PATH - ;; - cygwin*|win*|mingw*) - # Special Code for executing on Win32 variants only - if [ "$PATH" = "" ] - then - PATH=$libbld/.libs - else - PATH=$libbld/.libs:$PATH - fi - export PATH - ;; -esac - -# -# This is the simple part... -# Run everything that matches qa_*.py and return the final result. -# - -ok=yes -for file in @srcdir@/qa_*.py -do - if ! $file - then - ok=no - fi -done - -if [ $ok = yes ] -then - exit 0 -else - exit 1 -fi |