From 5d69a524f81f234b3fbc41d49ba18d6f6886baba Mon Sep 17 00:00:00 2001 From: jcorgan Date: Thu, 3 Aug 2006 04:51:51 +0000 Subject: Houston, we have a trunk. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3122 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/tests/Makefile.am | 96 ++++++++++ gnuradio-core/src/tests/benchmark_dotprod.cc | 148 +++++++++++++++ gnuradio-core/src/tests/benchmark_dotprod_ccc.cc | 149 +++++++++++++++ gnuradio-core/src/tests/benchmark_dotprod_ccf.cc | 151 ++++++++++++++++ gnuradio-core/src/tests/benchmark_dotprod_fcc.cc | 152 ++++++++++++++++ gnuradio-core/src/tests/benchmark_dotprod_fsf.cc | 151 ++++++++++++++++ gnuradio-core/src/tests/benchmark_dotprod_scc.cc | 151 ++++++++++++++++ gnuradio-core/src/tests/benchmark_nco.cc | 219 +++++++++++++++++++++++ gnuradio-core/src/tests/benchmark_vco.cc | 166 +++++++++++++++++ gnuradio-core/src/tests/nco_results | 48 +++++ gnuradio-core/src/tests/test_all.cc | 46 +++++ gnuradio-core/src/tests/test_atsc.cc | 37 ++++ gnuradio-core/src/tests/test_buffers.py | 136 ++++++++++++++ gnuradio-core/src/tests/test_filter.cc | 37 ++++ gnuradio-core/src/tests/test_general.cc | 37 ++++ gnuradio-core/src/tests/test_runtime.cc | 37 ++++ gnuradio-core/src/tests/test_vmcircbuf.cc | 44 +++++ 17 files changed, 1805 insertions(+) create mode 100644 gnuradio-core/src/tests/Makefile.am create mode 100644 gnuradio-core/src/tests/benchmark_dotprod.cc create mode 100644 gnuradio-core/src/tests/benchmark_dotprod_ccc.cc create mode 100644 gnuradio-core/src/tests/benchmark_dotprod_ccf.cc create mode 100644 gnuradio-core/src/tests/benchmark_dotprod_fcc.cc create mode 100644 gnuradio-core/src/tests/benchmark_dotprod_fsf.cc create mode 100644 gnuradio-core/src/tests/benchmark_dotprod_scc.cc create mode 100644 gnuradio-core/src/tests/benchmark_nco.cc create mode 100644 gnuradio-core/src/tests/benchmark_vco.cc create mode 100644 gnuradio-core/src/tests/nco_results create mode 100644 gnuradio-core/src/tests/test_all.cc create mode 100644 gnuradio-core/src/tests/test_atsc.cc create mode 100755 gnuradio-core/src/tests/test_buffers.py create mode 100644 gnuradio-core/src/tests/test_filter.cc create mode 100644 gnuradio-core/src/tests/test_general.cc create mode 100644 gnuradio-core/src/tests/test_runtime.cc create mode 100644 gnuradio-core/src/tests/test_vmcircbuf.cc (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/Makefile.am b/gnuradio-core/src/tests/Makefile.am new file mode 100644 index 000000000..1dd3dd061 --- /dev/null +++ b/gnuradio-core/src/tests/Makefile.am @@ -0,0 +1,96 @@ +# +# Copyright 2001 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 2, 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., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# + +include $(top_srcdir)/Makefile.common + +INCLUDES = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) + +# list of programs run by "make check" and "make distcheck" + +TESTS = test_all + + +# test_atsc + +#Test program to test setting up buffers using gr_test which can be run manually +EXTRA_DIST = \ + test_buffers.py + +noinst_PROGRAMS = \ + benchmark_dotprod \ + benchmark_dotprod_fsf \ + benchmark_dotprod_fcc \ + benchmark_dotprod_scc \ + benchmark_dotprod_ccc \ + benchmark_dotprod_ccf \ + benchmark_nco \ + benchmark_vco \ + test_runtime \ + test_general \ + test_all \ + test_filter \ + test_vmcircbuf + + +LIBGNURADIO = $(top_builddir)/gnuradio-core/src/lib/libgnuradio-core.la +LIBGNURADIOQA = $(top_builddir)/gnuradio-core/src/lib/libgnuradio-core-qa.la $(LIBGNURADIO) + +benchmark_dotprod_SOURCES = benchmark_dotprod.cc +benchmark_dotprod_LDADD = $(LIBGNURADIO) + +benchmark_dotprod_fsf_SOURCES = benchmark_dotprod_fsf.cc +benchmark_dotprod_fsf_LDADD = $(LIBGNURADIO) + +benchmark_dotprod_ccf_SOURCES = benchmark_dotprod_ccf.cc +benchmark_dotprod_ccf_LDADD = $(LIBGNURADIO) + +benchmark_dotprod_fcc_SOURCES = benchmark_dotprod_fcc.cc +benchmark_dotprod_fcc_LDADD = $(LIBGNURADIO) + +benchmark_dotprod_scc_SOURCES = benchmark_dotprod_scc.cc +benchmark_dotprod_scc_LDADD = $(LIBGNURADIO) + +benchmark_dotprod_ccc_SOURCES = benchmark_dotprod_ccc.cc +benchmark_dotprod_ccc_LDADD = $(LIBGNURADIO) + +benchmark_nco_SOURCES = benchmark_nco.cc +benchmark_nco_LDADD = $(LIBGNURADIO) + +benchmark_vco_SOURCES = benchmark_vco.cc +benchmark_vco_LDADD = $(LIBGNURADIO) + +test_runtime_SOURCES = test_runtime.cc +test_runtime_LDADD = $(LIBGNURADIOQA) + +test_general_SOURCES = test_general.cc +test_general_LDADD = $(LIBGNURADIOQA) + +test_filter_SOURCES = test_filter.cc +test_filter_LDADD = $(LIBGNURADIOQA) + +# test_atsc_SOURCES = test_atsc.cc +#test_atsc_LDADD = $(LIBGNURADIOQA) + +test_vmcircbuf_SOURCES = test_vmcircbuf.cc +test_vmcircbuf_LDADD = $(LIBGNURADIOQA) + +test_all_SOURCES = test_all.cc +test_all_LDADD = $(LIBGNURADIOQA) diff --git a/gnuradio-core/src/tests/benchmark_dotprod.cc b/gnuradio-core/src/tests/benchmark_dotprod.cc new file mode 100644 index 000000000..8986f7255 --- /dev/null +++ b/gnuradio-core/src/tests/benchmark_dotprod.cc @@ -0,0 +1,148 @@ +/* -*- c++ -*- */ +/* + * Copyright 2002 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 2, 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include +#include +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif + +#include +#include +#include +#include + +#define TOTAL_TEST_SIZE (40 * 1000 * 1000L) +#define NTAPS 256 +#define BLOCK_SIZE (50 * 1000) /* fits in cache */ + +#if ((TOTAL_TEST_SIZE % BLOCK_SIZE) != 0) +#error "TOTAL_TEST_SIZE % BLOCK_SIZE must equal 0" +#endif + +typedef gr_fir_fff* (*fir_maker_t)(const std::vector &taps); +typedef gr_fir_fff filter_t; + + +static double +timeval_to_double (const struct timeval *tv) +{ + return (double) tv->tv_sec + (double) tv->tv_usec * 1e-6; +} + + +static void +benchmark (fir_maker_t filter_maker, const char *implementation_name) +{ + int i; + float coeffs[NTAPS]; + float input[BLOCK_SIZE + NTAPS]; + long n; + float result; +#ifdef HAVE_SYS_RESOURCE_H + struct rusage rusage_start; + struct rusage rusage_stop; +#else + double clock_start; + double clock_end; +#endif + // setup coefficients and input data + + for (i = 0; i < NTAPS; i++) + coeffs[i] = random() - RANDOM_MAX/2; + + for (i = 0; i < BLOCK_SIZE + NTAPS; i++) + input[i] = random() - RANDOM_MAX/2; + + std::vector taps (&coeffs[0], &coeffs[NTAPS]); + filter_t *f = filter_maker (taps); + + // get starting CPU usage +#ifdef HAVE_SYS_RESOURCE_H + if (getrusage (RUSAGE_SELF, &rusage_start) < 0){ + perror ("getrusage"); + exit (1); + } +#else + clock_start = (double) clock() * (1000000. / CLOCKS_PER_SEC); +#endif + // do the actual work + + for (n = 0; n < TOTAL_TEST_SIZE; n += BLOCK_SIZE){ + int j; + for (j = 0; j < BLOCK_SIZE; j++){ + result = f->filter (&input[j]); + } + } + + // get ending CPU usage +#ifdef HAVE_SYS_RESOURCE_H + if (getrusage (RUSAGE_SELF, &rusage_stop) < 0){ + perror ("getrusage"); + exit (1); + } + + // compute results + + double user = + timeval_to_double (&rusage_stop.ru_utime) + - timeval_to_double (&rusage_start.ru_utime); + + double sys = + timeval_to_double (&rusage_stop.ru_stime) + - timeval_to_double (&rusage_start.ru_stime); + + double total = user + sys; +#else + clock_end = (double) clock () * (1000000. / CLOCKS_PER_SEC); + double total = clock_end -clock_start; +#endif + double macs = NTAPS * (double) TOTAL_TEST_SIZE; + + printf ("%10s: taps: %4d input: %4g cpu: %6.3f taps/sec: %10.4g \n", + implementation_name, NTAPS, (double) TOTAL_TEST_SIZE, total, macs / total); + + delete f; +} + +static void +do_all () +{ + std::vector info; + gr_fir_util::get_gr_fir_fff_info (&info); // get all known FFF implementations + + for (std::vector::iterator p = info.begin (); + p != info.end (); + ++p){ + + benchmark (p->create, p->name); + } +} + +int +main (int argc, char **argv) +{ + do_all (); + return 0; +} diff --git a/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc b/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc new file mode 100644 index 000000000..afc24e071 --- /dev/null +++ b/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc @@ -0,0 +1,149 @@ +/* -*- c++ -*- */ +/* + * Copyright 2002 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 2, 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include +#include +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif +#include +#include +#include +#include + +#define TOTAL_TEST_SIZE (40 * 1000 * 1000L) +#define NTAPS 256 +#define BLOCK_SIZE (50 * 1000) /* fits in cache */ + +#if ((TOTAL_TEST_SIZE % BLOCK_SIZE) != 0) +#error "TOTAL_TEST_SIZE % BLOCK_SIZE must equal 0" +#endif + +typedef gr_fir_ccc* (*fir_maker_t)(const std::vector &taps); +typedef gr_fir_ccc filter_t; + + +static double +timeval_to_double (const struct timeval *tv) +{ + return (double) tv->tv_sec + (double) tv->tv_usec * 1e-6; +} + + +static void +benchmark (fir_maker_t filter_maker, const char *implementation_name) +{ + int i; + gr_complex coeffs[NTAPS]; + gr_complex input[BLOCK_SIZE + NTAPS]; + long n; + gr_complex result; +#ifdef HAVE_SYS_RESOURCE_H + struct rusage rusage_start; + struct rusage rusage_stop; +#else + double clock_start; + double clock_end; +#endif + + + // setup coefficients and input data + + for (i = 0; i < NTAPS; i++) + coeffs[i] = gr_complex(random() - RANDOM_MAX/2, random() - RANDOM_MAX/2); + + for (i = 0; i < BLOCK_SIZE + NTAPS; i++) + input[i] = gr_complex(random() - RANDOM_MAX/2, random() - RANDOM_MAX/2); + + std::vector taps (&coeffs[0], &coeffs[NTAPS]); + filter_t *f = filter_maker (taps); + + // get starting CPU usage +#ifdef HAVE_SYS_RESOURCE_H + if (getrusage (RUSAGE_SELF, &rusage_start) < 0){ + perror ("getrusage"); + exit (1); + } +#else + clock_start= (double) clock() * (1000000. / CLOCKS_PER_SEC); +#endif + // do the actual work + + for (n = 0; n < TOTAL_TEST_SIZE; n += BLOCK_SIZE){ + int j; + for (j = 0; j < BLOCK_SIZE; j++){ + result = f->filter ((gr_complex*)&input[j]); + } + } + + // get ending CPU usage +#ifdef HAVE_SYS_RESOURCE_H + if (getrusage (RUSAGE_SELF, &rusage_stop) < 0){ + perror ("getrusage"); + exit (1); + } + + // compute results + + double user = + timeval_to_double (&rusage_stop.ru_utime) + - timeval_to_double (&rusage_start.ru_utime); + + double sys = + timeval_to_double (&rusage_stop.ru_stime) + - timeval_to_double (&rusage_start.ru_stime); + + double total = user + sys; +#else + clock_end = (double) clock() * (1000000. / CLOCKS_PER_SEC); + double total = clock_end - clock_start; +#endif + + double macs = NTAPS * (double) TOTAL_TEST_SIZE; + + printf ("%10s: taps: %4d input: %4g cpu: %6.3f taps/sec: %10.4g \n", + implementation_name, NTAPS, (double) TOTAL_TEST_SIZE, total, macs / total); + + delete f; +} + +static void +do_all () +{ + std::vector info; + gr_fir_util::get_gr_fir_ccc_info (&info); // get all known CCC implementations + + for (std::vector::iterator p = info.begin (); + p != info.end () ; + ++p){ + benchmark (p->create, p->name); + } +} + +int +main (int argc, char **argv) +{ + do_all (); + return 0; +} diff --git a/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc b/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc new file mode 100644 index 000000000..866f7f61a --- /dev/null +++ b/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc @@ -0,0 +1,151 @@ +/* -*- c++ -*- */ +/* + * Copyright 2002 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 2, 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include +#include +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif +#include +#include +#include +#include + +#define TOTAL_TEST_SIZE (40 * 1000 * 1000L) +#define NTAPS 256 +#define BLOCK_SIZE (50 * 1000) /* fits in cache */ + +#if ((TOTAL_TEST_SIZE % BLOCK_SIZE) != 0) +#error "TOTAL_TEST_SIZE % BLOCK_SIZE must equal 0" +#endif + +typedef gr_fir_ccf* (*fir_maker_t)(const std::vector &taps); +typedef gr_fir_ccf filter_t; + + +static double +timeval_to_double (const struct timeval *tv) +{ + return (double) tv->tv_sec + (double) tv->tv_usec * 1e-6; +} + + +static void +benchmark (fir_maker_t filter_maker, const char *implementation_name) +{ + int i; + float coeffs[NTAPS]; + gr_complex input[BLOCK_SIZE + NTAPS]; + long n; + gr_complex result; +#ifdef HAVE_SYS_RESOURCE_H + struct rusage rusage_start; + struct rusage rusage_stop; +#else + double clock_start; + double clock_end; +#endif + + // setup coefficients and input data + + for (i = 0; i < NTAPS; i++) + coeffs[i] = random() - RANDOM_MAX/2; + + for (i = 0; i < BLOCK_SIZE + NTAPS; i++) + input[i] = gr_complex(random() - RANDOM_MAX/2, random() - RANDOM_MAX/2); + + std::vector taps (&coeffs[0], &coeffs[NTAPS]); + filter_t *f = filter_maker (taps); + + // get starting CPU usage + +#ifdef HAVE_SYS_RESOURCE_H + if (getrusage (RUSAGE_SELF, &rusage_start) < 0){ + perror ("getrusage"); + exit (1); + } +#else + clock_start= (double) clock() * (1000000. / CLOCKS_PER_SEC); +#endif + + // do the actual work + + for (n = 0; n < TOTAL_TEST_SIZE; n += BLOCK_SIZE){ + int j; + for (j = 0; j < BLOCK_SIZE; j++){ + result = f->filter (&input[j]); + } + } + + // get ending CPU usage + +#ifdef HAVE_SYS_RESOURCE_H + if (getrusage (RUSAGE_SELF, &rusage_stop) < 0){ + perror ("getrusage"); + exit (1); + } + + // compute results + + double user = + timeval_to_double (&rusage_stop.ru_utime) + - timeval_to_double (&rusage_start.ru_utime); + + double sys = + timeval_to_double (&rusage_stop.ru_stime) + - timeval_to_double (&rusage_start.ru_stime); + + double total = user + sys; +#else + clock_end= (double) clock() * (1000000. / CLOCKS_PER_SEC); + double total = clock_end - clock_start; +#endif + + double macs = NTAPS * (double) TOTAL_TEST_SIZE; + + printf ("%10s: taps: %4d input: %4g cpu: %6.3f taps/sec: %10.4g \n", + implementation_name, NTAPS, (double) TOTAL_TEST_SIZE, total, macs / total); + + delete f; +} + +static void +do_all () +{ + std::vector info; + gr_fir_util::get_gr_fir_ccf_info (&info); // get all known CCF implementations + + for (std::vector::iterator p = info.begin (); + p != info.end () ; + ++p){ + benchmark (p->create, p->name); + } +} + +int +main (int argc, char **argv) +{ + do_all (); + return 0; +} diff --git a/gnuradio-core/src/tests/benchmark_dotprod_fcc.cc b/gnuradio-core/src/tests/benchmark_dotprod_fcc.cc new file mode 100644 index 000000000..af54707b8 --- /dev/null +++ b/gnuradio-core/src/tests/benchmark_dotprod_fcc.cc @@ -0,0 +1,152 @@ +/* -*- c++ -*- */ +/* + * Copyright 2002 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 2, 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include +#include +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif +#include +#include +#include +#include + +#define TOTAL_TEST_SIZE (40 * 1000 * 1000L) +#define NTAPS 256 +#define BLOCK_SIZE (50 * 1000) /* fits in cache */ + +#if ((TOTAL_TEST_SIZE % BLOCK_SIZE) != 0) +#error "TOTAL_TEST_SIZE % BLOCK_SIZE must equal 0" +#endif + +typedef gr_fir_fcc* (*fir_maker_t)(const std::vector &taps); +typedef gr_fir_fcc filter_t; + + +static double +timeval_to_double (const struct timeval *tv) +{ + return (double) tv->tv_sec + (double) tv->tv_usec * 1e-6; +} + + +static void +benchmark (fir_maker_t filter_maker, const char *implementation_name) +{ + int i; + gr_complex coeffs[NTAPS]; + float input[BLOCK_SIZE + NTAPS]; + long n; + gr_complex result; +#ifdef HAVE_SYS_RESOURCE_H + struct rusage rusage_start; + struct rusage rusage_stop; +#else + double clock_start; + double clock_end; +#endif + + + + // setup coefficients and input data + + for (i = 0; i < NTAPS; i++) + coeffs[i] = gr_complex(random() - RANDOM_MAX/2, random() - RANDOM_MAX/2); + + for (i = 0; i < BLOCK_SIZE + NTAPS; i++) + input[i] = random() - RANDOM_MAX/2; + + std::vector taps (&coeffs[0], &coeffs[NTAPS]); + filter_t *f = filter_maker (taps); + + // get starting CPU usage +#ifdef HAVE_SYS_RESOURCE_H + if (getrusage (RUSAGE_SELF, &rusage_start) < 0){ + perror ("getrusage"); + exit (1); + } +#else + clock_start = (double) clock() * (1000000. / CLOCKS_PER_SEC); +#endif + + // do the actual work + + for (n = 0; n < TOTAL_TEST_SIZE; n += BLOCK_SIZE){ + int j; + for (j = 0; j < BLOCK_SIZE; j++){ + result = f->filter (&input[j]); + } + } + + // get ending CPU usage + +#ifdef HAVE_SYS_RESOURCE_H + if (getrusage (RUSAGE_SELF, &rusage_stop) < 0){ + perror ("getrusage"); + exit (1); + } + + // compute results + + double user = + timeval_to_double (&rusage_stop.ru_utime) + - timeval_to_double (&rusage_start.ru_utime); + + double sys = + timeval_to_double (&rusage_stop.ru_stime) + - timeval_to_double (&rusage_start.ru_stime); + + double total = user + sys; +#else + clock_end= (double) clock() * (1000000. / CLOCKS_PER_SEC); + double total = clock_end - clock_start; +#endif + + double macs = NTAPS * (double) TOTAL_TEST_SIZE; + + printf ("%10s: taps: %4d input: %4g cpu: %6.3f taps/sec: %10.4g \n", + implementation_name, NTAPS, (double) TOTAL_TEST_SIZE, total, macs / total); + + delete f; +} + +static void +do_all () +{ + std::vector info; + gr_fir_util::get_gr_fir_fcc_info (&info); // get all known FCC implementations + + for (std::vector::iterator p = info.begin (); + p != info.end () ; + ++p){ + benchmark (p->create, p->name); + } +} + +int +main (int argc, char **argv) +{ + do_all (); + return 0; +} diff --git a/gnuradio-core/src/tests/benchmark_dotprod_fsf.cc b/gnuradio-core/src/tests/benchmark_dotprod_fsf.cc new file mode 100644 index 000000000..7317e8398 --- /dev/null +++ b/gnuradio-core/src/tests/benchmark_dotprod_fsf.cc @@ -0,0 +1,151 @@ +/* -*- c++ -*- */ +/* + * Copyright 2002 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 2, 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include +#include +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif +#include +#include +#include +#include + +#define TOTAL_TEST_SIZE (40 * 1000 * 1000L) +#define NTAPS 256 +#define BLOCK_SIZE (50 * 1000) /* fits in cache */ + +#if ((TOTAL_TEST_SIZE % BLOCK_SIZE) != 0) +#error "TOTAL_TEST_SIZE % BLOCK_SIZE must equal 0" +#endif + +typedef gr_fir_fsf* (*fir_maker_t)(const std::vector &taps); +typedef gr_fir_fsf filter_t; + + +static double +timeval_to_double (const struct timeval *tv) +{ + return (double) tv->tv_sec + (double) tv->tv_usec * 1e-6; +} + + +static void +benchmark (fir_maker_t filter_maker, const char *implementation_name) +{ + int i; + float coeffs[NTAPS]; + float input[BLOCK_SIZE + NTAPS]; + long n; + short result; +#ifdef HAVE_SYS_RESOURCE_H + struct rusage rusage_start; + struct rusage rusage_stop; +#else + double clock_start; + double clock_end; +#endif + + // setup coefficients and input data + + for (i = 0; i < NTAPS; i++) + coeffs[i] = random() - RANDOM_MAX/2; + + for (i = 0; i < BLOCK_SIZE + NTAPS; i++) + input[i] = random() - RANDOM_MAX/2; + + std::vector taps (&coeffs[0], &coeffs[NTAPS]); + filter_t *f = filter_maker (taps); + + // get starting CPU usage +#ifdef HAVE_SYS_RESOURCE_H + if (getrusage (RUSAGE_SELF, &rusage_start) < 0){ + perror ("getrusage"); + exit (1); + } +#else + clock_start= (double) clock() * (1000000. / CLOCKS_PER_SEC); +#endif + + // do the actual work + + for (n = 0; n < TOTAL_TEST_SIZE; n += BLOCK_SIZE){ + int j; + for (j = 0; j < BLOCK_SIZE; j++){ + result = f->filter (&input[j]); + } + } + + // get ending CPU usage + +#ifdef HAVE_SYS_RESOURCE_H + if (getrusage (RUSAGE_SELF, &rusage_stop) < 0){ + perror ("getrusage"); + exit (1); + } + + // compute results + + double user = + timeval_to_double (&rusage_stop.ru_utime) + - timeval_to_double (&rusage_start.ru_utime); + + double sys = + timeval_to_double (&rusage_stop.ru_stime) + - timeval_to_double (&rusage_start.ru_stime); + + double total = user + sys; +#else + clock_end= (double) clock() * (1000000. / CLOCKS_PER_SEC); + double total = clock_end - clock_start; +#endif + + double macs = NTAPS * (double) TOTAL_TEST_SIZE; + + printf ("%10s: taps: %4d input: %4g cpu: %6.3f taps/sec: %10.4g \n", + implementation_name, NTAPS, (double) TOTAL_TEST_SIZE, total, macs / total); + + delete f; +} + +static void +do_all () +{ + std::vector info; + gr_fir_util::get_gr_fir_fsf_info (&info); // get all known FFF implementations + + for (std::vector::iterator p = info.begin (); + p != info.end (); + ++p){ + + benchmark (p->create, p->name); + } +} + +int +main (int argc, char **argv) +{ + do_all (); + return 0; +} diff --git a/gnuradio-core/src/tests/benchmark_dotprod_scc.cc b/gnuradio-core/src/tests/benchmark_dotprod_scc.cc new file mode 100644 index 000000000..d67fad556 --- /dev/null +++ b/gnuradio-core/src/tests/benchmark_dotprod_scc.cc @@ -0,0 +1,151 @@ +/* -*- c++ -*- */ +/* + * Copyright 2002 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 2, 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include +#include +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif +#include +#include +#include +#include + +#define TOTAL_TEST_SIZE (40 * 1000 * 1000L) +#define NTAPS 256 +#define BLOCK_SIZE (50 * 1000) /* fits in cache */ + +#if ((TOTAL_TEST_SIZE % BLOCK_SIZE) != 0) +#error "TOTAL_TEST_SIZE % BLOCK_SIZE must equal 0" +#endif + +typedef gr_fir_scc* (*fir_maker_t)(const std::vector &taps); +typedef gr_fir_scc filter_t; + + +static double +timeval_to_double (const struct timeval *tv) +{ + return (double) tv->tv_sec + (double) tv->tv_usec * 1e-6; +} + + +static void +benchmark (fir_maker_t filter_maker, const char *implementation_name) +{ + int i; + gr_complex coeffs[NTAPS]; + short input[BLOCK_SIZE + NTAPS]; + long n; + gr_complex result; +#ifdef HAVE_SYS_RESOURCE_H + struct rusage rusage_start; + struct rusage rusage_stop; +#else + double clock_start; + double clock_end; +#endif + + + // setup coefficients and input data + + for (i = 0; i < NTAPS; i++) + coeffs[i] = gr_complex(random() - RANDOM_MAX/2, random() - RANDOM_MAX/2); + + for (i = 0; i < BLOCK_SIZE + NTAPS; i++) + input[i] = random() - RANDOM_MAX/2; + + std::vector taps (&coeffs[0], &coeffs[NTAPS]); + filter_t *f = filter_maker (taps); + + // get starting CPU usage + +#ifdef HAVE_SYS_RESOURCE_H + if (getrusage (RUSAGE_SELF, &rusage_start) < 0){ + perror ("getrusage"); + exit (1); + } +#else + clock_start = (double) clock() * (1000000. / CLOCKS_PER_SEC); +#endif + + // do the actual work + + for (n = 0; n < TOTAL_TEST_SIZE; n += BLOCK_SIZE){ + int j; + for (j = 0; j < BLOCK_SIZE; j++){ + result = f->filter (&input[j]); + } + } + + // get ending CPU usage +#ifdef HAVE_SYS_RESOURCE_H + if (getrusage (RUSAGE_SELF, &rusage_stop) < 0){ + perror ("getrusage"); + exit (1); + } + + // compute results + + double user = + timeval_to_double (&rusage_stop.ru_utime) + - timeval_to_double (&rusage_start.ru_utime); + + double sys = + timeval_to_double (&rusage_stop.ru_stime) + - timeval_to_double (&rusage_start.ru_stime); + + double total = user + sys; +#else + clock_end= (double) clock () * (1000000. / CLOCKS_PER_SEC); + double total = clock_end -clock_start; +#endif + + double macs = NTAPS * (double) TOTAL_TEST_SIZE; + + printf ("%10s: taps: %4d input: %4g cpu: %6.3f taps/sec: %10.4g \n", + implementation_name, NTAPS, (double) TOTAL_TEST_SIZE, total, macs / total); + + delete f; +} + +static void +do_all () +{ + std::vector info; + gr_fir_util::get_gr_fir_scc_info (&info); // get all known SCC implementations + + for (std::vector::iterator p = info.begin (); + p != info.end () ; + ++p){ + benchmark (p->create, p->name); + } +} + +int +main (int argc, char **argv) +{ + do_all (); + return 0; +} diff --git a/gnuradio-core/src/tests/benchmark_nco.cc b/gnuradio-core/src/tests/benchmark_nco.cc new file mode 100644 index 000000000..fb0fe687b --- /dev/null +++ b/gnuradio-core/src/tests/benchmark_nco.cc @@ -0,0 +1,219 @@ +/* -*- c++ -*- */ +/* + * Copyright 2002,2004 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 2, 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include +#include +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif +#include +#include +#include + +#define ITERATIONS 20000000 +#define BLOCK_SIZE (10 * 1000) // fits in cache + +#define FREQ 5003.123 + +static double +timeval_to_double (const struct timeval *tv) +{ + return (double) tv->tv_sec + (double) tv->tv_usec * 1e-6; +} + + +static void +benchmark (void test (float *x, float *y), const char *implementation_name) +{ +#ifdef HAVE_SYS_RESOURCE_H + struct rusage rusage_start; + struct rusage rusage_stop; +#else + double clock_start; + double clock_end; +#endif + float output[2*BLOCK_SIZE]; + float *x = &output[0], *y = &output[BLOCK_SIZE]; + + // touch memory + memset(output, 0, 2*BLOCK_SIZE*sizeof(float)); + + // get starting CPU usage +#ifdef HAVE_SYS_RESOURCE_H + if (getrusage (RUSAGE_SELF, &rusage_start) < 0){ + perror ("getrusage"); + exit (1); + } +#else + clock_start = (double) clock() * (1000000. / CLOCKS_PER_SEC); +#endif + // do the actual work + + test (x, y); + + // get ending CPU usage + +#ifdef HAVE_SYS_RESOURCE_H + if (getrusage (RUSAGE_SELF, &rusage_stop) < 0){ + perror ("getrusage"); + exit (1); + } + + // compute results + + double user = + timeval_to_double (&rusage_stop.ru_utime) + - timeval_to_double (&rusage_start.ru_utime); + + double sys = + timeval_to_double (&rusage_stop.ru_stime) + - timeval_to_double (&rusage_start.ru_stime); + + double total = user + sys; +#else + clock_end = (double) clock () * (1000000. / CLOCKS_PER_SEC); + double total = clock_end - clock_start; +#endif + + printf ("%18s: cpu: %6.3f steps/sec: %10.3e\n", + implementation_name, total, ITERATIONS / total); +} + +// ---------------------------------------------------------------- +// Don't compare the _vec with other functions since memory store's +// are involved. + +void basic_sincos_vec (float *x, float *y) +{ + gr_nco nco; + + nco.set_freq (2 * M_PI / FREQ); + + for (int i = 0; i < ITERATIONS/BLOCK_SIZE; i++){ + for (int j = 0; j < BLOCK_SIZE; j++){ + nco.sincos (&x[2*j+1], &x[2*j]); + nco.step (); + } + } +} + +void native_sincos_vec (float *x, float *y) +{ + gr_nco nco; + + nco.set_freq (2 * M_PI / FREQ); + + for (int i = 0; i < ITERATIONS/BLOCK_SIZE; i++){ + nco.sincos ((gr_complex*)x, BLOCK_SIZE); + } +} + +void fxpt_sincos_vec (float *x, float *y) +{ + gr_fxpt_nco nco; + + nco.set_freq (2 * M_PI / FREQ); + + for (int i = 0; i < ITERATIONS/BLOCK_SIZE; i++){ + nco.sincos ((gr_complex*)x, BLOCK_SIZE); + } +} + +// ---------------------------------------------------------------- + +void native_sincos (float *x, float *y) +{ + gr_nco nco; + + nco.set_freq (2 * M_PI / FREQ); + + for (int i = 0; i < ITERATIONS; i++){ + nco.sincos (x, y); + nco.step (); + } +} + +void fxpt_sincos (float *x, float *y) +{ + gr_fxpt_nco nco; + + nco.set_freq (2 * M_PI / FREQ); + + for (int i = 0; i < ITERATIONS; i++){ + nco.sincos (x, y); + nco.step (); + } +} + +// ---------------------------------------------------------------- + +void native_sin (float *x, float *y) +{ + gr_nco nco; + + nco.set_freq (2 * M_PI / FREQ); + + for (int i = 0; i < ITERATIONS; i++){ + *x = nco.sin (); + nco.step (); + } +} + +void fxpt_sin (float *x, float *y) +{ + gr_fxpt_nco nco; + + nco.set_freq (2 * M_PI / FREQ); + + for (int i = 0; i < ITERATIONS; i++){ + *x = nco.sin (); + nco.step (); + } +} + +// ---------------------------------------------------------------- + +void nop_fct (float *x, float *y) +{ +} + +void nop_loop (float *x, float *y) +{ + for (int i = 0; i < ITERATIONS; i++){ + nop_fct (x, y); + } +} + +int +main (int argc, char **argv) +{ + benchmark (nop_loop, "nop loop"); + benchmark (native_sin, "native sine"); + benchmark (fxpt_sin, "fxpt sine"); + benchmark (native_sincos, "native sin/cos"); + benchmark (fxpt_sincos, "fxpt sin/cos"); + benchmark (basic_sincos_vec, "basic sin/cos vec"); + benchmark (native_sincos_vec, "native sin/cos vec"); + benchmark (fxpt_sincos_vec, "fxpt sin/cos vec"); +} diff --git a/gnuradio-core/src/tests/benchmark_vco.cc b/gnuradio-core/src/tests/benchmark_vco.cc new file mode 100644 index 000000000..1b290dfa5 --- /dev/null +++ b/gnuradio-core/src/tests/benchmark_vco.cc @@ -0,0 +1,166 @@ +/* -*- c++ -*- */ +/* + * Copyright 2002,2004,2005 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 2, 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include +#include +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif +#include +#include +#include + +#define ITERATIONS 5000000 +#define BLOCK_SIZE (10 * 1000) // fits in cache + +#define FREQ 5003.123 +#define K 4.9999999 +#define AMPLITUDE 2.444444444 + + +static double +timeval_to_double (const struct timeval *tv) +{ + return (double) tv->tv_sec + (double) tv->tv_usec * 1e-6; +} + + +static void +benchmark (void test (float *x, const float *y), const char *implementation_name) +{ +#ifdef HAVE_SYS_RESOURCE_H + struct rusage rusage_start; + struct rusage rusage_stop; +#else + double clock_start; + double clock_end; +#endif + float output[BLOCK_SIZE]; + float input[BLOCK_SIZE]; + + // touch memory + memset(output, 0, BLOCK_SIZE*sizeof(float)); + for (int i = 0; i 2 * M_PI) + phase -= 2 * M_PI; + + while (phase < -2 * M_PI) + phase += 2 * M_PI; + } + } +} + +void native_vco (float *output, const float *input) +{ + gr_vco vco; + + for (int j = 0; j < ITERATIONS/BLOCK_SIZE; j++){ + vco.cos(output, input, BLOCK_SIZE, K, AMPLITUDE); + } + } + +void fxpt_vco (float *output, const float *input) +{ + gr_fxpt_vco vco; + + for (int j = 0; j < ITERATIONS/BLOCK_SIZE; j++){ + vco.cos(output, input, BLOCK_SIZE, K, AMPLITUDE); + } +} + +// ---------------------------------------------------------------- + +void nop_fct (float *x, const float *y) +{ +} + +void nop_loop (float *x, const float *y) +{ + for (int i = 0; i < ITERATIONS; i++){ + nop_fct (x, y); + } +} + +int +main (int argc, char **argv) +{ + benchmark (nop_loop, "nop loop"); + benchmark (basic_vco, "basic vco"); + benchmark (native_vco, "native vco"); + benchmark (fxpt_vco, "fxpt vco"); +} diff --git a/gnuradio-core/src/tests/nco_results b/gnuradio-core/src/tests/nco_results new file mode 100644 index 000000000..5bdf5dd1c --- /dev/null +++ b/gnuradio-core/src/tests/nco_results @@ -0,0 +1,48 @@ +================================================================ +These are on a 1.4 GHz Pentium M using g++ 3.4.1 +================================================================ + +Default compiler options -O2 + + nop loop: cpu: 0.015 steps/sec: 6.668e+08 + native sine: cpu: 0.900 steps/sec: 1.111e+07 + fxpt sine: cpu: 0.281 steps/sec: 3.559e+07 + native sin/cos: cpu: 1.138 steps/sec: 8.789e+06 + fxpt sin/cos: cpu: 0.550 steps/sec: 1.818e+07 + +-O2 -march=pentium-m -fomit-frame-pointer + + nop loop: cpu: 0.015 steps/sec: 6.668e+08 + native sine: cpu: 0.903 steps/sec: 1.108e+07 + fxpt sine: cpu: 0.271 steps/sec: 3.691e+07 + native sin/cos: cpu: 1.092 steps/sec: 9.159e+06 + fxpt sin/cos: cpu: 0.542 steps/sec: 1.845e+07 + +Inlined fxpt::sin & cos +-O2 -march=pentium-m -fomit-frame-pointer + + nop loop: cpu: 0.015 steps/sec: 6.668e+08 + native sine: cpu: 0.904 steps/sec: 1.106e+07 + fxpt sine: cpu: 0.187 steps/sec: 5.348e+07 + native sin/cos: cpu: 1.091 steps/sec: 9.167e+06 + fxpt sin/cos: cpu: 0.373 steps/sec: 2.681e+07 + +================================================================ +These are on a 1.5 GHz Athon MP 1800+ +================================================================ + +Default compiler options: -O2 + + nop loop: cpu: 0.013 steps/sec: 7.693e+08 + native sine: cpu: 0.733 steps/sec: 1.364e+07 + fxpt sine: cpu: 0.210 steps/sec: 4.763e+07 + native sin/cos: cpu: 1.183 steps/sec: 8.454e+06 + fxpt sin/cos: cpu: 0.420 steps/sec: 2.381e+07 + +-O2 -fomit-frame-pointer -march=athlon-mp + + nop loop: cpu: 0.013 steps/sec: 7.693e+08 + native sine: cpu: 0.679 steps/sec: 1.473e+07 + fxpt sine: cpu: 0.200 steps/sec: 5.001e+07 + native sin/cos: cpu: 1.147 steps/sec: 8.720e+06 + fxpt sin/cos: cpu: 0.444 steps/sec: 2.253e+07 diff --git a/gnuradio-core/src/tests/test_all.cc b/gnuradio-core/src/tests/test_all.cc new file mode 100644 index 000000000..b5e1b4612 --- /dev/null +++ b/gnuradio-core/src/tests/test_all.cc @@ -0,0 +1,46 @@ +/* -*- c++ -*- */ +/* + * Copyright 2002 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 2, 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include + +#include +#include +#include +// #include + +// FIXME add atsc back in. + +int +main (int argc, char **argv) +{ + + CppUnit::TextTestRunner runner; + + runner.addTest (qa_runtime::suite ()); + runner.addTest (qa_general::suite ()); + runner.addTest (qa_filter::suite ()); + // runner.addTest (qa_atsc::suite ()); + + bool was_successful = runner.run ("", false); + + return was_successful ? 0 : 1; +} diff --git a/gnuradio-core/src/tests/test_atsc.cc b/gnuradio-core/src/tests/test_atsc.cc new file mode 100644 index 000000000..cca96d558 --- /dev/null +++ b/gnuradio-core/src/tests/test_atsc.cc @@ -0,0 +1,37 @@ +/* -*- c++ -*- */ +/* + * Copyright 2002 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 2, 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include + +int +main (int argc, char **argv) +{ + + CppUnit::TextTestRunner runner; + + runner.addTest (qa_atsc::suite ()); + + bool was_successful = runner.run ("", false); + + return was_successful ? 0 : 1; +} diff --git a/gnuradio-core/src/tests/test_buffers.py b/gnuradio-core/src/tests/test_buffers.py new file mode 100755 index 000000000..b3211329b --- /dev/null +++ b/gnuradio-core/src/tests/test_buffers.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python +# +# Copyright 2006 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 2, 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., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# + +from gnuradio import gr, gru +from gnuradio import audio +from gnuradio.eng_option import eng_option +from optparse import OptionParser + +import time +import sys + +# Test script to test setting up the buffers using gr_test +# For very large buffers it will fail when you hit the circbuf memory limit. +# On linux this limit is shmmax, it will fail when it tries to create a buffer > shmmax. +# With a 2.6 or later kernel you can set the shmmax limit manually in a root console +#show current shmmax limit +#$ cat /proc/sys/kernel/shmmax +#33554432 + +#set shmmax limit manually to 300MB +#echo 300000000 >/proc/sys/kernel/shmmax + +#show new shmmax limit +#$ cat /proc/sys/kernel/shmmax +#300000000 + +class my_graph(gr.flow_graph): + + def __init__(self, seconds,history,output_multiple): + gr.flow_graph.__init__(self) + + parser = OptionParser(option_class=eng_option) + parser.add_option("-O", "--audio-output", type="string", default="", + help="pcm output device name. E.g., hw:0,0 or /dev/dsp") + parser.add_option("-r", "--sample-rate", type="eng_float", default=48000, + help="set sample rate to RATE (48000)") + (options, args) = parser.parse_args () + if len(args) != 0: + parser.print_help() + raise SystemExit, 1 + + sample_rate = int(options.sample_rate) + ampl = 0.1 + + src0 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 350, ampl) + + nsamples=int(sample_rate * seconds) #1 seconds + # gr.test (const std::string &name=std::string("gr_test"), + # int min_inputs=1, int max_inputs=1, unsigned int sizeof_input_item=1, + # int min_outputs=1, int max_outputs=1, unsigned int sizeof_output_item=1, + # unsigned int history=1,unsigned int output_multiple=1,double relative_rate=1.0, + # bool fixed_rate=true,gr_consume_type_t cons_type=CONSUME_NOUTPUT_ITEMS, gr_produce_type_t prod_type=PRODUCE_NOUTPUT_ITEMS); + name="gr_test" + min_inputs=1 + max_inputs=1 + sizeof_input_item=gr.sizeof_float + min_outputs=1 + max_outputs=1 + sizeof_output_item=gr.sizeof_float + #history=1 # problems start at 8150 + #output_multiple=1 #problems start at 8000 in combination with large history + relative_rate=1.0 + fixed_rate=True + consume_type=gr.CONSUME_NOUTPUT_ITEMS + produce_type=gr.PRODUCE_NOUTPUT_ITEMS + test = gr.test(name, min_inputs,max_inputs,sizeof_input_item, + min_outputs,max_outputs,sizeof_output_item, + history,output_multiple,relative_rate, + fixed_rate, consume_type,produce_type) + #test = gr.test("gr_test",1,1,gr.sizeof_float, + # 1,1,gr.sizeof_float, + # 1,1,1.0, + # True, gr.CONSUME_NOUTPUT_ITEMS,gr.PRODUCE_NOUTPUT_ITEMS) + #unsigned int history=1,unsigned int output_multiple=1,double relative_rate=1.0, + #bool fixed_rate=false + dst = audio.sink (sample_rate, options.audio_output) + head= gr.head(gr.sizeof_float, nsamples) + + self.connect (src0,test,head,(dst, 0)) + + +if __name__ == '__main__': + + seconds=5.0 + output_multiple=1 + for history in (1,1000,8000,8100,8150,8175,8190,8191,8192,8193,8194,8195,9000,10000,100000,1000000,10000000): #,100000000): + sys.stdout.flush() + sys.stderr.flush() + print 'Test with history=', history, 'output_multiple=',output_multiple + sys.stdout.flush() + sys.stderr.flush() + succeed=True + starttime=time.time() + try: + my_graph(seconds,history,output_multiple).run() + except KeyboardInterrupt: + pass + except: + print "\nAn exception has terminated the graph." + exception=True + succeed=False + sys.stdout.flush() + sys.stderr.flush() + if succeed: + print '' + endtime=time.time() + duration=endtime - starttime + if (duration < 0.5*seconds) and (succeed): + print "A problem has terminated the graph." + succeed=False + if (duration > 1.5*seconds) and (succeed): + print "Something slowed the graph down considerably." + succeed=False + + print 'The test result was:' , succeed + print 'Test duration' , duration + print '' diff --git a/gnuradio-core/src/tests/test_filter.cc b/gnuradio-core/src/tests/test_filter.cc new file mode 100644 index 000000000..1b2c57be1 --- /dev/null +++ b/gnuradio-core/src/tests/test_filter.cc @@ -0,0 +1,37 @@ +/* -*- c++ -*- */ +/* + * Copyright 2002 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 2, 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include + +int +main (int argc, char **argv) +{ + + CppUnit::TextTestRunner runner; + + runner.addTest (qa_filter::suite ()); + + bool was_successful = runner.run ("", false); + + return was_successful ? 0 : 1; +} diff --git a/gnuradio-core/src/tests/test_general.cc b/gnuradio-core/src/tests/test_general.cc new file mode 100644 index 000000000..9f93b9d70 --- /dev/null +++ b/gnuradio-core/src/tests/test_general.cc @@ -0,0 +1,37 @@ +/* -*- c++ -*- */ +/* + * Copyright 2002 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 2, 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include + +int +main (int argc, char **argv) +{ + + CppUnit::TextTestRunner runner; + + runner.addTest (qa_general::suite ()); + + bool was_successful = runner.run ("", false); + + return was_successful ? 0 : 1; +} diff --git a/gnuradio-core/src/tests/test_runtime.cc b/gnuradio-core/src/tests/test_runtime.cc new file mode 100644 index 000000000..72290a9be --- /dev/null +++ b/gnuradio-core/src/tests/test_runtime.cc @@ -0,0 +1,37 @@ +/* -*- c++ -*- */ +/* + * Copyright 2002 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 2, 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include + +int +main (int argc, char **argv) +{ + + CppUnit::TextTestRunner runner; + + runner.addTest (qa_runtime::suite ()); + + bool was_successful = runner.run ("", false); + + return was_successful ? 0 : 1; +} diff --git a/gnuradio-core/src/tests/test_vmcircbuf.cc b/gnuradio-core/src/tests/test_vmcircbuf.cc new file mode 100644 index 000000000..e00b1706a --- /dev/null +++ b/gnuradio-core/src/tests/test_vmcircbuf.cc @@ -0,0 +1,44 @@ +/* -*- c++ -*- */ +/* + * Copyright 2003 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 2, 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include + +int +main (int argc, char **argv) +{ + int verbose = 1; // summary + + if (argc > 1) + verbose = 2; // extra chatty + + bool ok = gr_vmcircbuf_sysconfig::test_all_factories (verbose); + + if (ok){ + fprintf (stdout, "test_vmcircbuf: OK. We've got at least one workable solution\n"); + return 0; + } + else { + fprintf (stdout, "test_vmcircbuf: NOT OK. We don't have a workable solution\n"); + return 1; + } +} -- cgit From 86f5c92427b3f4bb30536d76cf63c3fca388fb2f Mon Sep 17 00:00:00 2001 From: eb Date: Wed, 13 Sep 2006 21:30:04 +0000 Subject: Updated FSF address in all files. Fixes ticket:51 git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3534 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/tests/Makefile.am | 4 ++-- gnuradio-core/src/tests/benchmark_dotprod.cc | 4 ++-- gnuradio-core/src/tests/benchmark_dotprod_ccc.cc | 4 ++-- gnuradio-core/src/tests/benchmark_dotprod_ccf.cc | 4 ++-- gnuradio-core/src/tests/benchmark_dotprod_fcc.cc | 4 ++-- gnuradio-core/src/tests/benchmark_dotprod_fsf.cc | 4 ++-- gnuradio-core/src/tests/benchmark_dotprod_scc.cc | 4 ++-- gnuradio-core/src/tests/benchmark_nco.cc | 4 ++-- gnuradio-core/src/tests/benchmark_vco.cc | 4 ++-- gnuradio-core/src/tests/test_all.cc | 4 ++-- gnuradio-core/src/tests/test_atsc.cc | 4 ++-- gnuradio-core/src/tests/test_buffers.py | 4 ++-- gnuradio-core/src/tests/test_filter.cc | 4 ++-- gnuradio-core/src/tests/test_general.cc | 4 ++-- gnuradio-core/src/tests/test_runtime.cc | 4 ++-- gnuradio-core/src/tests/test_vmcircbuf.cc | 4 ++-- 16 files changed, 32 insertions(+), 32 deletions(-) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/Makefile.am b/gnuradio-core/src/tests/Makefile.am index 1dd3dd061..f347c1874 100644 --- a/gnuradio-core/src/tests/Makefile.am +++ b/gnuradio-core/src/tests/Makefile.am @@ -15,8 +15,8 @@ # # 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., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. # include $(top_srcdir)/Makefile.common diff --git a/gnuradio-core/src/tests/benchmark_dotprod.cc b/gnuradio-core/src/tests/benchmark_dotprod.cc index 8986f7255..344821c56 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod.cc @@ -16,8 +16,8 @@ * * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc b/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc index afc24e071..a9971a42a 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc @@ -16,8 +16,8 @@ * * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc b/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc index 866f7f61a..857263172 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc @@ -16,8 +16,8 @@ * * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/gnuradio-core/src/tests/benchmark_dotprod_fcc.cc b/gnuradio-core/src/tests/benchmark_dotprod_fcc.cc index af54707b8..5325b5820 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod_fcc.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod_fcc.cc @@ -16,8 +16,8 @@ * * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/gnuradio-core/src/tests/benchmark_dotprod_fsf.cc b/gnuradio-core/src/tests/benchmark_dotprod_fsf.cc index 7317e8398..b49c33ed6 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod_fsf.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod_fsf.cc @@ -16,8 +16,8 @@ * * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/gnuradio-core/src/tests/benchmark_dotprod_scc.cc b/gnuradio-core/src/tests/benchmark_dotprod_scc.cc index d67fad556..9b97d3fe6 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod_scc.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod_scc.cc @@ -16,8 +16,8 @@ * * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/gnuradio-core/src/tests/benchmark_nco.cc b/gnuradio-core/src/tests/benchmark_nco.cc index fb0fe687b..1c787f3cb 100644 --- a/gnuradio-core/src/tests/benchmark_nco.cc +++ b/gnuradio-core/src/tests/benchmark_nco.cc @@ -16,8 +16,8 @@ * * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/gnuradio-core/src/tests/benchmark_vco.cc b/gnuradio-core/src/tests/benchmark_vco.cc index 1b290dfa5..c318d43db 100644 --- a/gnuradio-core/src/tests/benchmark_vco.cc +++ b/gnuradio-core/src/tests/benchmark_vco.cc @@ -16,8 +16,8 @@ * * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/gnuradio-core/src/tests/test_all.cc b/gnuradio-core/src/tests/test_all.cc index b5e1b4612..10be6863e 100644 --- a/gnuradio-core/src/tests/test_all.cc +++ b/gnuradio-core/src/tests/test_all.cc @@ -16,8 +16,8 @@ * * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #include diff --git a/gnuradio-core/src/tests/test_atsc.cc b/gnuradio-core/src/tests/test_atsc.cc index cca96d558..dbca10081 100644 --- a/gnuradio-core/src/tests/test_atsc.cc +++ b/gnuradio-core/src/tests/test_atsc.cc @@ -16,8 +16,8 @@ * * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #include diff --git a/gnuradio-core/src/tests/test_buffers.py b/gnuradio-core/src/tests/test_buffers.py index b3211329b..9d642263a 100755 --- a/gnuradio-core/src/tests/test_buffers.py +++ b/gnuradio-core/src/tests/test_buffers.py @@ -16,8 +16,8 @@ # # 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., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. # from gnuradio import gr, gru diff --git a/gnuradio-core/src/tests/test_filter.cc b/gnuradio-core/src/tests/test_filter.cc index 1b2c57be1..6fc0eb4be 100644 --- a/gnuradio-core/src/tests/test_filter.cc +++ b/gnuradio-core/src/tests/test_filter.cc @@ -16,8 +16,8 @@ * * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #include diff --git a/gnuradio-core/src/tests/test_general.cc b/gnuradio-core/src/tests/test_general.cc index 9f93b9d70..1dc4df647 100644 --- a/gnuradio-core/src/tests/test_general.cc +++ b/gnuradio-core/src/tests/test_general.cc @@ -16,8 +16,8 @@ * * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #include diff --git a/gnuradio-core/src/tests/test_runtime.cc b/gnuradio-core/src/tests/test_runtime.cc index 72290a9be..77c053ef2 100644 --- a/gnuradio-core/src/tests/test_runtime.cc +++ b/gnuradio-core/src/tests/test_runtime.cc @@ -16,8 +16,8 @@ * * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #include diff --git a/gnuradio-core/src/tests/test_vmcircbuf.cc b/gnuradio-core/src/tests/test_vmcircbuf.cc index e00b1706a..67c34d871 100644 --- a/gnuradio-core/src/tests/test_vmcircbuf.cc +++ b/gnuradio-core/src/tests/test_vmcircbuf.cc @@ -16,8 +16,8 @@ * * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #include -- cgit From 63d05d64826fd1b3eef89e5a8a14a73b318464ac Mon Sep 17 00:00:00 2001 From: jcorgan Date: Mon, 26 Feb 2007 21:26:10 +0000 Subject: Merged r4632:4645 on jcorgan/linking into trunk. Cleans up linking issues with libtool and already installed libraries. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@4646 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/tests/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/Makefile.am b/gnuradio-core/src/tests/Makefile.am index f347c1874..aed3fea9a 100644 --- a/gnuradio-core/src/tests/Makefile.am +++ b/gnuradio-core/src/tests/Makefile.am @@ -33,7 +33,7 @@ TESTS = test_all #Test program to test setting up buffers using gr_test which can be run manually EXTRA_DIST = \ test_buffers.py - + noinst_PROGRAMS = \ benchmark_dotprod \ benchmark_dotprod_fsf \ @@ -50,7 +50,7 @@ noinst_PROGRAMS = \ test_vmcircbuf -LIBGNURADIO = $(top_builddir)/gnuradio-core/src/lib/libgnuradio-core.la +LIBGNURADIO = $(GNURADIO_CORE_LA) LIBGNURADIOQA = $(top_builddir)/gnuradio-core/src/lib/libgnuradio-core-qa.la $(LIBGNURADIO) benchmark_dotprod_SOURCES = benchmark_dotprod.cc -- cgit From 937b719d2e57d0497293d603da10cac2532346f6 Mon Sep 17 00:00:00 2001 From: eb Date: Sat, 21 Jul 2007 03:44:38 +0000 Subject: Updated license from GPL version 2 or later to GPL version 3 or later. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6044 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/tests/Makefile.am | 2 +- gnuradio-core/src/tests/benchmark_dotprod.cc | 2 +- gnuradio-core/src/tests/benchmark_dotprod_ccc.cc | 2 +- gnuradio-core/src/tests/benchmark_dotprod_ccf.cc | 2 +- gnuradio-core/src/tests/benchmark_dotprod_fcc.cc | 2 +- gnuradio-core/src/tests/benchmark_dotprod_fsf.cc | 2 +- gnuradio-core/src/tests/benchmark_dotprod_scc.cc | 2 +- gnuradio-core/src/tests/benchmark_nco.cc | 2 +- gnuradio-core/src/tests/benchmark_vco.cc | 2 +- gnuradio-core/src/tests/test_all.cc | 2 +- gnuradio-core/src/tests/test_atsc.cc | 2 +- gnuradio-core/src/tests/test_buffers.py | 2 +- gnuradio-core/src/tests/test_filter.cc | 2 +- gnuradio-core/src/tests/test_general.cc | 2 +- gnuradio-core/src/tests/test_runtime.cc | 2 +- gnuradio-core/src/tests/test_vmcircbuf.cc | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/Makefile.am b/gnuradio-core/src/tests/Makefile.am index aed3fea9a..e120ae3f9 100644 --- a/gnuradio-core/src/tests/Makefile.am +++ b/gnuradio-core/src/tests/Makefile.am @@ -5,7 +5,7 @@ # # 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 2, or (at your option) +# 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, diff --git a/gnuradio-core/src/tests/benchmark_dotprod.cc b/gnuradio-core/src/tests/benchmark_dotprod.cc index 344821c56..56e064506 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod.cc @@ -6,7 +6,7 @@ * * 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 2, or (at your option) + * 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, diff --git a/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc b/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc index a9971a42a..5d53a9f89 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc @@ -6,7 +6,7 @@ * * 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 2, or (at your option) + * 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, diff --git a/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc b/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc index 857263172..60855ec94 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc @@ -6,7 +6,7 @@ * * 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 2, or (at your option) + * 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, diff --git a/gnuradio-core/src/tests/benchmark_dotprod_fcc.cc b/gnuradio-core/src/tests/benchmark_dotprod_fcc.cc index 5325b5820..8363a03b3 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod_fcc.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod_fcc.cc @@ -6,7 +6,7 @@ * * 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 2, or (at your option) + * 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, diff --git a/gnuradio-core/src/tests/benchmark_dotprod_fsf.cc b/gnuradio-core/src/tests/benchmark_dotprod_fsf.cc index b49c33ed6..a254a8eab 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod_fsf.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod_fsf.cc @@ -6,7 +6,7 @@ * * 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 2, or (at your option) + * 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, diff --git a/gnuradio-core/src/tests/benchmark_dotprod_scc.cc b/gnuradio-core/src/tests/benchmark_dotprod_scc.cc index 9b97d3fe6..49bbfe5bf 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod_scc.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod_scc.cc @@ -6,7 +6,7 @@ * * 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 2, or (at your option) + * 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, diff --git a/gnuradio-core/src/tests/benchmark_nco.cc b/gnuradio-core/src/tests/benchmark_nco.cc index 1c787f3cb..961442fc9 100644 --- a/gnuradio-core/src/tests/benchmark_nco.cc +++ b/gnuradio-core/src/tests/benchmark_nco.cc @@ -6,7 +6,7 @@ * * 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 2, or (at your option) + * 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, diff --git a/gnuradio-core/src/tests/benchmark_vco.cc b/gnuradio-core/src/tests/benchmark_vco.cc index c318d43db..5b39bf15e 100644 --- a/gnuradio-core/src/tests/benchmark_vco.cc +++ b/gnuradio-core/src/tests/benchmark_vco.cc @@ -6,7 +6,7 @@ * * 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 2, or (at your option) + * 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, diff --git a/gnuradio-core/src/tests/test_all.cc b/gnuradio-core/src/tests/test_all.cc index 10be6863e..6dc1a26f8 100644 --- a/gnuradio-core/src/tests/test_all.cc +++ b/gnuradio-core/src/tests/test_all.cc @@ -6,7 +6,7 @@ * * 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 2, or (at your option) + * 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, diff --git a/gnuradio-core/src/tests/test_atsc.cc b/gnuradio-core/src/tests/test_atsc.cc index dbca10081..f744d76e6 100644 --- a/gnuradio-core/src/tests/test_atsc.cc +++ b/gnuradio-core/src/tests/test_atsc.cc @@ -6,7 +6,7 @@ * * 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 2, or (at your option) + * 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, diff --git a/gnuradio-core/src/tests/test_buffers.py b/gnuradio-core/src/tests/test_buffers.py index 9d642263a..49250ad98 100755 --- a/gnuradio-core/src/tests/test_buffers.py +++ b/gnuradio-core/src/tests/test_buffers.py @@ -6,7 +6,7 @@ # # 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 2, or (at your option) +# 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, diff --git a/gnuradio-core/src/tests/test_filter.cc b/gnuradio-core/src/tests/test_filter.cc index 6fc0eb4be..56e945238 100644 --- a/gnuradio-core/src/tests/test_filter.cc +++ b/gnuradio-core/src/tests/test_filter.cc @@ -6,7 +6,7 @@ * * 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 2, or (at your option) + * 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, diff --git a/gnuradio-core/src/tests/test_general.cc b/gnuradio-core/src/tests/test_general.cc index 1dc4df647..063e2ee45 100644 --- a/gnuradio-core/src/tests/test_general.cc +++ b/gnuradio-core/src/tests/test_general.cc @@ -6,7 +6,7 @@ * * 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 2, or (at your option) + * 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, diff --git a/gnuradio-core/src/tests/test_runtime.cc b/gnuradio-core/src/tests/test_runtime.cc index 77c053ef2..8549f2a9b 100644 --- a/gnuradio-core/src/tests/test_runtime.cc +++ b/gnuradio-core/src/tests/test_runtime.cc @@ -6,7 +6,7 @@ * * 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 2, or (at your option) + * 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, diff --git a/gnuradio-core/src/tests/test_vmcircbuf.cc b/gnuradio-core/src/tests/test_vmcircbuf.cc index 67c34d871..5145b17c4 100644 --- a/gnuradio-core/src/tests/test_vmcircbuf.cc +++ b/gnuradio-core/src/tests/test_vmcircbuf.cc @@ -6,7 +6,7 @@ * * 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 2, or (at your option) + * 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, -- cgit From 05005e3d3fad3c9baee9906714510b5d12e0fa6f Mon Sep 17 00:00:00 2001 From: eb Date: Fri, 8 Feb 2008 04:36:24 +0000 Subject: Removed gr.flow_graph, gr.hier_block and friends. From here on out all work on the trunk must use gr.top_block and gr.hier_block2. Merged eb/fg-no-more -r7602:7606 into trunk. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@7607 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/tests/test_buffers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/test_buffers.py b/gnuradio-core/src/tests/test_buffers.py index 49250ad98..186a60bb9 100755 --- a/gnuradio-core/src/tests/test_buffers.py +++ b/gnuradio-core/src/tests/test_buffers.py @@ -43,10 +43,10 @@ import sys #$ cat /proc/sys/kernel/shmmax #300000000 -class my_graph(gr.flow_graph): +class my_graph(gr.top_block): def __init__(self, seconds,history,output_multiple): - gr.flow_graph.__init__(self) + gr.top_block.__init__(self) parser = OptionParser(option_class=eng_option) parser.add_option("-O", "--audio-output", type="string", default="", -- cgit From 42d9c6f495503d3d9d2db47a9979036c9233f976 Mon Sep 17 00:00:00 2001 From: jcorgan Date: Fri, 8 Feb 2008 23:32:10 +0000 Subject: Merged r7478:7608 from michaelld/t186 into trunk. Adds ability to compile GNU Radio modules individually, using already installed dependent libraries and include files. New functionality is enabled using --with-* on configure command line; existing build options should remain unchanged. Nice work by Michael Dickens, still needs documentation update on wiki. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@7617 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/tests/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/Makefile.am b/gnuradio-core/src/tests/Makefile.am index e120ae3f9..b3bd86883 100644 --- a/gnuradio-core/src/tests/Makefile.am +++ b/gnuradio-core/src/tests/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2001 Free Software Foundation, Inc. +# Copyright 2001,2008 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,7 +21,7 @@ include $(top_srcdir)/Makefile.common -INCLUDES = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) +INCLUDES = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) $(WITH_INCLUDES) # list of programs run by "make check" and "make distcheck" -- cgit From 776da31eb84e146a8adf1e3ca7e017c1d9992ce3 Mon Sep 17 00:00:00 2001 From: michaelld Date: Thu, 21 Feb 2008 19:16:45 +0000 Subject: Merged build_config branch into trunk: 1) Modified top-level run_tests.sh script: a) to execute code for setting or changing the library search path in Darwin (DYLD_LIBRARY_PATH) or Windows (PATH) on those host OSs only, not on other host OSs. b) Added local (to the component making check) library paths to those same search paths, since libtool doesn't do it (unlike in Linux). 2) In all AM Makefiles -except those dealing with USRP firmware-, changes INCLUDES to AM_CPPFLAGS since the former is deprecated. 3) Changed AM_CPPFLAGS to FW_INCLUDES for commands .c.rel in USRP firmware. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@7769 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/tests/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/Makefile.am b/gnuradio-core/src/tests/Makefile.am index b3bd86883..01e35120f 100644 --- a/gnuradio-core/src/tests/Makefile.am +++ b/gnuradio-core/src/tests/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/Makefile.common -INCLUDES = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) $(WITH_INCLUDES) +AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) $(WITH_INCLUDES) # list of programs run by "make check" and "make distcheck" -- cgit From 38ea3a576a20820e574c6cb37607aeafe07f34b4 Mon Sep 17 00:00:00 2001 From: eb Date: Wed, 30 Apr 2008 02:24:06 +0000 Subject: Tweaks for gcc 4.3 based on patch from Marek Mahut . git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@8292 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/tests/benchmark_nco.cc | 1 + gnuradio-core/src/tests/benchmark_vco.cc | 1 + 2 files changed, 2 insertions(+) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/benchmark_nco.cc b/gnuradio-core/src/tests/benchmark_nco.cc index 961442fc9..9c4eff346 100644 --- a/gnuradio-core/src/tests/benchmark_nco.cc +++ b/gnuradio-core/src/tests/benchmark_nco.cc @@ -30,6 +30,7 @@ #include #include #include +#include #define ITERATIONS 20000000 #define BLOCK_SIZE (10 * 1000) // fits in cache diff --git a/gnuradio-core/src/tests/benchmark_vco.cc b/gnuradio-core/src/tests/benchmark_vco.cc index 5b39bf15e..ed0ae3b67 100644 --- a/gnuradio-core/src/tests/benchmark_vco.cc +++ b/gnuradio-core/src/tests/benchmark_vco.cc @@ -30,6 +30,7 @@ #include #include #include +#include #define ITERATIONS 5000000 #define BLOCK_SIZE (10 * 1000) // fits in cache -- cgit From fd2bf069496e39e6be2df18f37e4fec89e09a6a8 Mon Sep 17 00:00:00 2001 From: eb Date: Mon, 23 Jun 2008 19:42:13 +0000 Subject: Renamed benchmark_dotprod to benchmark_dotprod_fff (which it really was). Added new script, benchmark_dotprod, which runs all dotprods. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@8674 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/tests/Makefile.am | 10 +- gnuradio-core/src/tests/benchmark_dotprod | 46 +++++++ gnuradio-core/src/tests/benchmark_dotprod.cc | 148 ----------------------- gnuradio-core/src/tests/benchmark_dotprod_fff.cc | 148 +++++++++++++++++++++++ 4 files changed, 201 insertions(+), 151 deletions(-) create mode 100755 gnuradio-core/src/tests/benchmark_dotprod delete mode 100644 gnuradio-core/src/tests/benchmark_dotprod.cc create mode 100644 gnuradio-core/src/tests/benchmark_dotprod_fff.cc (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/Makefile.am b/gnuradio-core/src/tests/Makefile.am index 01e35120f..d846613f9 100644 --- a/gnuradio-core/src/tests/Makefile.am +++ b/gnuradio-core/src/tests/Makefile.am @@ -35,7 +35,7 @@ EXTRA_DIST = \ test_buffers.py noinst_PROGRAMS = \ - benchmark_dotprod \ + benchmark_dotprod_fff \ benchmark_dotprod_fsf \ benchmark_dotprod_fcc \ benchmark_dotprod_scc \ @@ -50,11 +50,15 @@ noinst_PROGRAMS = \ test_vmcircbuf +noinst_SCRIPTS = \ + benchmark_dotprod + + LIBGNURADIO = $(GNURADIO_CORE_LA) LIBGNURADIOQA = $(top_builddir)/gnuradio-core/src/lib/libgnuradio-core-qa.la $(LIBGNURADIO) -benchmark_dotprod_SOURCES = benchmark_dotprod.cc -benchmark_dotprod_LDADD = $(LIBGNURADIO) +benchmark_dotprod_fff_SOURCES = benchmark_dotprod_fff.cc +benchmark_dotprod_fff_LDADD = $(LIBGNURADIO) benchmark_dotprod_fsf_SOURCES = benchmark_dotprod_fsf.cc benchmark_dotprod_fsf_LDADD = $(LIBGNURADIO) diff --git a/gnuradio-core/src/tests/benchmark_dotprod b/gnuradio-core/src/tests/benchmark_dotprod new file mode 100755 index 000000000..69489e465 --- /dev/null +++ b/gnuradio-core/src/tests/benchmark_dotprod @@ -0,0 +1,46 @@ +#!/bin/sh +# +# 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. +# + +DIR=. + +tests=" +benchmark_dotprod_fff +benchmark_dotprod_ccf +benchmark_dotprod_ccc +benchmark_dotprod_fcc +benchmark_dotprod_scc +benchmark_dotprod_fsf +" + +echo "uname -a" +uname -a + +if test -e /proc/cpuinfo +then + cat /proc/cpuinfo +fi + +for t in $tests +do + echo + echo "$t": + $DIR/$t +done diff --git a/gnuradio-core/src/tests/benchmark_dotprod.cc b/gnuradio-core/src/tests/benchmark_dotprod.cc deleted file mode 100644 index 56e064506..000000000 --- a/gnuradio-core/src/tests/benchmark_dotprod.cc +++ /dev/null @@ -1,148 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 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. - */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include -#include -#ifdef HAVE_SYS_RESOURCE_H -#include -#endif - -#include -#include -#include -#include - -#define TOTAL_TEST_SIZE (40 * 1000 * 1000L) -#define NTAPS 256 -#define BLOCK_SIZE (50 * 1000) /* fits in cache */ - -#if ((TOTAL_TEST_SIZE % BLOCK_SIZE) != 0) -#error "TOTAL_TEST_SIZE % BLOCK_SIZE must equal 0" -#endif - -typedef gr_fir_fff* (*fir_maker_t)(const std::vector &taps); -typedef gr_fir_fff filter_t; - - -static double -timeval_to_double (const struct timeval *tv) -{ - return (double) tv->tv_sec + (double) tv->tv_usec * 1e-6; -} - - -static void -benchmark (fir_maker_t filter_maker, const char *implementation_name) -{ - int i; - float coeffs[NTAPS]; - float input[BLOCK_SIZE + NTAPS]; - long n; - float result; -#ifdef HAVE_SYS_RESOURCE_H - struct rusage rusage_start; - struct rusage rusage_stop; -#else - double clock_start; - double clock_end; -#endif - // setup coefficients and input data - - for (i = 0; i < NTAPS; i++) - coeffs[i] = random() - RANDOM_MAX/2; - - for (i = 0; i < BLOCK_SIZE + NTAPS; i++) - input[i] = random() - RANDOM_MAX/2; - - std::vector taps (&coeffs[0], &coeffs[NTAPS]); - filter_t *f = filter_maker (taps); - - // get starting CPU usage -#ifdef HAVE_SYS_RESOURCE_H - if (getrusage (RUSAGE_SELF, &rusage_start) < 0){ - perror ("getrusage"); - exit (1); - } -#else - clock_start = (double) clock() * (1000000. / CLOCKS_PER_SEC); -#endif - // do the actual work - - for (n = 0; n < TOTAL_TEST_SIZE; n += BLOCK_SIZE){ - int j; - for (j = 0; j < BLOCK_SIZE; j++){ - result = f->filter (&input[j]); - } - } - - // get ending CPU usage -#ifdef HAVE_SYS_RESOURCE_H - if (getrusage (RUSAGE_SELF, &rusage_stop) < 0){ - perror ("getrusage"); - exit (1); - } - - // compute results - - double user = - timeval_to_double (&rusage_stop.ru_utime) - - timeval_to_double (&rusage_start.ru_utime); - - double sys = - timeval_to_double (&rusage_stop.ru_stime) - - timeval_to_double (&rusage_start.ru_stime); - - double total = user + sys; -#else - clock_end = (double) clock () * (1000000. / CLOCKS_PER_SEC); - double total = clock_end -clock_start; -#endif - double macs = NTAPS * (double) TOTAL_TEST_SIZE; - - printf ("%10s: taps: %4d input: %4g cpu: %6.3f taps/sec: %10.4g \n", - implementation_name, NTAPS, (double) TOTAL_TEST_SIZE, total, macs / total); - - delete f; -} - -static void -do_all () -{ - std::vector info; - gr_fir_util::get_gr_fir_fff_info (&info); // get all known FFF implementations - - for (std::vector::iterator p = info.begin (); - p != info.end (); - ++p){ - - benchmark (p->create, p->name); - } -} - -int -main (int argc, char **argv) -{ - do_all (); - return 0; -} diff --git a/gnuradio-core/src/tests/benchmark_dotprod_fff.cc b/gnuradio-core/src/tests/benchmark_dotprod_fff.cc new file mode 100644 index 000000000..56e064506 --- /dev/null +++ b/gnuradio-core/src/tests/benchmark_dotprod_fff.cc @@ -0,0 +1,148 @@ +/* -*- c++ -*- */ +/* + * Copyright 2002 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. + */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include +#include +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif + +#include +#include +#include +#include + +#define TOTAL_TEST_SIZE (40 * 1000 * 1000L) +#define NTAPS 256 +#define BLOCK_SIZE (50 * 1000) /* fits in cache */ + +#if ((TOTAL_TEST_SIZE % BLOCK_SIZE) != 0) +#error "TOTAL_TEST_SIZE % BLOCK_SIZE must equal 0" +#endif + +typedef gr_fir_fff* (*fir_maker_t)(const std::vector &taps); +typedef gr_fir_fff filter_t; + + +static double +timeval_to_double (const struct timeval *tv) +{ + return (double) tv->tv_sec + (double) tv->tv_usec * 1e-6; +} + + +static void +benchmark (fir_maker_t filter_maker, const char *implementation_name) +{ + int i; + float coeffs[NTAPS]; + float input[BLOCK_SIZE + NTAPS]; + long n; + float result; +#ifdef HAVE_SYS_RESOURCE_H + struct rusage rusage_start; + struct rusage rusage_stop; +#else + double clock_start; + double clock_end; +#endif + // setup coefficients and input data + + for (i = 0; i < NTAPS; i++) + coeffs[i] = random() - RANDOM_MAX/2; + + for (i = 0; i < BLOCK_SIZE + NTAPS; i++) + input[i] = random() - RANDOM_MAX/2; + + std::vector taps (&coeffs[0], &coeffs[NTAPS]); + filter_t *f = filter_maker (taps); + + // get starting CPU usage +#ifdef HAVE_SYS_RESOURCE_H + if (getrusage (RUSAGE_SELF, &rusage_start) < 0){ + perror ("getrusage"); + exit (1); + } +#else + clock_start = (double) clock() * (1000000. / CLOCKS_PER_SEC); +#endif + // do the actual work + + for (n = 0; n < TOTAL_TEST_SIZE; n += BLOCK_SIZE){ + int j; + for (j = 0; j < BLOCK_SIZE; j++){ + result = f->filter (&input[j]); + } + } + + // get ending CPU usage +#ifdef HAVE_SYS_RESOURCE_H + if (getrusage (RUSAGE_SELF, &rusage_stop) < 0){ + perror ("getrusage"); + exit (1); + } + + // compute results + + double user = + timeval_to_double (&rusage_stop.ru_utime) + - timeval_to_double (&rusage_start.ru_utime); + + double sys = + timeval_to_double (&rusage_stop.ru_stime) + - timeval_to_double (&rusage_start.ru_stime); + + double total = user + sys; +#else + clock_end = (double) clock () * (1000000. / CLOCKS_PER_SEC); + double total = clock_end -clock_start; +#endif + double macs = NTAPS * (double) TOTAL_TEST_SIZE; + + printf ("%10s: taps: %4d input: %4g cpu: %6.3f taps/sec: %10.4g \n", + implementation_name, NTAPS, (double) TOTAL_TEST_SIZE, total, macs / total); + + delete f; +} + +static void +do_all () +{ + std::vector info; + gr_fir_util::get_gr_fir_fff_info (&info); // get all known FFF implementations + + for (std::vector::iterator p = info.begin (); + p != info.end (); + ++p){ + + benchmark (p->create, p->name); + } +} + +int +main (int argc, char **argv) +{ + do_all (); + return 0; +} -- cgit From a43f1cfbf40e234ed30659db3943eb9e0c1a7e94 Mon Sep 17 00:00:00 2001 From: eb Date: Wed, 25 Jun 2008 21:24:03 +0000 Subject: distcheck fix git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@8708 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/tests/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/Makefile.am b/gnuradio-core/src/tests/Makefile.am index d846613f9..730de2d19 100644 --- a/gnuradio-core/src/tests/Makefile.am +++ b/gnuradio-core/src/tests/Makefile.am @@ -32,7 +32,9 @@ TESTS = test_all #Test program to test setting up buffers using gr_test which can be run manually EXTRA_DIST = \ - test_buffers.py + test_buffers.py \ + benchmark_dotprod + noinst_PROGRAMS = \ benchmark_dotprod_fff \ -- cgit From 2c8ea58e4d76f54c98d71d3fcc64bc29da490908 Mon Sep 17 00:00:00 2001 From: eb Date: Tue, 19 Aug 2008 23:09:56 +0000 Subject: Merged features/mp-sched -r8915:9335 into the trunk. The trunk now contains the SMP aware scheduler. This changeset introduces a dependency on boost 1.35 or later. See source:gnuradio/trunk/README.building-boost for additional info. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9336 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/tests/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/Makefile.am b/gnuradio-core/src/tests/Makefile.am index 730de2d19..c6225d972 100644 --- a/gnuradio-core/src/tests/Makefile.am +++ b/gnuradio-core/src/tests/Makefile.am @@ -47,10 +47,12 @@ noinst_PROGRAMS = \ benchmark_vco \ test_runtime \ test_general \ - test_all \ test_filter \ test_vmcircbuf +bin_PROGRAMS = \ + test_all + noinst_SCRIPTS = \ benchmark_dotprod -- cgit From 954595c9a7608ae853cd2e4d73db2174ef597490 Mon Sep 17 00:00:00 2001 From: eb Date: Thu, 2 Oct 2008 04:38:37 +0000 Subject: stop installing test_all git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9698 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/tests/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/Makefile.am b/gnuradio-core/src/tests/Makefile.am index c6225d972..2bf7cb4e5 100644 --- a/gnuradio-core/src/tests/Makefile.am +++ b/gnuradio-core/src/tests/Makefile.am @@ -45,13 +45,14 @@ noinst_PROGRAMS = \ benchmark_dotprod_ccf \ benchmark_nco \ benchmark_vco \ + test_all \ test_runtime \ test_general \ test_filter \ test_vmcircbuf -bin_PROGRAMS = \ - test_all +#bin_PROGRAMS = \ +# test_all noinst_SCRIPTS = \ -- cgit From 253018c6cdb114f5662a2d7ba8ed748c6e68e3a7 Mon Sep 17 00:00:00 2001 From: git Date: Fri, 14 Aug 2009 18:10:11 +0000 Subject: Added git ignore files auto created from svn:ignore properties. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@11592 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/tests/.gitignore | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 gnuradio-core/src/tests/.gitignore (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/.gitignore b/gnuradio-core/src/tests/.gitignore new file mode 100644 index 000000000..8687003d4 --- /dev/null +++ b/gnuradio-core/src/tests/.gitignore @@ -0,0 +1,28 @@ +/Makefile +/Makefile.in +/.la +/.lo +/.deps +/.libs +/*.la +/*.lo +/t1 +/test_dtv +/check_dups +/test_gr +/test_all +/exercise_correlator +/test_grbase +/test_vmcircbuf +/test_atsc +/test_general +/test_runtime +/test_filter +/benchmark_dotprod_fff +/benchmark_dotprod_ccc +/benchmark_dotprod_fcc +/benchmark_dotprod_scc +/benchmark_nco +/benchmark_dotprod_ccf +/benchmark_dotprod_fsf +/benchmark_vco -- cgit From 036a42c08eadbd0a2c462ca61d9d883996be8042 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Thu, 30 Sep 2010 16:08:53 -0400 Subject: Adding an XML outputter for the CPP Unit tests. This is to a) store the output information but also b) for integration with Hudson for logging and displaying the results during the build stages. This only covers a few cases so far and I need to define a better place to save the output files. --- gnuradio-core/src/tests/test_all.cc | 6 +++++- gnuradio-core/src/tests/test_filter.cc | 6 +++++- gnuradio-core/src/tests/test_general.cc | 10 +++++++--- gnuradio-core/src/tests/test_runtime.cc | 6 +++++- 4 files changed, 22 insertions(+), 6 deletions(-) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/test_all.cc b/gnuradio-core/src/tests/test_all.cc index 6dc1a26f8..35bc0a049 100644 --- a/gnuradio-core/src/tests/test_all.cc +++ b/gnuradio-core/src/tests/test_all.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2002 Free Software Foundation, Inc. + * Copyright 2002,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -21,6 +21,7 @@ */ #include +#include #include #include @@ -34,11 +35,14 @@ main (int argc, char **argv) { CppUnit::TextTestRunner runner; + std::ofstream xmlfile("cppunit_test_all.xml"); + CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); runner.addTest (qa_runtime::suite ()); runner.addTest (qa_general::suite ()); runner.addTest (qa_filter::suite ()); // runner.addTest (qa_atsc::suite ()); + runner.setOutputter(xmlout); bool was_successful = runner.run ("", false); diff --git a/gnuradio-core/src/tests/test_filter.cc b/gnuradio-core/src/tests/test_filter.cc index 56e945238..1e67b7180 100644 --- a/gnuradio-core/src/tests/test_filter.cc +++ b/gnuradio-core/src/tests/test_filter.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2002 Free Software Foundation, Inc. + * Copyright 2002,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -21,6 +21,7 @@ */ #include +#include #include int @@ -28,8 +29,11 @@ main (int argc, char **argv) { CppUnit::TextTestRunner runner; + std::ofstream xmlfile("cppunit_test_filter.xml"); + CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); runner.addTest (qa_filter::suite ()); + runner.setOutputter(xmlout); bool was_successful = runner.run ("", false); diff --git a/gnuradio-core/src/tests/test_general.cc b/gnuradio-core/src/tests/test_general.cc index 063e2ee45..bc89c0b6b 100644 --- a/gnuradio-core/src/tests/test_general.cc +++ b/gnuradio-core/src/tests/test_general.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2002 Free Software Foundation, Inc. + * Copyright 2002,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -21,15 +21,19 @@ */ #include +#include #include int main (int argc, char **argv) { - - CppUnit::TextTestRunner runner; + CppUnit::TextTestRunner runner; + + std::ofstream xmlfile("cppunit_test_general.xml"); + CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); runner.addTest (qa_general::suite ()); + runner.setOutputter(xmlout); bool was_successful = runner.run ("", false); diff --git a/gnuradio-core/src/tests/test_runtime.cc b/gnuradio-core/src/tests/test_runtime.cc index 8549f2a9b..1efd9a0c0 100644 --- a/gnuradio-core/src/tests/test_runtime.cc +++ b/gnuradio-core/src/tests/test_runtime.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2002 Free Software Foundation, Inc. + * Copyright 2002,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -21,6 +21,7 @@ */ #include +#include #include int @@ -28,8 +29,11 @@ main (int argc, char **argv) { CppUnit::TextTestRunner runner; + std::ofstream xmlfile("cppunit_test_runtime.xml"); + CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); runner.addTest (qa_runtime::suite ()); + runner.setOutputter(xmlout); bool was_successful = runner.run ("", false); -- cgit From 2b8bd0d2fa7c76282a772b75cb99e7bd5f2be13f Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sat, 2 Oct 2010 17:16:04 -0400 Subject: Moving XML output files from cppunit tests to $HOME/.gnuradio/unittests. This also adds a new utility gr_unittests.h, which sets up the path for output files. --- gnuradio-core/src/tests/test_all.cc | 9 ++++++--- gnuradio-core/src/tests/test_atsc.cc | 12 ++++++++++-- gnuradio-core/src/tests/test_filter.cc | 8 ++++++-- gnuradio-core/src/tests/test_general.cc | 8 ++++++-- gnuradio-core/src/tests/test_runtime.cc | 8 ++++++-- 5 files changed, 34 insertions(+), 11 deletions(-) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/test_all.cc b/gnuradio-core/src/tests/test_all.cc index 35bc0a049..17ee32f34 100644 --- a/gnuradio-core/src/tests/test_all.cc +++ b/gnuradio-core/src/tests/test_all.cc @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -33,9 +34,11 @@ int main (int argc, char **argv) { - - CppUnit::TextTestRunner runner; - std::ofstream xmlfile("cppunit_test_all.xml"); + char path[200]; + get_unittest_path ("gnuradio_core_all.xml", path, 200); + + CppUnit::TextTestRunner runner; + std::ofstream xmlfile(path); CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); runner.addTest (qa_runtime::suite ()); diff --git a/gnuradio-core/src/tests/test_atsc.cc b/gnuradio-core/src/tests/test_atsc.cc index f744d76e6..51642f81a 100644 --- a/gnuradio-core/src/tests/test_atsc.cc +++ b/gnuradio-core/src/tests/test_atsc.cc @@ -21,16 +21,24 @@ */ #include +#include + +#include #include int main (int argc, char **argv) { + char path[200]; + get_unittest_path ("gnuradio_core_atsc.xml", path, 200); - CppUnit::TextTestRunner runner; + CppUnit::TextTestRunner runner; + std::ofstream xmlfile(path); + CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); runner.addTest (qa_atsc::suite ()); - + runner.setOutputter(xmlout); + bool was_successful = runner.run ("", false); return was_successful ? 0 : 1; diff --git a/gnuradio-core/src/tests/test_filter.cc b/gnuradio-core/src/tests/test_filter.cc index 1e67b7180..90fe66c2f 100644 --- a/gnuradio-core/src/tests/test_filter.cc +++ b/gnuradio-core/src/tests/test_filter.cc @@ -22,14 +22,18 @@ #include #include + +#include #include int main (int argc, char **argv) { + char path[200]; + get_unittest_path ("gnuradio_core_atsc.xml", path, 200); - CppUnit::TextTestRunner runner; - std::ofstream xmlfile("cppunit_test_filter.xml"); + CppUnit::TextTestRunner runner; + std::ofstream xmlfile(path); CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); runner.addTest (qa_filter::suite ()); diff --git a/gnuradio-core/src/tests/test_general.cc b/gnuradio-core/src/tests/test_general.cc index bc89c0b6b..16ee9c3ad 100644 --- a/gnuradio-core/src/tests/test_general.cc +++ b/gnuradio-core/src/tests/test_general.cc @@ -22,14 +22,18 @@ #include #include + +#include #include int main (int argc, char **argv) { - CppUnit::TextTestRunner runner; + char path[200]; + get_unittest_path ("gnuradio_core_general.xml", path, 200); - std::ofstream xmlfile("cppunit_test_general.xml"); + CppUnit::TextTestRunner runner; + std::ofstream xmlfile(path); CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); runner.addTest (qa_general::suite ()); diff --git a/gnuradio-core/src/tests/test_runtime.cc b/gnuradio-core/src/tests/test_runtime.cc index 1efd9a0c0..c7983a23e 100644 --- a/gnuradio-core/src/tests/test_runtime.cc +++ b/gnuradio-core/src/tests/test_runtime.cc @@ -22,14 +22,18 @@ #include #include + +#include #include int main (int argc, char **argv) { + char path[200]; + get_unittest_path ("gnuradio_core_runtime.xml", path, 200); - CppUnit::TextTestRunner runner; - std::ofstream xmlfile("cppunit_test_runtime.xml"); + CppUnit::TextTestRunner runner; + std::ofstream xmlfile(path); CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); runner.addTest (qa_runtime::suite ()); -- cgit From d692a41f98e7b888c745efbb9fcbbb0400f39025 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Wed, 24 Nov 2010 17:29:11 -0800 Subject: Major Makefile.am housecleaning. Passes distcheck. Move all occurrences of swig_built_sources out of Makefile.am's. Move all SWIG related use of BUILT_SOURCES out of Makefile.am's. Clean up 'if PYTHON' conditionalization in gr-* Still left to do: fix Makefile.swig CLEANFILES and no_dist_files such that they remove exactly the generated files. --- gnuradio-core/src/tests/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/Makefile.am b/gnuradio-core/src/tests/Makefile.am index 2bf7cb4e5..c75bb8c2a 100644 --- a/gnuradio-core/src/tests/Makefile.am +++ b/gnuradio-core/src/tests/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2001,2008 Free Software Foundation, Inc. +# Copyright 2001,2008,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -31,7 +31,7 @@ TESTS = test_all # test_atsc #Test program to test setting up buffers using gr_test which can be run manually -EXTRA_DIST = \ +EXTRA_DIST += \ test_buffers.py \ benchmark_dotprod -- cgit From 98a3a1ce7462fe0c1662168c2c91c765eb8f841b Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Thu, 6 Jan 2011 10:26:54 -0500 Subject: Fixed error in the name of the test_filter output files. --- gnuradio-core/src/tests/test_filter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/test_filter.cc b/gnuradio-core/src/tests/test_filter.cc index 90fe66c2f..2781cfb35 100644 --- a/gnuradio-core/src/tests/test_filter.cc +++ b/gnuradio-core/src/tests/test_filter.cc @@ -30,7 +30,7 @@ int main (int argc, char **argv) { char path[200]; - get_unittest_path ("gnuradio_core_atsc.xml", path, 200); + get_unittest_path ("gnuradio_core_filter.xml", path, 200); CppUnit::TextTestRunner runner; std::ofstream xmlfile(path); -- cgit From e4d3b484edb2e852932d9da3d328273d4d35f475 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 17 Jan 2011 16:45:33 -0800 Subject: math explicit type overloads: Use explicit data type casts in math functions where the overloaded function could not be determined. affects msvc --- gnuradio-core/src/tests/benchmark_vco.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/benchmark_vco.cc b/gnuradio-core/src/tests/benchmark_vco.cc index ed0ae3b67..3a6ade78c 100644 --- a/gnuradio-core/src/tests/benchmark_vco.cc +++ b/gnuradio-core/src/tests/benchmark_vco.cc @@ -63,7 +63,7 @@ benchmark (void test (float *x, const float *y), const char *implementation_name // touch memory memset(output, 0, BLOCK_SIZE*sizeof(float)); for (int i = 0; i taps (&coeffs[0], &coeffs[NTAPS]); filter_t *f = filter_maker (taps); - + // get starting CPU usage #ifdef HAVE_SYS_RESOURCE_H if (getrusage (RUSAGE_SELF, &rusage_start) < 0){ diff --git a/gnuradio-core/src/tests/benchmark_dotprod_scc.cc b/gnuradio-core/src/tests/benchmark_dotprod_scc.cc index 49bbfe5bf..9a65bb4c6 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod_scc.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod_scc.cc @@ -66,7 +66,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) double clock_start; double clock_end; #endif - + // setup coefficients and input data @@ -78,7 +78,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) std::vector taps (&coeffs[0], &coeffs[NTAPS]); filter_t *f = filter_maker (taps); - + // get starting CPU usage #ifdef HAVE_SYS_RESOURCE_H diff --git a/gnuradio-core/src/tests/benchmark_nco.cc b/gnuradio-core/src/tests/benchmark_nco.cc index 9c4eff346..20d53e410 100644 --- a/gnuradio-core/src/tests/benchmark_nco.cc +++ b/gnuradio-core/src/tests/benchmark_nco.cc @@ -124,7 +124,7 @@ void native_sincos_vec (float *x, float *y) gr_nco nco; nco.set_freq (2 * M_PI / FREQ); - + for (int i = 0; i < ITERATIONS/BLOCK_SIZE; i++){ nco.sincos ((gr_complex*)x, BLOCK_SIZE); } @@ -133,9 +133,9 @@ void native_sincos_vec (float *x, float *y) void fxpt_sincos_vec (float *x, float *y) { gr_fxpt_nco nco; - + nco.set_freq (2 * M_PI / FREQ); - + for (int i = 0; i < ITERATIONS/BLOCK_SIZE; i++){ nco.sincos ((gr_complex*)x, BLOCK_SIZE); } diff --git a/gnuradio-core/src/tests/test_all.cc b/gnuradio-core/src/tests/test_all.cc index 6cec8ad0e..8a1423e9e 100644 --- a/gnuradio-core/src/tests/test_all.cc +++ b/gnuradio-core/src/tests/test_all.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2002,2010,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, @@ -31,7 +31,7 @@ // FIXME add atsc back in. -int +int main (int argc, char **argv) { CppUnit::TextTestRunner runner; @@ -43,7 +43,7 @@ main (int argc, char **argv) runner.addTest (qa_filter::suite ()); // runner.addTest (qa_atsc::suite ()); runner.setOutputter(xmlout); - + bool was_successful = runner.run ("", false); return was_successful ? 0 : 1; diff --git a/gnuradio-core/src/tests/test_atsc.cc b/gnuradio-core/src/tests/test_atsc.cc index 66cb2a312..d99bccce5 100644 --- a/gnuradio-core/src/tests/test_atsc.cc +++ b/gnuradio-core/src/tests/test_atsc.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2002,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, @@ -26,7 +26,7 @@ #include #include -int +int main (int argc, char **argv) { CppUnit::TextTestRunner runner; diff --git a/gnuradio-core/src/tests/test_buffers.py b/gnuradio-core/src/tests/test_buffers.py index 186a60bb9..b867c727c 100755 --- a/gnuradio-core/src/tests/test_buffers.py +++ b/gnuradio-core/src/tests/test_buffers.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2006 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. -# +# from gnuradio import gr, gru from gnuradio import audio diff --git a/gnuradio-core/src/tests/test_filter.cc b/gnuradio-core/src/tests/test_filter.cc index 3227a9ff2..8b17034c6 100644 --- a/gnuradio-core/src/tests/test_filter.cc +++ b/gnuradio-core/src/tests/test_filter.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2002,2010,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, @@ -26,7 +26,7 @@ #include #include -int +int main (int argc, char **argv) { CppUnit::TextTestRunner runner; @@ -35,7 +35,7 @@ main (int argc, char **argv) runner.addTest (qa_filter::suite ()); runner.setOutputter(xmlout); - + bool was_successful = runner.run ("", false); return was_successful ? 0 : 1; diff --git a/gnuradio-core/src/tests/test_general.cc b/gnuradio-core/src/tests/test_general.cc index ca6dee40a..32fac1b35 100644 --- a/gnuradio-core/src/tests/test_general.cc +++ b/gnuradio-core/src/tests/test_general.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2002,2010,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, @@ -26,7 +26,7 @@ #include #include -int +int main (int argc, char **argv) { CppUnit::TextTestRunner runner; @@ -35,7 +35,7 @@ main (int argc, char **argv) runner.addTest (qa_general::suite ()); runner.setOutputter(xmlout); - + bool was_successful = runner.run ("", false); return was_successful ? 0 : 1; diff --git a/gnuradio-core/src/tests/test_runtime.cc b/gnuradio-core/src/tests/test_runtime.cc index 77af3001b..bd5378332 100644 --- a/gnuradio-core/src/tests/test_runtime.cc +++ b/gnuradio-core/src/tests/test_runtime.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2002,2010,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, @@ -26,7 +26,7 @@ #include #include -int +int main (int argc, char **argv) { CppUnit::TextTestRunner runner; @@ -35,7 +35,7 @@ main (int argc, char **argv) runner.addTest (qa_runtime::suite ()); runner.setOutputter(xmlout); - + bool was_successful = runner.run ("", false); return was_successful ? 0 : 1; diff --git a/gnuradio-core/src/tests/test_vmcircbuf.cc b/gnuradio-core/src/tests/test_vmcircbuf.cc index 5145b17c4..ee24b6d62 100644 --- a/gnuradio-core/src/tests/test_vmcircbuf.cc +++ b/gnuradio-core/src/tests/test_vmcircbuf.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2003 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, @@ -23,7 +23,7 @@ #include #include -int +int main (int argc, char **argv) { int verbose = 1; // summary -- cgit From 37f752257d7fc336de1fe85a5a83134e66441e6e Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 13 Nov 2012 17:04:16 -0800 Subject: gr: set a common GR_TEST_TARGET_DEPS for all module unit tests Each unit test shares common dependencies, but we have been neglecting to set these. In this changeset, we set one top level GR_TEST_TARGET_DEPS, and simply append module-specific dependencies for each test. This also helps to fix QA tests on windows which were missing the dependencies list. Conflicts: gr-analog/python/CMakeLists.txt gr-blocks/python/CMakeLists.txt --- gnuradio-core/src/tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/CMakeLists.txt b/gnuradio-core/src/tests/CMakeLists.txt index 3c7f632b3..680141e7b 100644 --- a/gnuradio-core/src/tests/CMakeLists.txt +++ b/gnuradio-core/src/tests/CMakeLists.txt @@ -63,7 +63,7 @@ endforeach(test_not_run_src) # Set the test environment so the build libs will be found under MSVC. ######################################################################## include(GrTest) -set(GR_TEST_TARGET_DEPS volk gruel gnuradio-core test-gnuradio-core) +list(APPEND GR_TEST_TARGET_DEPS test-gnuradio-core) add_executable(gr_core_test_all test_all.cc) target_link_libraries(gr_core_test_all test-gnuradio-core) GR_ADD_TEST(gr-core-test-all gr_core_test_all) -- cgit From e788c523d4f8de3efd64a64f148ac1bf25ea032d Mon Sep 17 00:00:00 2001 From: Michael L Dickens Date: Tue, 1 Jan 2013 21:42:23 -0500 Subject: Tweak INCLUDE dirs such that INCLUDE_DIRECTORIES and LINK_DIRECTORIES are ordered as: internal build and source for this component, other components (internal build and source, or already installed), non-project non-system dependencies (e.g., Qt, Boost, Python), system dependencies (e.g., CoreAudio). --- gnuradio-core/src/tests/CMakeLists.txt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'gnuradio-core/src/tests') diff --git a/gnuradio-core/src/tests/CMakeLists.txt b/gnuradio-core/src/tests/CMakeLists.txt index 680141e7b..dbd52f05c 100644 --- a/gnuradio-core/src/tests/CMakeLists.txt +++ b/gnuradio-core/src/tests/CMakeLists.txt @@ -24,14 +24,17 @@ GR_CHECK_HDR_N_DEF(sys/resource.h HAVE_SYS_RESOURCE_H) ######################################################################## # Setup the include and linker paths ######################################################################## -include_directories(${GRUEL_INCLUDE_DIRS}) -include_directories(${GNURADIO_CORE_INCLUDE_DIRS}) - -include_directories(${Boost_INCLUDE_DIRS}) -link_directories(${Boost_LIBRARY_DIRS}) +include_directories( + ${GNURADIO_CORE_INCLUDE_DIRS} + ${GRUEL_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${CPPUNIT_INCLUDE_DIRS} +) -include_directories(${CPPUNIT_INCLUDE_DIRS}) -link_directories(${CPPUNIT_LIBRARY_DIRS}) +link_directories( + ${Boost_LIBRARY_DIRS} + ${CPPUNIT_LIBRARY_DIRS} +) ######################################################################## # Build benchmarks and non-registered tests -- cgit