summaryrefslogtreecommitdiff
path: root/gr-run-waveform
diff options
context:
space:
mode:
Diffstat (limited to 'gr-run-waveform')
-rw-r--r--gr-run-waveform/Makefile.am11
-rw-r--r--gr-run-waveform/test_waveform.cc52
2 files changed, 61 insertions, 2 deletions
diff --git a/gr-run-waveform/Makefile.am b/gr-run-waveform/Makefile.am
index 26601c8c3..2098a0396 100644
--- a/gr-run-waveform/Makefile.am
+++ b/gr-run-waveform/Makefile.am
@@ -39,14 +39,21 @@ BUILT_SOURCES = libpath.h filesystem.dat
dist_filesystem_DATA = filesystem.dat
# A unit test case for the XYZZY class
-check_PROGRAMS = test_xyzzy
-test_xyzzy_SOURCES = test_xyzzy.cc xyzzy.cc xyzzy-load.c #$(SRCS)
+check_PROGRAMS = test_xyzzy test_waveform
+test_xyzzy_SOURCES = test_xyzzy.cc xyzzy.cc xyzzy-load.c
test_xyzzy_CPPFLAGS = $(GUILE_CFLAGS) \
-DSRCDIR=\"$(srcdir)\" \
-DDATAROOTDIR=\"$(datarootdir)\"
test_xyzzy_LDADD = $(GUILE_LIBS)
test_xyzzy_DEPENDENCIES = $(BUILT_SOURCES)
+test_waveform_SOURCES = test_waveform.cc xyzzy.cc xyzzy-load.c
+test_waveform_CPPFLAGS = $(GUILE_CFLAGS) \
+ -DSRCDIR=\"$(srcdir)\" \
+ -DDATAROOTDIR=\"$(datarootdir)\"
+test_waveform_LDADD = $(GUILE_LIBS)
+test_waveform_DEPENDENCIES = $(BUILT_SOURCES)
+
# Don't install the internal header
noinst_HEADERS = xyzzy.h
diff --git a/gr-run-waveform/test_waveform.cc b/gr-run-waveform/test_waveform.cc
new file mode 100644
index 000000000..443a0673b
--- /dev/null
+++ b/gr-run-waveform/test_waveform.cc
@@ -0,0 +1,52 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 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 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <cstdio>
+#include <cstdlib>
+#include <string>
+#include <iostream>
+#include <fstream>
+#include <libguile.h>
+
+using namespace std;
+
+#include "xyzzy.h"
+
+extern "C" {
+extern SCM scm_xyzzy_search_path (SCM path, SCM filename, SCM extensions);
+}
+
+static void
+inner_main (void *data, int argc, char **argv)
+{
+ scm_c_define_gsubr ("xyzzy_search_path", 2, 1, 0, (SCM (*)()) scm_xyzzy_search_path);
+
+ scm_shell (argc, argv);
+}
+
+int
+main(int argc, char *argv[])
+{
+ scm_boot_guile (argc, argv, inner_main, 0);
+
+ return 0; // never reached
+}