diff --git a/tests/multilib/Makefile b/tests/multilib/Makefile new file mode 100644 index 0000000..abf0663 --- /dev/null +++ b/tests/multilib/Makefile @@ -0,0 +1,21 @@ +# Makefile to build class 'multilib' for Pure Data. +# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build +# settings and rules. + +# library name +lib.name = multilib + +make-lib-executable=yes + +# input source file (class name == source file basename) +class.sources = multilibA.c multilibB.c + +# glue for building a multi-object library +lib.setup.sources = $(lib.name).c + +# all extra files to be included in binary distribution of the library +datafiles = multilib-help.pd multilib-meta.pd + +# include Makefile.pdlibbuilder from submodule directory 'pd-lib-builder' +PDLIBBUILDER_DIR=../.. +include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder diff --git a/tests/multilib/multilib-help.pd b/tests/multilib/multilib-help.pd new file mode 100644 index 0000000..caaf6d9 --- /dev/null +++ b/tests/multilib/multilib-help.pd @@ -0,0 +1,7 @@ +#N canvas 335 160 450 300 12; +#X msg 143 93 7; +#X obj 143 125 multilibA; +#X obj 223 125 multilibB; +#X msg 223 93 12; +#X connect 0 0 1 0; +#X connect 3 0 2 0; diff --git a/tests/multilib/multilib-meta.pd b/tests/multilib/multilib-meta.pd new file mode 100644 index 0000000..ef08c03 --- /dev/null +++ b/tests/multilib/multilib-meta.pd @@ -0,0 +1,9 @@ +#N canvas 966 322 200 200 10; +#N canvas 19 51 420 300 META 0; +#X text 10 10 META this is a prototype of a libdir meta file; +#X text 10 51 AUTHOR IOhannes m zmolnig; +#X text 10 110 VERSION 1.0.0; +#X text 10 90 LICENSE CC0; +#X text 10 70 DESCRIPTION Example "multiple" external.; +#X text 10 30 NAME multiple; +#X restore 10 10 pd META; diff --git a/tests/multilib/multilib.c b/tests/multilib/multilib.c new file mode 100644 index 0000000..4799e85 --- /dev/null +++ b/tests/multilib/multilib.c @@ -0,0 +1,8 @@ + +void multilibA_setup(void); +void multilibB_setup(void); + +void multlib_setup(void) { + multilibA_setup(); + multilibB_setup(); +} diff --git a/tests/multilib/multilibA.c b/tests/multilib/multilibA.c new file mode 100644 index 0000000..4760746 --- /dev/null +++ b/tests/multilib/multilibA.c @@ -0,0 +1,13 @@ +#include +t_class*multilibA_class; +static void multilibA_float(t_object*x, t_float f1) { + pd_error(x, "%s got %f", __FUNCTION__, f1); +} +static void*multilibA_new(void) { + return pd_new(multilibA_class); +} +void multilibA_setup(void) { + post("%s", __FUNCTION__); + multilibA_class = class_new(gensym("multilibA"), multilibA_new, 0, sizeof(t_object), 0, A_NULL); + class_addfloat(multilibA_class, multilibA_float); +} diff --git a/tests/multilib/multilibB.c b/tests/multilib/multilibB.c new file mode 100644 index 0000000..ce7c4d8 --- /dev/null +++ b/tests/multilib/multilibB.c @@ -0,0 +1,13 @@ +#include +t_class*multilibB_class; +static void multilibB_float(t_object*x, t_float f1) { + pd_error(x, "%s got %f", __FUNCTION__, f1); +} +static void*multilibB_new(void) { + return pd_new(multilibB_class); +} +void multilibB_setup(void) { + post("%s", __FUNCTION__); + multilibB_class = class_new(gensym("multilibB"), multilibB_new, 0, sizeof(t_object), 0, A_NULL); + class_addfloat(multilibB_class, multilibB_float); +} diff --git a/tests/multiple/Makefile b/tests/multiple/Makefile new file mode 100644 index 0000000..a79d6ea --- /dev/null +++ b/tests/multiple/Makefile @@ -0,0 +1,16 @@ +# Makefile to build class 'multiple' for Pure Data. +# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build +# settings and rules. + +# library name +lib.name = multiple + +# input source file (class name == source file basename) +class.sources = multipleA.c multipleB.c + +# all extra files to be included in binary distribution of the library +datafiles = multiple-help.pd multiple-meta.pd + +# include Makefile.pdlibbuilder from submodule directory 'pd-lib-builder' +PDLIBBUILDER_DIR=../.. +include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder diff --git a/tests/multiple/multiple-help.pd b/tests/multiple/multiple-help.pd new file mode 100644 index 0000000..0e4a43e --- /dev/null +++ b/tests/multiple/multiple-help.pd @@ -0,0 +1,7 @@ +#N canvas 335 160 450 300 12; +#X msg 143 93 7; +#X obj 143 125 multipleA; +#X obj 223 125 multipleB; +#X msg 223 93 12; +#X connect 0 0 1 0; +#X connect 3 0 2 0; diff --git a/tests/multiple/multiple-meta.pd b/tests/multiple/multiple-meta.pd new file mode 100644 index 0000000..ef08c03 --- /dev/null +++ b/tests/multiple/multiple-meta.pd @@ -0,0 +1,9 @@ +#N canvas 966 322 200 200 10; +#N canvas 19 51 420 300 META 0; +#X text 10 10 META this is a prototype of a libdir meta file; +#X text 10 51 AUTHOR IOhannes m zmolnig; +#X text 10 110 VERSION 1.0.0; +#X text 10 90 LICENSE CC0; +#X text 10 70 DESCRIPTION Example "multiple" external.; +#X text 10 30 NAME multiple; +#X restore 10 10 pd META; diff --git a/tests/multiple/multipleA.c b/tests/multiple/multipleA.c new file mode 100644 index 0000000..dc7bfb0 --- /dev/null +++ b/tests/multiple/multipleA.c @@ -0,0 +1,13 @@ +#include +t_class*multipleA_class; +static void multipleA_float(t_object*x, t_float f1) { + pd_error(x, "%s got %f", __FUNCTION__, f1); +} +static void*multipleA_new(void) { + return pd_new(multipleA_class); +} +void multipleA_setup(void) { + post("%s", __FUNCTION__); + multipleA_class = class_new(gensym("multipleA"), multipleA_new, 0, sizeof(t_object), 0, A_NULL); + class_addfloat(multipleA_class, multipleA_float); +} diff --git a/tests/multiple/multipleB.c b/tests/multiple/multipleB.c new file mode 100644 index 0000000..aaf50ba --- /dev/null +++ b/tests/multiple/multipleB.c @@ -0,0 +1,13 @@ +#include +t_class*multipleB_class; +static void multipleB_float(t_object*x, t_float f1) { + pd_error(x, "%s got %f", __FUNCTION__, f1); +} +static void*multipleB_new(void) { + return pd_new(multipleB_class); +} +void multipleB_setup(void) { + post("%s", __FUNCTION__); + multipleB_class = class_new(gensym("multipleB"), multipleB_new, 0, sizeof(t_object), 0, A_NULL); + class_addfloat(multipleB_class, multipleB_float); +} diff --git a/tests/single/Makefile b/tests/single/Makefile new file mode 100644 index 0000000..2dd8090 --- /dev/null +++ b/tests/single/Makefile @@ -0,0 +1,16 @@ +# Makefile to build class 'single' for Pure Data. +# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build +# settings and rules. + +# library name +lib.name = single + +# input source file (class name == source file basename) +class.sources = single.c + +# all extra files to be included in binary distribution of the library +datafiles = single-help.pd single-meta.pd + +# include Makefile.pdlibbuilder from submodule directory 'pd-lib-builder' +PDLIBBUILDER_DIR=../.. +include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder diff --git a/tests/single/single-help.pd b/tests/single/single-help.pd new file mode 100644 index 0000000..f7f922d --- /dev/null +++ b/tests/single/single-help.pd @@ -0,0 +1,4 @@ +#N canvas 335 160 450 300 12; +#X obj 143 125 test1; +#X msg 143 93 7; +#X connect 1 0 0 0; diff --git a/tests/single/single-meta.pd b/tests/single/single-meta.pd new file mode 100644 index 0000000..57923af --- /dev/null +++ b/tests/single/single-meta.pd @@ -0,0 +1,9 @@ +#N canvas 966 322 200 200 10; +#N canvas 19 51 420 300 META 0; +#X text 10 10 META this is a prototype of a libdir meta file; +#X text 10 51 AUTHOR IOhannes m zmolnig; +#X text 10 110 VERSION 1.0.0; +#X text 10 90 LICENSE CC0; +#X text 10 70 DESCRIPTION Example "single" external.; +#X text 10 30 NAME single; +#X restore 10 10 pd META; diff --git a/tests/single/single.c b/tests/single/single.c new file mode 100644 index 0000000..a35f10c --- /dev/null +++ b/tests/single/single.c @@ -0,0 +1,13 @@ +#include +t_class*single_class; +static void single_float(t_object*x, t_float f1) { + pd_error(x, "%s got %f", __FUNCTION__, f1); +} +static void*single_new(void) { + return pd_new(single_class); +} +void single_setup(void) { + post("%s", __FUNCTION__); + single_class = class_new(gensym("single"), single_new, 0, sizeof(t_object), 0, A_NULL); + class_addfloat(single_class, single_float); +}