r14990 - gnucash/branches/swig-redo/src/gnc-module/test - Convert all the gnc-module tests to use swig instead of gwrap.
Chris Shoemaker
chris at cvs.gnucash.org
Mon Oct 9 23:57:39 EDT 2006
Author: chris
Date: 2006-10-09 23:57:38 -0400 (Mon, 09 Oct 2006)
New Revision: 14990
Trac: http://svn.gnucash.org/trac/changeset/14990
Modified:
gnucash/branches/swig-redo/src/gnc-module/test/Makefile.am
gnucash/branches/swig-redo/src/gnc-module/test/mod-bar/
gnucash/branches/swig-redo/src/gnc-module/test/mod-bar/Makefile.am
gnucash/branches/swig-redo/src/gnc-module/test/mod-bar/gnc-mod-bar.c
gnucash/branches/swig-redo/src/gnc-module/test/mod-baz/
gnucash/branches/swig-redo/src/gnc-module/test/mod-baz/Makefile.am
gnucash/branches/swig-redo/src/gnc-module/test/mod-baz/gnc-mod-baz.c
gnucash/branches/swig-redo/src/gnc-module/test/mod-foo/
gnucash/branches/swig-redo/src/gnc-module/test/mod-foo/Makefile.am
gnucash/branches/swig-redo/src/gnc-module/test/mod-foo/gnc-mod-foo.c
gnucash/branches/swig-redo/src/gnc-module/test/test-gwrapped-c
gnucash/branches/swig-redo/src/gnc-module/test/test-load-deps
gnucash/branches/swig-redo/src/gnc-module/test/test-scm-multi
Log:
Convert all the gnc-module tests to use swig instead of gwrap.
Modified: gnucash/branches/swig-redo/src/gnc-module/test/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/gnc-module/test/Makefile.am 2006-10-10 02:40:40 UTC (rev 14989)
+++ gnucash/branches/swig-redo/src/gnc-module/test/Makefile.am 2006-10-10 03:57:38 UTC (rev 14990)
@@ -32,9 +32,7 @@
--gnc-module-dir ${top_srcdir}/src/gnc-module/test/mod-foo \
--gnc-module-dir ${top_srcdir}/src/gnc-module/test/mod-bar \
--gnc-module-dir ${top_srcdir}/src/gnc-module/test/mod-baz \
- --gnc-module-dir ${top_srcdir}/src/gnc-module/test/misc-mods \
- --guile-load-dir ${G_WRAP_MODULE_DIR} \
- --library-dir ${G_WRAP_LIB_DIR}
+ --gnc-module-dir ${top_srcdir}/src/gnc-module/test/misc-mods
TESTS_ENVIRONMENT := \
$(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})
Property changes on: gnucash/branches/swig-redo/src/gnc-module/test/mod-bar
___________________________________________________________________
Name: svn:ignore
- Makefile
*.so.*
bar-gwrap.c
bar-gwrap.h
bar-gwrap.html
.deps
.libs
Makefile.in
*.lo
*.la
semantic.cache
TAGS
+ Makefile
*.so.*
swig-bar.c
bar-gwrap.c
bar-gwrap.h
bar-gwrap.html
.deps
.libs
Makefile.in
*.lo
*.la
semantic.cache
TAGS
Modified: gnucash/branches/swig-redo/src/gnc-module/test/mod-bar/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/gnc-module/test/mod-bar/Makefile.am 2006-10-10 02:40:40 UTC (rev 14989)
+++ gnucash/branches/swig-redo/src/gnc-module/test/mod-bar/Makefile.am 2006-10-10 03:57:38 UTC (rev 14990)
@@ -1,7 +1,6 @@
AM_CFLAGS = \
-I${top_srcdir}/src \
-I${top_srcdir}/src/gnc-module \
- ${G_WRAP_COMPILE_ARGS} \
${GUILE_INCS} \
${GLIB_CFLAGS}
@@ -15,25 +14,20 @@
bar.h
libgncmodbar_la_SOURCES=gnc-mod-bar.c
-nodist_libgncmodbar_la_SOURCES=bar-gwrap.c
libgncmodbar_la_LIBADD=libbar.la \
- $(G_WRAP_LINK_ARGS) \
$(GLIB_LIBS)
+swig-bar.c: bar.i
+ swig -guile $(SWIG_ARGS) -Linkage module -o $@ $<
+
EXTRA_DIST = \
- bar-gwrap.scm \
+ bar.i \
gnucash/bar.scm
-bar-gwrap.c bar-gwrap.h: bar-gwrap.scm ${top_builddir}/config.status
- FLAVOR=gnome $(GUILE) -c \
- "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
- (primitive-load \"${srcdir}/bar-gwrap.scm\") \
- (gw:generate-wrapset \"bar-gwrap\")"
+BUILT_SOURCES = swig-bar.c
+CLEANFILES = $(BUILT_SOURCES)
-BUILT_SOURCES = bar-gwrap.c bar-gwrap.h
-CLEANFILES = $(BUILT_SOURCES) bar-gwrap.html
-
# Keep automake from generating install targets for test libs
install-checklibLTLIBRARIES:
uninstall-checklibLTLIBRARIES:
Modified: gnucash/branches/swig-redo/src/gnc-module/test/mod-bar/gnc-mod-bar.c
===================================================================
--- gnucash/branches/swig-redo/src/gnc-module/test/mod-bar/gnc-mod-bar.c 2006-10-10 02:40:40 UTC (rev 14989)
+++ gnucash/branches/swig-redo/src/gnc-module/test/mod-bar/gnc-mod-bar.c 2006-10-10 03:57:38 UTC (rev 14990)
@@ -6,8 +6,8 @@
#include <glib.h>
#include <libguile.h>
-#include "bar-gwrap.h"
#include "gnc-module-api.h"
+#include "swig-bar.c"
int libgncmodbar_LTX_gnc_module_system_interface = 0;
@@ -32,10 +32,11 @@
int
libgncmodbar_LTX_gnc_module_init(int refcount) {
- /* publish the g-wrapped Scheme bindings for libbar */
- gw_init_wrapset_bar_gwrap();
+ /* publish the wrapped Scheme bindings for libbar */
+ scm_init_sw_bar_module();
+ scm_c_eval_string("(use-modules (sw_bar))");
- /* use the (bar) module */
+ /* use the Scheme "bar" module */
scm_c_eval_string("(use-modules (gnucash bar))");
return TRUE;
Property changes on: gnucash/branches/swig-redo/src/gnc-module/test/mod-baz
___________________________________________________________________
Name: svn:ignore
- Makefile
*.so.*
baz-gwrap.c
baz-gwrap.h
baz-gwrap.html
.deps
.libs
Makefile.in
*.lo
*.la
semantic.cache
TAGS
+ Makefile
*.so.*
swig-baz.c
baz-gwrap.c
baz-gwrap.h
baz-gwrap.html
.deps
.libs
Makefile.in
*.lo
*.la
semantic.cache
TAGS
Modified: gnucash/branches/swig-redo/src/gnc-module/test/mod-baz/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/gnc-module/test/mod-baz/Makefile.am 2006-10-10 02:40:40 UTC (rev 14989)
+++ gnucash/branches/swig-redo/src/gnc-module/test/mod-baz/Makefile.am 2006-10-10 03:57:38 UTC (rev 14990)
@@ -3,7 +3,6 @@
-I${top_srcdir}/src/gnc-module \
-I${top_srcdir}/src/gnc-module/test/mod-foo \
${GLIB_CFLAGS} \
- ${G_WRAP_COMPILE_ARGS} \
${GUILE_INCS}
PWD := $(shell pwd)
@@ -17,27 +16,22 @@
baz.h
libgncmodbaz_la_SOURCES = gnc-mod-baz.c
-nodist_libgncmodbaz_la_SOURCES = baz-gwrap.c
libgncmodbaz_la_LIBADD = \
libbaz.la \
../../libgncmodule.la \
- $(G_WRAP_LINK_ARGS) \
$(GLIB_LIBS)
+swig-baz.c: baz.i
+ swig -guile $(SWIG_ARGS) -Linkage module -o $@ $<
+
EXTRA_DIST = \
- baz-gwrap.scm \
+ baz.i \
gnucash/baz.scm
-baz-gwrap.c baz-gwrap.h: baz-gwrap.scm ${top_builddir}/config.status
- FLAVOR=gnome $(GUILE) -c \
- "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
- (primitive-load \"${srcdir}/baz-gwrap.scm\") \
- (gw:generate-wrapset \"baz-gwrap\")"
+BUILT_SOURCES = swig-baz.c
+CLEANFILES = $(BUILT_SOURCES)
-BUILT_SOURCES = baz-gwrap.c baz-gwrap.h
-CLEANFILES = $(BUILT_SOURCES) baz-gwrap.html
-
# Keep automake from generating install targets for test libs
install-checklibLTLIBRARIES:
uninstall-checklibLTLIBRARIES:
Modified: gnucash/branches/swig-redo/src/gnc-module/test/mod-baz/gnc-mod-baz.c
===================================================================
--- gnucash/branches/swig-redo/src/gnc-module/test/mod-baz/gnc-mod-baz.c 2006-10-10 02:40:40 UTC (rev 14989)
+++ gnucash/branches/swig-redo/src/gnc-module/test/mod-baz/gnc-mod-baz.c 2006-10-10 03:57:38 UTC (rev 14990)
@@ -7,7 +7,7 @@
#include "gnc-module.h"
#include "gnc-module-api.h"
-#include "baz-gwrap.h"
+#include "swig-baz.c"
int libgncmodbaz_LTX_gnc_module_system_interface = 0;
@@ -34,10 +34,11 @@
libgncmodbaz_LTX_gnc_module_init(int refcount) {
/* load libfoo */
if(gnc_module_load("gnucash/foo", 0)) {
- /* publish the g-wrapped Scheme bindings for libbaz */
- gw_init_wrapset_baz_gwrap();
-
- /* use the scheme module */
+ /* publish the wrapped Scheme bindings for libbaz */
+ scm_init_sw_baz_module();
+ scm_c_eval_string("(use-modules (sw_baz))");
+
+ /* use the Scheme "baz" module */
scm_c_eval_string("(use-modules (gnucash baz))");
return TRUE;
Property changes on: gnucash/branches/swig-redo/src/gnc-module/test/mod-foo
___________________________________________________________________
Name: svn:ignore
- Makefile
*.so.*
foo-gwrap.c
foo-gwrap.h
foo-gwrap.html
.deps
.libs
Makefile.in
*.lo
*.la
semantic.cache
TAGS
+ Makefile
*.so.*
swig-foo.c
foo-gwrap.c
foo-gwrap.h
foo-gwrap.html
.deps
.libs
Makefile.in
*.lo
*.la
semantic.cache
TAGS
Modified: gnucash/branches/swig-redo/src/gnc-module/test/mod-foo/Makefile.am
===================================================================
--- gnucash/branches/swig-redo/src/gnc-module/test/mod-foo/Makefile.am 2006-10-10 02:40:40 UTC (rev 14989)
+++ gnucash/branches/swig-redo/src/gnc-module/test/mod-foo/Makefile.am 2006-10-10 03:57:38 UTC (rev 14990)
@@ -2,7 +2,6 @@
-I${top_srcdir}/src \
-I${top_srcdir}/src/gnc-module \
${GUILE_INCS} \
- ${G_WRAP_COMPILE_ARGS} \
${GLIB_CFLAGS}
PWD := $(shell pwd)
@@ -15,25 +14,20 @@
foo.h
libgncmodfoo_la_SOURCES = gnc-mod-foo.c
-nodist_libgncmodfoo_la_SOURCES = foo-gwrap.c
libgncmodfoo_la_LIBADD = \
libfoo.la \
- $(G_WRAP_LINK_ARGS) \
$(GLIB_LIBS)
EXTRA_DIST = \
- foo-gwrap.scm \
+ foo.i \
gnucash/foo.scm
-foo-gwrap.c foo-gwrap.h: foo-gwrap.scm ${top_builddir}/config.status
- FLAVOR=gnome $(GUILE) -c \
- "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
- (primitive-load \"${srcdir}/foo-gwrap.scm\") \
- (gw:generate-wrapset \"foo-gwrap\")"
+swig-foo.c: foo.i
+ swig -guile $(SWIG_ARGS) -Linkage module -o $@ $<
-BUILT_SOURCES = foo-gwrap.c foo-gwrap.h
-CLEANFILES = $(BUILT_SOURCES) foo-gwrap.html
+BUILT_SOURCES = swig-foo.c
+CLEANFILES = $(BUILT_SOURCES)
# Keep automake from generating install targets for test libs
install-checklibLTLIBRARIES:
Modified: gnucash/branches/swig-redo/src/gnc-module/test/mod-foo/gnc-mod-foo.c
===================================================================
--- gnucash/branches/swig-redo/src/gnc-module/test/mod-foo/gnc-mod-foo.c 2006-10-10 02:40:40 UTC (rev 14989)
+++ gnucash/branches/swig-redo/src/gnc-module/test/mod-foo/gnc-mod-foo.c 2006-10-10 03:57:38 UTC (rev 14990)
@@ -6,8 +6,8 @@
#include <glib.h>
#include <libguile.h>
-#include "foo-gwrap.h"
#include "gnc-module-api.h"
+#include "swig-foo.c"
int libgncmodfoo_LTX_gnc_module_system_interface = 0;
@@ -20,7 +20,6 @@
char *libgncmodfoo_LTX_gnc_module_description(void);
int libgncmodfoo_LTX_gnc_module_init(int refcount);
-
char *
libgncmodfoo_LTX_gnc_module_path(void) {
return g_strdup("gnucash/foo");
@@ -33,8 +32,9 @@
int
libgncmodfoo_LTX_gnc_module_init(int refcount) {
- /* publish the g-wrapped Scheme bindings for libfoo */
- gw_init_wrapset_foo_gwrap();
+ /* publish the wrapped Scheme bindings for libfoo */
+ scm_init_sw_foo_module();
+ scm_c_eval_string("(use-modules (sw_foo))");
/* use the Scheme "foo" module */
scm_c_eval_string("(use-modules (gnucash foo))");
Modified: gnucash/branches/swig-redo/src/gnc-module/test/test-gwrapped-c
===================================================================
--- gnucash/branches/swig-redo/src/gnc-module/test/test-gwrapped-c 2006-10-10 02:40:40 UTC (rev 14989)
+++ gnucash/branches/swig-redo/src/gnc-module/test/test-gwrapped-c 2006-10-10 03:57:38 UTC (rev 14990)
@@ -2,4 +2,4 @@
guile -c "(use-modules (gnucash gnc-module))
(gnc:module-system-init)
(gnc:module-load \"gnucash/foo\" 0)
- (exit (foo:hello))"
+ (exit (eq? 10 (foo-hello)))"
Modified: gnucash/branches/swig-redo/src/gnc-module/test/test-load-deps
===================================================================
--- gnucash/branches/swig-redo/src/gnc-module/test/test-load-deps 2006-10-10 02:40:40 UTC (rev 14989)
+++ gnucash/branches/swig-redo/src/gnc-module/test/test-load-deps 2006-10-10 03:57:38 UTC (rev 14990)
@@ -8,8 +8,8 @@
(gnc:module-system-init)
(gnc:module-load "gnucash/baz" 0)
-(baz:hello)
-(foo:hello)
+(baz-hello)
+(foo-hello)
(baz:scheme-hello)
(foo:scheme-hello)
Modified: gnucash/branches/swig-redo/src/gnc-module/test/test-scm-multi
===================================================================
--- gnucash/branches/swig-redo/src/gnc-module/test/test-scm-multi 2006-10-10 02:40:40 UTC (rev 14989)
+++ gnucash/branches/swig-redo/src/gnc-module/test/test-scm-multi 2006-10-10 03:57:38 UTC (rev 14990)
@@ -5,12 +5,12 @@
(use-modules (gnucash gnc-module))
(gnc:module-system-init)
(gnc:module-load "gnucash/foo" 0)
-(foo:hello)
+(foo-hello)
(foo:scheme-hello)
(gnc:module-load "gnucash/bar" 0)
-(foo:hello)
+(foo-hello)
(foo:scheme-hello)
-(bar:hello)
+(bar-hello)
(bar:scheme-hello)
;; Local Variables:
More information about the gnucash-changes
mailing list