summaryrefslogtreecommitdiff
path: root/gr-run-waveform
diff options
context:
space:
mode:
authorRob Savoye2010-11-29 07:57:34 -0700
committerRob Savoye2010-11-29 07:57:34 -0700
commit2060f255c79a0656b6b66b3bc7b772667c4f932a (patch)
tree08544f82a60ef6310099d0b4c11ec739cb8c9ada /gr-run-waveform
parentf3570d3fb25113d5f89bd9f258fa8cf996425b70 (diff)
downloadgnuradio-2060f255c79a0656b6b66b3bc7b772667c4f932a.tar.gz
gnuradio-2060f255c79a0656b6b66b3bc7b772667c4f932a.tar.bz2
gnuradio-2060f255c79a0656b6b66b3bc7b772667c4f932a.zip
load scheme test cases, test for the results
Diffstat (limited to 'gr-run-waveform')
-rw-r--r--gr-run-waveform/test_xyzzy.cc67
1 files changed, 58 insertions, 9 deletions
diff --git a/gr-run-waveform/test_xyzzy.cc b/gr-run-waveform/test_xyzzy.cc
index 79b013641..201b571b5 100644
--- a/gr-run-waveform/test_xyzzy.cc
+++ b/gr-run-waveform/test_xyzzy.cc
@@ -38,19 +38,68 @@ using namespace std;
boost::uint8_t hex2digit(boost::uint8_t digit);
boost::shared_array<boost::uint8_t> hex2mem(const std::string &str);
-static SCM
-test_xyzzy (void)
-{
- cerr << "FIXME:" << endl;
- SCM port;
- scm_input_port_p(port);
-}
-
static void
inner_main (void *data, int argc, char **argv)
{
- scm_c_define_gsubr ("test-xyzzy", 0, 0, 0, test_xyzzy);
+ fprintf(stderr, "TRACE %s: %d\n", __FUNCTION__, __LINE__);
+ scm_xyzzy_init();
+// const char *ccc = SRCDIR;
+ string srcdir = SRCDIR;
+
+ // Lasd readline, as it makes life on he guile command lne
+ string file = srcdir;
+ file += "/guile/readline.scm";
+ scm_c_primitive_load (file.c_str());
+
+ file = srcdir;
+ file += "/guile/simple.scm";
+ SCM simple = scm_c_primitive_load (file.c_str());
+ if (scm_is_true(scm_c_primitive_load (file.c_str()))) {
+ fprintf(stderr, "PASSED: loading simple.scm\n");
+ } else {
+ fprintf(stderr, "FAILED: loading simple.scm\n" );
+ }
+ SCM s_symbol = scm_c_lookup("result1");
+ SCM s_value = scm_variable_ref(s_symbol);
+ if (scm_to_locale_string(s_value) == string("/usr/share/guile/1.8/ice-9/boot-9.scm")) {
+ fprintf(stderr, "PASSED: search-path\n");
+ } else {
+ fprintf(stderr, "FAILED: search-path\n" );
+ }
+
+ s_symbol = scm_c_lookup("result2");
+ s_value = scm_variable_ref(s_symbol);
+ if (scm_to_locale_string(s_value) == string("/usr/share/guile/1.8/ice-9/boot-9.scm")) {
+ fprintf(stderr, "PASSED: search-path path-with-xyzzy\n");
+ } else {
+ fprintf(stderr, "FAILED: search-path path-with-xyzzy\n" );
+ }
+ s_symbol = scm_c_lookup("result3");
+ s_value = scm_variable_ref(s_symbol);
+ if (scm_to_locale_string(s_value) == string("/usr/share/guile/1.8/ice-9/boot-9.scm")) {
+ fprintf(stderr, "PASSED: xyzzy-search\n");
+ } else {
+ fprintf(stderr, "FAILED: xyzzy-search\n" );
+ }
+ s_symbol = scm_c_lookup("result4");
+ s_value = scm_variable_ref(s_symbol);
+ if (scm_to_locale_string(s_value) == string("/-xyzzy-/ice-9/boot-9.scm")) {
+ fprintf(stderr, "PASSED: xyzzy-search-path path-with-xyzzy\n");
+ } else {
+ fprintf(stderr, "FAILED: xyzzy-search-path path-with-xyzzy\n" );
+ }
+
+
+ file = srcdir;
+ file += "/guile/cat.scm";
+ if (scm_is_true(scm_c_primitive_load (file.c_str()))) {
+ fprintf(stderr, "PASSED: loading cat.scm\n");
+ } else {
+ fprintf(stderr, "FAILED: loading cat.scm\n" );
+ }
+
+ scm_flush_all_ports();
scm_shell (argc, argv);
}