summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/grc_gr_usrp.m45
-rw-r--r--gr-usrp/src/Makefile.am17
-rw-r--r--gr-usrp/src/gnuradio/usrp.scm27
-rw-r--r--gr-usrp/src/run_guile_tests.in14
-rw-r--r--gr-usrp/src/usrp.test37
5 files changed, 96 insertions, 4 deletions
diff --git a/config/grc_gr_usrp.m4 b/config/grc_gr_usrp.m4
index 1f2cd1ac7..b850f0050 100644
--- a/config/grc_gr_usrp.m4
+++ b/config/grc_gr_usrp.m4
@@ -29,11 +29,14 @@ AC_DEFUN([GRC_GR_USRP],[
gr-usrp/gnuradio-usrp.pc \
gr-usrp/src/Makefile \
gr-usrp/src/run_tests \
+ gr-usrp/src/run_guile_tests \
gr-usrp/apps/Makefile \
])
GRC_BUILD_CONDITIONAL(gr-usrp,[
dnl run_tests is created from run_tests.in. Make it executable.
- AC_CONFIG_COMMANDS([run_tests_usrp], [chmod +x gr-usrp/src/run_tests])
+ AC_CONFIG_COMMANDS([run_tests_usrp],
+ [chmod +x gr-usrp/src/run_tests
+ chmod +x gr-usrp/src/run_guile_tests])
])
])
diff --git a/gr-usrp/src/Makefile.am b/gr-usrp/src/Makefile.am
index db5be4ade..9c1f4b525 100644
--- a/gr-usrp/src/Makefile.am
+++ b/gr-usrp/src/Makefile.am
@@ -20,6 +20,7 @@
#
include $(top_srcdir)/Makefile.common
+include $(top_srcdir)/Makefile.swig
# ----------------------------------------------------------------
# Misc. build/installation activities
@@ -30,6 +31,10 @@ DISTCLEANFILES = run_tests
noinst_PYTHON = qa_usrp.py
+nobase_guile_DATA = gnuradio/usrp.scm
+
+TESTS =
+
# ----------------------------------------------------------------
# The straight C++ library
@@ -67,10 +72,8 @@ grinclude_HEADERS = \
usrp_source_c.h \
usrp_source_s.h
-if PYTHON
# ----------------------------------------------------------------
# The SWIG library
-TESTS = run_tests
TOP_SWIG_IFILES = \
usrp_swig.i
@@ -105,11 +108,19 @@ usrp_swig_swiginclude_headers = \
usrp_sink_s.i \
usrp_standard.i
-include $(top_srcdir)/Makefile.swig
# add some of the variables generated inside the Makefile.swig.gen
BUILT_SOURCES = $(swig_built_sources)
# Do not distribute the output of SWIG
no_dist_files = $(swig_built_sources)
+
+
+if PYTHON
+TESTS += run_tests
endif
+
+if GUILE
+TESTS += run_guile_tests
+endif
+
diff --git a/gr-usrp/src/gnuradio/usrp.scm b/gr-usrp/src/gnuradio/usrp.scm
new file mode 100644
index 000000000..e01c9454a
--- /dev/null
+++ b/gr-usrp/src/gnuradio/usrp.scm
@@ -0,0 +1,27 @@
+;;;
+;;; Copyright 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 this program. If not, see <http://www.gnu.org/licenses/>.
+;;;
+
+;;; Semi bogus module that just re-exports the usrp_swig module
+
+(define-module (gnuradio usrp)
+ #:use-module (gnuradio export-safely)
+ #:use-module (gnuradio usrp_swig)
+ #:duplicates (merge-generics replace check))
+
+(re-export-all '(gnuradio usrp_swig))
diff --git a/gr-usrp/src/run_guile_tests.in b/gr-usrp/src/run_guile_tests.in
new file mode 100644
index 000000000..5d08b0dd5
--- /dev/null
+++ b/gr-usrp/src/run_guile_tests.in
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+. @top_builddir@/setup_guile_test_env
+
+# 1st argument is absolute path to hand coded guile source directory
+# 2nd argument is absolute path to component C++ shared library build directory
+# 3nd argument is absolute path to component SWIG build directory
+
+add_local_paths \
+ @srcdir@ \
+ @abs_builddir@ \
+ @abs_builddir@
+
+@GUILE@ -e main -c '(use-modules (gnuradio test-suite guile-test))' -t @srcdir@
diff --git a/gr-usrp/src/usrp.test b/gr-usrp/src/usrp.test
new file mode 100644
index 000000000..740fe3055
--- /dev/null
+++ b/gr-usrp/src/usrp.test
@@ -0,0 +1,37 @@
+;;; -*- Scheme -*-
+;;;
+;;; Copyright 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 this program. If not, see <http://www.gnu.org/licenses/>.
+;;;
+
+;;; If you're using Emacs's Scheme mode:
+;;; (put 'with-test-prefix 'scheme-indent-function 1)
+
+;;; See the comments in gnuradio/test-suite/lib.scm for info on writing tests.
+;;; See also the very end of the file, where the test-equal, test-eqv
+;;; and test-eq macros are defined.
+
+(define-module (test-module)
+ #:use-module (oop goops)
+ #:use-module (gnuradio core)
+ #:use-module (gnuradio test-suite lib)
+ #:duplicates (merge-generics replace check))
+
+;;; Just see if we can import the module...
+;;; They may not have a USRP attached and powered up
+
+(use-modules (gnuradio usrp))