diff options
author | Ben Reynwar | 2011-01-30 09:50:36 -0700 |
---|---|---|
committer | Ben Reynwar | 2011-01-30 09:50:36 -0700 |
commit | d1d4c8fd9dcf852cef9c274363182209c6761145 (patch) | |
tree | 54ddbd617c5ffffbbfc4e766f2d2281669919a73 /gruel | |
parent | f6547e103e6cae44ff2a81b0f83675ccc897f2e9 (diff) | |
parent | 023167ca8a85ab597f9e59302733f71809a8afbd (diff) | |
download | gnuradio-d1d4c8fd9dcf852cef9c274363182209c6761145.tar.gz gnuradio-d1d4c8fd9dcf852cef9c274363182209c6761145.tar.bz2 gnuradio-d1d4c8fd9dcf852cef9c274363182209c6761145.zip |
Merged upstream from next
Diffstat (limited to 'gruel')
-rw-r--r-- | gruel/Makefile.am | 4 | ||||
-rw-r--r-- | gruel/src/include/gruel/Makefile.am | 5 | ||||
-rw-r--r-- | gruel/src/lib/Makefile.am | 4 | ||||
-rw-r--r-- | gruel/src/lib/pmt/Makefile.am | 2 | ||||
-rw-r--r-- | gruel/src/lib/test_gruel.cc | 56 | ||||
-rw-r--r-- | gruel/src/scheme/gnuradio/Makefile.am | 8 |
6 files changed, 22 insertions, 57 deletions
diff --git a/gruel/Makefile.am b/gruel/Makefile.am index 93f56a7db..c43e461f2 100644 --- a/gruel/Makefile.am +++ b/gruel/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,7 +21,7 @@ include $(top_srcdir)/Makefile.common -EXTRA_DIST = \ +EXTRA_DIST += \ gruel.pc.in SUBDIRS = src diff --git a/gruel/src/include/gruel/Makefile.am b/gruel/src/include/gruel/Makefile.am index 67dd12995..d7ac3d332 100644 --- a/gruel/src/include/gruel/Makefile.am +++ b/gruel/src/include/gruel/Makefile.am @@ -21,13 +21,12 @@ include $(top_srcdir)/Makefile.common -BUILT_SOURCES = \ - inet.h +EXTRA_DIST += inet.h.in gruelincludedir = $(prefix)/include/gruel gruelinclude_HEADERS = \ - $(BUILT_SOURCES) \ + inet.h \ msg_accepter.h \ msg_accepter_msgq.h \ msg_queue.h \ diff --git a/gruel/src/lib/Makefile.am b/gruel/src/lib/Makefile.am index 5c3302f19..b9b35ae10 100644 --- a/gruel/src/lib/Makefile.am +++ b/gruel/src/lib/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008,2009,2010 Free Software Foundation, Inc. +# Copyright 2008,2009,2010,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -51,6 +51,8 @@ libgruel_la_SOURCES = \ libgruel_la_LIBADD = \ $(BOOST_THREAD_LIB) \ + $(BOOST_SYSTEM_LIB) \ + $(BOOST_FILESYSTEM_LIB) \ $(PMT_LIB) \ $(MSG_LIB) \ -lstdc++ diff --git a/gruel/src/lib/pmt/Makefile.am b/gruel/src/lib/pmt/Makefile.am index d3efc1afa..7a1f2e7d4 100644 --- a/gruel/src/lib/pmt/Makefile.am +++ b/gruel/src/lib/pmt/Makefile.am @@ -48,7 +48,7 @@ python_built_sources = $(GENERATED_H) $(GENERATED_CC) PMT_SERIAL_TAGS_H = $(abs_top_builddir)/gruel/src/include/gruel/pmt_serial_tags.h BUILT_SOURCES = $(python_built_sources) $(PMT_SERIAL_TAGS_H) -EXTRA_DIST = $(code_generator) +EXTRA_DIST += $(code_generator) # ---------------------------------------------------------------- diff --git a/gruel/src/lib/test_gruel.cc b/gruel/src/lib/test_gruel.cc index f4b9fc4e2..7ef3520e6 100644 --- a/gruel/src/lib/test_gruel.cc +++ b/gruel/src/lib/test_gruel.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2009,2010 Free Software Foundation, Inc. + * Copyright 2006,2009,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -28,16 +28,19 @@ #include "pmt/qa_pmt.h" -static void get_unittest_path (const char *filename, char *fullpath, size_t pathsize); +#include <boost/filesystem/operations.hpp> +#include <boost/filesystem/path.hpp> +namespace fs = boost::filesystem; int main(int argc, char **argv) { - char path[200]; - get_unittest_path ("gruel.xml", path, 200); - + fs::path path = fs::current_path() / ".unittests"; + if (!fs::is_directory(path)) fs::create_directory(path); + path = path / "gruel.xml"; + CppUnit::TextTestRunner runner; - std::ofstream xmlfile(path); + std::ofstream xmlfile(path.string().c_str()); CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); runner.addTest(qa_pmt::suite ()); @@ -47,44 +50,3 @@ main(int argc, char **argv) return was_successful ? 0 : 1; } - - -// NOTE: These are defined in gr_unittest.h for the rest of the project; -// rewriting here since we don't depend on gnuradio-core in gruel - -#ifdef MKDIR_TAKES_ONE_ARG -#define gr_mkdir(pathname, mode) mkdir(pathname) -#else -#define gr_mkdir(pathname, mode) mkdir((pathname), (mode)) -#endif - -/* - * Mostly taken from gr_preferences.cc/h - * The simplest thing that could possibly work: - * the key is the filename; the value is the file contents. - */ - -static void -ensure_unittest_path (const char *grpath, const char *path) -{ - struct stat statbuf; - if (stat (path, &statbuf) == 0 && S_ISDIR (statbuf.st_mode)) - return; - - // blindly try to make it // FIXME make this robust. C++ SUCKS! - gr_mkdir (grpath, 0750); - gr_mkdir (path, 0750); -} - -static void -get_unittest_path (const char *filename, char *fullpath, size_t pathsize) -{ - char path[200]; - char grpath[200]; - snprintf (grpath, sizeof(grpath), "%s/.gnuradio", getenv ("HOME")); - snprintf (path, sizeof(path), "%s/unittests", grpath); - snprintf (fullpath, pathsize, "%s/%s", path, filename); - - ensure_unittest_path(grpath, path); -} - diff --git a/gruel/src/scheme/gnuradio/Makefile.am b/gruel/src/scheme/gnuradio/Makefile.am index 0ce01f6f8..2f8e5c8d2 100644 --- a/gruel/src/scheme/gnuradio/Makefile.am +++ b/gruel/src/scheme/gnuradio/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2007,2009 Free Software Foundation, Inc. +# Copyright 2007,2009,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -18,12 +18,14 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # +include $(top_srcdir)/Makefile.common + #pkgdatadir = $(datadir)/gnuradio -EXTRA_DIST = \ +EXTRA_DIST += \ gen-serial-tags.scm -# really scheme source files +# really scheme source files FIXME wrong location dist_pkgdata_DATA = \ pmt-serial-tags.scm \ pmt-serialize.scm \ |