summaryrefslogtreecommitdiff
path: root/gcell/src/lib/wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'gcell/src/lib/wrapper')
-rw-r--r--gcell/src/lib/wrapper/Makefile.am23
-rw-r--r--gcell/src/lib/wrapper/qa_gcell_general.cc83
-rw-r--r--gcell/src/lib/wrapper/qa_gcell_general.h40
-rw-r--r--gcell/src/lib/wrapper/qa_gcell_wrapper.cc4
4 files changed, 147 insertions, 3 deletions
diff --git a/gcell/src/lib/wrapper/Makefile.am b/gcell/src/lib/wrapper/Makefile.am
index 03ffa54b3..c8b0fcd82 100644
--- a/gcell/src/lib/wrapper/Makefile.am
+++ b/gcell/src/lib/wrapper/Makefile.am
@@ -24,27 +24,46 @@ AM_CPPFLAGS = $(DEFINES) $(GCELL_INCLUDES) $(FFTW3F_CFLAGS) $(WITH_INCLUDES)
noinst_LTLIBRARIES = libwrapper.la libwrapper-qa.la
-# generate a libtool.lo that contains an embeded SPU executable
+#
+# generate libtool.lo's that contain embedded SPU executables
+#
gcell_all.lo: ../spu/gcell_all
$(GCELL_EMBEDSPU_LIBTOOL) $@ $<
+gcell_general_qa.lo: ../spu/gcell_general_qa
+ $(GCELL_EMBEDSPU_LIBTOOL) $@ $<
+
+
+
+# The primary library
+
libwrapper_la_SOURCES = \
gcp_fft_1d_r2.cc
libwrapper_la_LIBADD = \
gcell_all.lo
+
+# The QA library
+
libwrapper_qa_la_SOURCES = \
+ qa_gcell_general.cc \
qa_gcell_wrapper.cc \
qa_gcp_fft_1d_r2.cc
libwrapper_qa_la_LIBADD = \
+ gcell_general_qa.lo \
-lfftw3f
+# Headers
+
gcellinclude_HEADERS = \
gcp_fft_1d_r2.h
noinst_HEADERS = \
+ qa_gcell_general.h \
qa_gcell_wrapper.h
-CLEANFILES = gcell_all.lo
+
+CLEANFILES = gcell_all.lo gcell_general_qa.lo
+
diff --git a/gcell/src/lib/wrapper/qa_gcell_general.cc b/gcell/src/lib/wrapper/qa_gcell_general.cc
new file mode 100644
index 000000000..de48201ea
--- /dev/null
+++ b/gcell/src/lib/wrapper/qa_gcell_general.cc
@@ -0,0 +1,83 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 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, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "qa_gcell_general.h"
+#include <cppunit/TestAssert.h>
+
+#include <stdio.h>
+#include <stdlib.h> // random, posix_memalign
+#include <algorithm>
+#include <string.h>
+#include <gc_job_manager.h>
+
+
+// handle to embedded SPU executable
+extern spe_program_handle_t gcell_general_qa;
+
+gc_job_desc_sptr
+gcp_qa_general_submit(gc_job_manager_sptr mgr, const std::string &proc_name)
+{
+ gc_proc_id_t proc_id = mgr->lookup_proc(proc_name);
+ gc_job_desc_sptr jd = gc_job_manager::alloc_job_desc(mgr);
+
+ jd->proc_id = proc_id;
+ jd->input.nargs = 0;
+ jd->output.nargs = 1;
+ jd->eaa.nargs = 0;
+
+ if (!mgr->submit_job(jd.get())){
+ gc_job_status_t s = jd->status;
+ throw gc_bad_submit(proc_name, s);
+ }
+ return jd;
+}
+
+
+bool
+qa_gcell_general::generic_test_body(const std::string &proc_name)
+{
+ gc_jm_options opts;
+ opts.program_handle = gc_program_handle_from_address(&gcell_general_qa);
+ opts.nspes = 1;
+ gc_job_manager_sptr mgr = gc_make_job_manager(&opts);
+
+ gc_job_desc_sptr jd = gcp_qa_general_submit(mgr, proc_name);
+ if (!mgr->wait_job(jd.get())){
+ fprintf(stderr, "wait_job for %s failed: %s\n",
+ proc_name.c_str(),
+ gc_job_status_string(jd->status).c_str());
+ CPPUNIT_ASSERT(0);
+ }
+
+ return jd->output.arg[0].u32; // bool result from SPE code
+}
+
+/*
+ * ------------------------------------------------------------------------
+ * Add more calls to SPE QA code here...
+ * ------------------------------------------------------------------------
+ */
+void
+qa_gcell_general::test_memset()
+{
+ CPPUNIT_ASSERT(generic_test_body("qa_memset"));
+}
+
diff --git a/gcell/src/lib/wrapper/qa_gcell_general.h b/gcell/src/lib/wrapper/qa_gcell_general.h
new file mode 100644
index 000000000..f1e64e717
--- /dev/null
+++ b/gcell/src/lib/wrapper/qa_gcell_general.h
@@ -0,0 +1,40 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 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, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef INCLUDED_QA_GCELL_GENERAL_H
+#define INCLUDED_QA_GCELL_GENERAL_H
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCase.h>
+
+class qa_gcell_general : public CppUnit::TestCase {
+
+ CPPUNIT_TEST_SUITE(qa_gcell_general);
+ CPPUNIT_TEST(test_memset);
+ CPPUNIT_TEST_SUITE_END();
+
+ private:
+ void test_memset();
+
+ bool generic_test_body(const std::string &proc_name);
+};
+
+#endif /* INCLUDED_QA_GCELL_GENERAL_H */
diff --git a/gcell/src/lib/wrapper/qa_gcell_wrapper.cc b/gcell/src/lib/wrapper/qa_gcell_wrapper.cc
index 029dfbc58..d53c61057 100644
--- a/gcell/src/lib/wrapper/qa_gcell_wrapper.cc
+++ b/gcell/src/lib/wrapper/qa_gcell_wrapper.cc
@@ -20,12 +20,13 @@
*/
/*
- * This class gathers together all the test cases for the lib
+ * This class gathers together all the test cases for the lib/wrapper
* directory into a single test suite. As you create new test cases,
* add them here.
*/
#include <qa_gcell_wrapper.h>
+#include <qa_gcell_general.h>
#include <qa_gcp_fft_1d_r2.h>
CppUnit::TestSuite *
@@ -33,6 +34,7 @@ qa_gcell_wrapper::suite()
{
CppUnit::TestSuite *s = new CppUnit::TestSuite("wrapper");
+ s->addTest(qa_gcell_general::suite());
s->addTest(qa_gcp_fft_1d_r2::suite());
return s;