aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatja <katjav@users.sourceforge.net>2011-11-13 14:44:34 +0000
committerKatja <katjav@users.sourceforge.net>2011-11-13 14:44:34 +0000
commitc704d087a3cf72332476a750e1c99d10ab8975ca (patch)
treeaaee2bb536f638485efd173a6dd355a75a655706
parent844f29f5b8b7229e8983b4a2dfc9a21ed8931811 (diff)
add files to libdir 'testtools'
- Makefile - LICENSE.txt - README.txt - put examples in 'testtools/examples/' svn path=/trunk/externals/testtools/; revision=15734
-rw-r--r--LICENSE.txt90
-rw-r--r--Makefile416
-rw-r--r--README.txt21
-rw-r--r--examples/example-unittest.pd (renamed from unit-test-frame-example.pd)12
-rw-r--r--examples/example.wav (renamed from unit-test-frame-example.wav)bin2092 -> 2092 bytes
-rw-r--r--examples/example~-unittest.pd (renamed from unit-test-frame~-example.pd)8
-rw-r--r--examples/example~.wav (renamed from unit-test-frame~-example.wav)bin2092 -> 2092 bytes
-rw-r--r--unit-test-frame.pd378
-rw-r--r--unit-test-frame~.pd208
9 files changed, 863 insertions, 270 deletions
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..f6c04ee
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,90 @@
+testtools
+
+----------------------------------------------------------------------------------------------------
+
+unit test abstractions:
+unit-test-frame.pd
+unit-test-frame~.pd
+
+unit test example patches:
+example-unittest.pd
+example~-unittest.pd
+
+Katja Vetter and Fred Jan Kraan 2011
+
+To these patches, the license terms of the employed Pd classes apply:
+vanilla pd
+ggee/getdir
+----------------------------------------------------------------------------------------------------
+
+
+----------------------------------------------------------------------------------------------------
+
+vanilla Pd license
+
+This software is copyrighted by Miller Puckette and others. The following
+terms (the "Standard Improved BSD License") apply to all files associated with
+the software unless explicitly disclaimed in individual files:
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+3. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+
+----------------------------------------------------------------------------------------------------
+
+ggee license
+
+This software is copyrighted by Guenter Geiger and others. The following
+terms apply to all files associated with the software unless explicitly
+disclaimed in individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute,
+and license this software and its documentation for any purpose, provided
+that existing copyright notices are retained in all copies and that this
+notice is included verbatim in any distributions. No written agreement,
+license, or royalty fee is required for any of the authorized uses.
+Modifications to this software may be copyrighted by their authors
+and need not follow the licensing terms described here, provided that
+the new terms are clearly indicated on the first page of each file where
+they apply.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+MODIFICATIONS.
+
+RESTRICTED RIGHTS: Use, duplication or disclosure by the government
+is subject to the restrictions as set forth in subparagraph (c) (1) (ii)
+of the Rights in Technical Data and Computer Software Clause as DFARS
+252.227-7013 and FAR 52.227-19.
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4385cdf
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,416 @@
+## Pd library template version 1.0.12
+# For instructions on how to use this template, see:
+# http://puredata.info/docs/developer/MakefileTemplate
+LIBRARY_NAME = testtools
+
+# add your .c source files, one object per file, to the SOURCES
+# variable, help files will be included automatically, and for GUI
+# objects, the matching .tcl file too
+SOURCES =
+
+# list all pd objects (i.e. myobject.pd) files here, and their helpfiles will
+# be included automatically
+PDOBJECTS = unit-test-frame.pd unit-test-frame~.pd
+
+# example patches and related files, in the 'examples' subfolder
+EXAMPLES = example-unittest.pd example~-unittest.pd example.wav example~.wav
+
+# manuals and related files, in the 'manual' subfolder
+MANUAL =
+
+# if you want to include any other files in the source and binary tarballs,
+# list them here. This can be anything from header files, test patches,
+# documentation, etc. README.txt and LICENSE.txt are required and therefore
+# automatically included
+EXTRA_DIST =
+
+
+
+#------------------------------------------------------------------------------#
+#
+# things you might need to edit if you are using other C libraries
+#
+#------------------------------------------------------------------------------#
+
+ALL_CFLAGS = -I"$(PD_INCLUDE)"
+ALL_LDFLAGS =
+SHARED_LDFLAGS =
+ALL_LIBS =
+
+
+#------------------------------------------------------------------------------#
+#
+# you shouldn't need to edit anything below here, if we did it right :)
+#
+#------------------------------------------------------------------------------#
+
+# these can be set from outside without (usually) breaking the build
+CFLAGS = -Wall -W -g
+LDFLAGS =
+LIBS =
+
+# get library version from meta file
+LIBRARY_VERSION = $(shell sed -n 's|^\#X text [0-9][0-9]* [0-9][0-9]* VERSION \(.*\);|\1|p' $(LIBRARY_NAME)-meta.pd)
+
+ALL_CFLAGS += -DPD -DVERSION='"$(LIBRARY_VERSION)"'
+
+PD_INCLUDE = $(PD_PATH)/include/pd
+# where to install the library, overridden below depending on platform
+prefix = /usr/local
+libdir = $(prefix)/lib
+pkglibdir = $(libdir)/pd-externals
+objectsdir = $(pkglibdir)
+
+INSTALL = install
+INSTALL_PROGRAM = $(INSTALL) -p -m 644
+INSTALL_DATA = $(INSTALL) -p -m 644
+INSTALL_DIR = $(INSTALL) -p -m 755 -d
+
+ALLSOURCES := $(SOURCES) $(SOURCES_android) $(SOURCES_cygwin) $(SOURCES_macosx) \
+ $(SOURCES_iphoneos) $(SOURCES_linux) $(SOURCES_windows)
+
+DISTDIR=$(LIBRARY_NAME)-$(LIBRARY_VERSION)
+ORIGDIR=pd-$(LIBRARY_NAME:~=)_$(LIBRARY_VERSION)
+
+UNAME := $(shell uname -s)
+ifeq ($(UNAME),Darwin)
+ CPU := $(shell uname -p)
+ ifeq ($(CPU),arm) # iPhone/iPod Touch
+ SOURCES += $(SOURCES_iphoneos)
+ EXTENSION = pd_darwin
+ SHARED_EXTENSION = dylib
+ OS = iphoneos
+ PD_PATH = /Applications/Pd-extended.app/Contents/Resources
+ IPHONE_BASE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
+ CC=$(IPHONE_BASE)/gcc
+ CPP=$(IPHONE_BASE)/cpp
+ CXX=$(IPHONE_BASE)/g++
+ ISYSROOT = -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk
+ IPHONE_CFLAGS = -miphoneos-version-min=3.0 $(ISYSROOT) -arch armv6
+ OPT_CFLAGS = -fast -funroll-loops -fomit-frame-pointer
+ ALL_CFLAGS := $(IPHONE_CFLAGS) $(ALL_CFLAGS)
+ ALL_LDFLAGS += -arch armv6 -bundle -undefined dynamic_lookup $(ISYSROOT)
+ SHARED_LDFLAGS += -arch armv6 -dynamiclib -undefined dynamic_lookup $(ISYSROOT)
+ ALL_LIBS += -lc $(LIBS_iphoneos)
+ STRIP = strip -x
+ DISTBINDIR=$(DISTDIR)-$(OS)
+ else # Mac OS X
+ SOURCES += $(SOURCES_macosx)
+ EXTENSION = pd_darwin
+ SHARED_EXTENSION = dylib
+ OS = macosx
+ PD_PATH = /Applications/Pd-extended.app/Contents/Resources
+ OPT_CFLAGS = -ftree-vectorize -ftree-vectorizer-verbose=2 -fast
+# build universal 32-bit on 10.4 and 32/64 on newer
+ ifeq ($(shell uname -r | sed 's|\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*|\1|'), 8)
+ FAT_FLAGS = -arch ppc -arch i386 -mmacosx-version-min=10.4
+ else
+ FAT_FLAGS = -arch ppc -arch i386 -arch x86_64 -mmacosx-version-min=10.4
+ SOURCES += $(SOURCES_iphoneos)
+ endif
+ ALL_CFLAGS += $(FAT_FLAGS) -fPIC -I/sw/include
+ # if the 'pd' binary exists, check the linking against it to aid with stripping
+ BUNDLE_LOADER = $(shell test ! -e $(PD_PATH)/bin/pd || echo -bundle_loader $(PD_PATH)/bin/pd)
+ ALL_LDFLAGS += $(FAT_FLAGS) -bundle $(BUNDLE_LOADER) -undefined dynamic_lookup -L/sw/lib
+ SHARED_LDFLAGS += $(FAT_FLAGS) -dynamiclib -undefined dynamic_lookup \
+ -install_name @loader_path/$(SHARED_LIB) -compatibility_version 1 -current_version 1.0
+ ALL_LIBS += -lc $(LIBS_macosx)
+ STRIP = strip -x
+ DISTBINDIR=$(DISTDIR)-$(OS)
+# install into ~/Library/Pd on Mac OS X since /usr/local isn't used much
+ pkglibdir=$(HOME)/Library/Pd
+ endif
+endif
+# Tho Android uses Linux, we use this fake uname to provide an easy way to
+# setup all this things needed to cross-compile for Android using the NDK
+ifeq ($(UNAME),ANDROID)
+ CPU := arm
+ SOURCES += $(SOURCES_android)
+ EXTENSION = pd_linux
+ SHARED_EXTENSION = so
+ OS = android
+ PD_PATH = /usr
+ NDK_BASE := /usr/local/android-ndk
+ NDK_PLATFORM_VERSION := 5
+ NDK_SYSROOT=$(NDK_BASE)/platforms/android-$(NDK_PLATFORM_VERSION)/arch-arm
+ NDK_UNAME := $(shell uname -s | tr '[A-Z]' '[a-z]')
+ NDK_TOOLCHAIN_BASE=$(NDK_BASE)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/$(NDK_UNAME)-x86
+ CC := $(NDK_TOOLCHAIN_BASE)/bin/arm-linux-androideabi-gcc --sysroot=$(NDK_SYSROOT)
+ OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
+ CFLAGS +=
+ LDFLAGS += -rdynamic -shared
+ SHARED_LDFLAGS += -Wl,-soname,$(SHARED_LIB) -shared
+ LIBS += -lc $(LIBS_android)
+ STRIP := $(NDK_TOOLCHAIN_BASE)/bin/arm-linux-androideabi-strip \
+ --strip-unneeded -R .note -R .comment
+ DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
+endif
+ifeq ($(UNAME),Linux)
+ CPU := $(shell uname -m)
+ SOURCES += $(SOURCES_linux)
+ EXTENSION = pd_linux
+ SHARED_EXTENSION = so
+ OS = linux
+ PD_PATH = /usr
+ OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
+ ALL_CFLAGS += -fPIC
+ ALL_LDFLAGS += -rdynamic -shared -fPIC -Wl,-rpath,"\$$ORIGIN",--enable-new-dtags
+ SHARED_LDFLAGS += -Wl,-soname,$(SHARED_LIB) -shared
+ ALL_LIBS += -lc $(LIBS_linux)
+ STRIP = strip --strip-unneeded -R .note -R .comment
+ DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
+endif
+ifeq ($(UNAME),GNU)
+ # GNU/Hurd, should work like GNU/Linux for basically all externals
+ CPU := $(shell uname -m)
+ SOURCES += $(SOURCES_linux)
+ EXTENSION = pd_linux
+ SHARED_EXTENSION = so
+ OS = linux
+ PD_PATH = /usr
+ OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
+ ALL_CFLAGS += -fPIC
+ ALL_LDFLAGS += -rdynamic -shared -fPIC -Wl,-rpath,"\$$ORIGIN",--enable-new-dtags
+ SHARED_LDFLAGS += -shared -Wl,-soname,$(SHARED_LIB)
+ ALL_LIBS += -lc $(LIBS_linux)
+ STRIP = strip --strip-unneeded -R .note -R .comment
+ DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
+endif
+ifeq ($(UNAME),GNU/kFreeBSD)
+ # Debian GNU/kFreeBSD, should work like GNU/Linux for basically all externals
+ CPU := $(shell uname -m)
+ SOURCES += $(SOURCES_linux)
+ EXTENSION = pd_linux
+ SHARED_EXTENSION = so
+ OS = linux
+ PD_PATH = /usr
+ OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
+ ALL_CFLAGS += -fPIC
+ ALL_LDFLAGS += -rdynamic -shared -fPIC -Wl,-rpath,"\$$ORIGIN",--enable-new-dtags
+ SHARED_LDFLAGS += -shared -Wl,-soname,$(SHARED_LIB)
+ ALL_LIBS += -lc $(LIBS_linux)
+ STRIP = strip --strip-unneeded -R .note -R .comment
+ DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
+endif
+ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME)))
+ CPU := $(shell uname -m)
+ SOURCES += $(SOURCES_cygwin)
+ EXTENSION = dll
+ SHARED_EXTENSION = dll
+ OS = cygwin
+ PD_PATH = $(shell cygpath $$PROGRAMFILES)/pd
+ OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
+ ALL_CFLAGS +=
+ ALL_LDFLAGS += -rdynamic -shared -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin"
+ SHARED_LDFLAGS += -shared -Wl,-soname,$(SHARED_LIB)
+ ALL_LIBS += -lc -lpd $(LIBS_cygwin)
+ STRIP = strip --strip-unneeded -R .note -R .comment
+ DISTBINDIR=$(DISTDIR)-$(OS)
+endif
+ifeq (MINGW,$(findstring MINGW,$(UNAME)))
+ CPU := $(shell uname -m)
+ SOURCES += $(SOURCES_windows)
+ EXTENSION = dll
+ SHARED_EXTENSION = dll
+ OS = windows
+ PD_PATH = $(shell cd "$$PROGRAMFILES/pd" && pwd)
+ # MinGW doesn't seem to include cc so force gcc
+ CC=gcc
+ OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer
+ ALL_CFLAGS += -mms-bitfields
+ ALL_LDFLAGS += -s -shared -Wl,--enable-auto-import -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" -L"$(PD_PATH)/obj"
+ SHARED_LDFLAGS += -shared
+ ALL_LIBS += -lpd -lwsock32 -lkernel32 -luser32 -lgdi32 $(LIBS_windows)
+ STRIP = strip --strip-unneeded -R .note -R .comment
+ DISTBINDIR=$(DISTDIR)-$(OS)
+endif
+
+# in case somebody manually set the HELPPATCHES above
+HELPPATCHES ?= $(SOURCES:.c=-help.pd) $(PDOBJECTS:.pd=-help.pd)
+
+ALL_CFLAGS := $(ALL_CFLAGS) $(CFLAGS) $(OPT_CFLAGS)
+ALL_LDFLAGS := $(LDFLAGS) $(ALL_LDFLAGS)
+ALL_LIBS := $(LIBS) $(ALL_LIBS)
+
+SHARED_SOURCE ?= $(wildcard lib$(LIBRARY_NAME).c)
+SHARED_HEADER ?= $(shell test ! -e $(LIBRARY_NAME).h || echo $(LIBRARY_NAME).h)
+SHARED_LIB = $(SHARED_SOURCE:.c=.$(SHARED_EXTENSION))
+SHARED_TCL_LIB = $(wildcard lib$(LIBRARY_NAME).tcl)
+
+.PHONY = install libdir_install single_install install-doc install-examples install-manual clean distclean dist etags $(LIBRARY_NAME)
+
+all: $(SOURCES:.c=.$(EXTENSION)) $(SHARED_LIB)
+
+%.o: %.c
+ $(CC) $(ALL_CFLAGS) -o "$*.o" -c "$*.c"
+
+%.$(EXTENSION): %.o $(SHARED_LIB)
+ $(CC) $(ALL_LDFLAGS) -o "$*.$(EXTENSION)" "$*.o" $(ALL_LIBS) $(SHARED_LIB)
+ chmod a-x "$*.$(EXTENSION)"
+
+# this links everything into a single binary file
+$(LIBRARY_NAME): $(SOURCES:.c=.o) $(LIBRARY_NAME).o
+ $(CC) $(ALL_LDFLAGS) -o $(LIBRARY_NAME).$(EXTENSION) $(SOURCES:.c=.o) $(LIBRARY_NAME).o $(ALL_LIBS)
+ chmod a-x $(LIBRARY_NAME).$(EXTENSION)
+
+$(SHARED_LIB): $(SHARED_SOURCE:.c=.o)
+ $(CC) $(SHARED_LDFLAGS) -o $(SHARED_LIB) $(SHARED_SOURCE:.c=.o) $(LIBS)
+
+install: libdir_install
+
+# The meta and help files are explicitly installed to make sure they are
+# actually there. Those files are not optional, then need to be there.
+libdir_install: $(SOURCES:.c=.$(EXTENSION)) $(SHARED_LIB) install-doc install-examples install-manual
+ $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+ $(INSTALL_DATA) $(LIBRARY_NAME)-meta.pd \
+ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+ test -z "$(strip $(SOURCES))" || (\
+ $(INSTALL_PROGRAM) $(SOURCES:.c=.$(EXTENSION)) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) && \
+ $(STRIP) $(addprefix $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/,$(SOURCES:.c=.$(EXTENSION))))
+ test -z "$(strip $(SHARED_LIB))" || \
+ $(INSTALL_DATA) $(SHARED_LIB) \
+ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+ test -z "$(strip $(wildcard $(SOURCES:.c=.tcl)))" || \
+ $(INSTALL_DATA) $(wildcard $(SOURCES:.c=.tcl)) \
+ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+ test -z "$(strip $(PDOBJECTS))" || \
+ $(INSTALL_DATA) $(PDOBJECTS) \
+ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+ test -z "$(strip $(SHARED_TCL_LIB))" || \
+ $(INSTALL_DATA) $(SHARED_TCL_LIB) \
+ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+
+# install library linked as single binary
+single_install: $(LIBRARY_NAME) install-doc install-examples install-manual
+ $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+ $(INSTALL_PROGRAM) $(LIBRARY_NAME).$(EXTENSION) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+ $(STRIP) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/$(LIBRARY_NAME).$(EXTENSION)
+
+install-doc:
+ $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+ test -z "$(strip $(SOURCES) $(PDOBJECTS))" || \
+ $(INSTALL_DATA) $(HELPPATCHES) \
+ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
+ $(INSTALL_DATA) README.txt $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/README.txt
+ $(INSTALL_DATA) LICENSE.txt $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/LICENSE.txt
+
+install-examples:
+ test -z "$(strip $(EXAMPLES))" || \
+ $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/examples && \
+ for file in $(EXAMPLES); do \
+ $(INSTALL_DATA) examples/$$file $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/examples; \
+ done
+
+install-manual:
+ test -z "$(strip $(MANUAL))" || \
+ $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/manual && \
+ for file in $(MANUAL); do \
+ $(INSTALL_DATA) manual/$$file $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/manual; \
+ done
+
+
+clean:
+ -rm -f -- $(SOURCES:.c=.o) $(SOURCES_LIB:.c=.o) $(SHARED_SOURCE:.c=.o)
+ -rm -f -- $(SOURCES:.c=.$(EXTENSION))
+ -rm -f -- $(LIBRARY_NAME).o
+ -rm -f -- $(LIBRARY_NAME).$(EXTENSION)
+ -rm -f -- $(SHARED_LIB)
+
+distclean: clean
+ -rm -f -- $(DISTBINDIR).tar.gz
+ -rm -rf -- $(DISTBINDIR)
+ -rm -f -- $(DISTDIR).tar.gz
+ -rm -rf -- $(DISTDIR)
+ -rm -f -- $(ORIGDIR).tar.gz
+ -rm -rf -- $(ORIGDIR)
+
+
+$(DISTBINDIR):
+ $(INSTALL_DIR) $(DISTBINDIR)
+
+libdir: all $(DISTBINDIR)
+ $(INSTALL_DATA) $(LIBRARY_NAME)-meta.pd $(DISTBINDIR)
+ $(INSTALL_DATA) $(SOURCES) $(SHARED_SOURCE) $(SHARED_HEADER) $(DISTBINDIR)
+ $(INSTALL_DATA) $(HELPPATCHES) $(DISTBINDIR)
+ test -z "$(strip $(EXTRA_DIST))" || \
+ $(INSTALL_DATA) $(EXTRA_DIST) $(DISTBINDIR)
+# tar --exclude-vcs -czpf $(DISTBINDIR).tar.gz $(DISTBINDIR)
+
+$(DISTDIR):
+ $(INSTALL_DIR) $(DISTDIR)
+
+$(ORIGDIR):
+ $(INSTALL_DIR) $(ORIGDIR)
+
+dist: $(DISTDIR)
+ $(INSTALL_DATA) Makefile $(DISTDIR)
+ $(INSTALL_DATA) README.txt $(DISTDIR)
+ $(INSTALL_DATA) LICENSE.txt $(DISTDIR)
+ $(INSTALL_DATA) $(LIBRARY_NAME)-meta.pd $(DISTDIR)
+ test -z "$(strip $(ALLSOURCES))" || \
+ $(INSTALL_DATA) $(ALLSOURCES) $(DISTDIR)
+ test -z "$(strip $(wildcard $(ALLSOURCES:.c=.tcl)))" || \
+ $(INSTALL_DATA) $(wildcard $(ALLSOURCES:.c=.tcl)) $(DISTDIR)
+ test -z "$(strip $(SHARED_HEADER))" || \
+ $(INSTALL_DATA) $(SHARED_HEADER) $(DISTDIR)
+ test -z "$(strip $(SHARED_SOURCE))" || \
+ $(INSTALL_DATA) $(SHARED_SOURCE) $(DISTDIR)
+ test -z "$(strip $(SHARED_TCL_LIB))" || \
+ $(INSTALL_DATA) $(SHARED_TCL_LIB) $(DISTDIR)
+ test -z "$(strip $(PDOBJECTS))" || \
+ $(INSTALL_DATA) $(PDOBJECTS) $(DISTDIR)
+ test -z "$(strip $(HELPPATCHES))" || \
+ $(INSTALL_DATA) $(HELPPATCHES) $(DISTDIR)
+ test -z "$(strip $(EXTRA_DIST))" || \
+ $(INSTALL_DATA) $(EXTRA_DIST) $(DISTDIR)
+ test -z "$(strip $(EXAMPLES))" || \
+ $(INSTALL_DIR) $(DISTDIR)/examples && \
+ for file in $(EXAMPLES); do \
+ $(INSTALL_DATA) examples/$$file $(DISTDIR)/examples; \
+ done
+ test -z "$(strip $(MANUAL))" || \
+ $(INSTALL_DIR) $(DISTDIR)/manual && \
+ for file in $(MANUAL); do \
+ $(INSTALL_DATA) manual/$$file $(DISTDIR)/manual; \
+ done
+ tar --exclude-vcs -czpf $(DISTDIR).tar.gz $(DISTDIR)
+
+# make a Debian source package
+dpkg-source:
+ debclean
+ make distclean dist
+ mv $(DISTDIR) $(ORIGDIR)
+ tar --exclude-vcs -czpf ../$(ORIGDIR).orig.tar.gz $(ORIGDIR)
+ rm -f -- $(DISTDIR).tar.gz
+ rm -rf -- $(DISTDIR) $(ORIGDIR)
+ cd .. && dpkg-source -b $(LIBRARY_NAME)
+
+etags:
+ etags *.h $(SOURCES) ../../pd/src/*.[ch] /usr/include/*.h /usr/include/*/*.h
+
+showsetup:
+ @echo "CC: $(CC)"
+ @echo "CFLAGS: $(CFLAGS)"
+ @echo "LDFLAGS: $(LDFLAGS)"
+ @echo "LIBS: $(LIBS)"
+ @echo "ALL_CFLAGS: $(ALL_CFLAGS)"
+ @echo "ALL_LDFLAGS: $(ALL_LDFLAGS)"
+ @echo "ALL_LIBS: $(ALL_LIBS)"
+ @echo "PD_INCLUDE: $(PD_INCLUDE)"
+ @echo "PD_PATH: $(PD_PATH)"
+ @echo "objectsdir: $(objectsdir)"
+ @echo "LIBRARY_NAME: $(LIBRARY_NAME)"
+ @echo "LIBRARY_VERSION: $(LIBRARY_VERSION)"
+ @echo "SOURCES: $(SOURCES)"
+ @echo "SHARED_HEADER: $(SHARED_HEADER)"
+ @echo "SHARED_SOURCE: $(SHARED_SOURCE)"
+ @echo "SHARED_LIB: $(SHARED_LIB)"
+ @echo "SHARED_TCL_LIB: $(SHARED_TCL_LIB)"
+ @echo "PDOBJECTS: $(PDOBJECTS)"
+ @echo "ALLSOURCES: $(ALLSOURCES)"
+ @echo "ALLSOURCES TCL: $(wildcard $(ALLSOURCES:.c=.tcl))"
+ @echo "UNAME: $(UNAME)"
+ @echo "CPU: $(CPU)"
+ @echo "pkglibdir: $(pkglibdir)"
+ @echo "DISTDIR: $(DISTDIR)"
+ @echo "ORIGDIR: $(ORIGDIR)"
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..afbef9b
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,21 @@
+testtools
+
+----------------------------------------------------------------------------------------------------
+
+Abstractions to produce unit test patches for Pd objects. See example patches for howto. Suggestion: use uniform suffix 'unittest' in test patch names.
+
+unit test abstractions:
+unit-test-frame.pd
+unit-test-frame~.pd
+
+unit test example patches:
+example-unittest.pd
+example~-unittest.pd
+
+reference files:
+example.wav
+example~.wav
+
+Katja Vetter and Fred Jan Kraan November 2011
+
+---------------------------------------------------------------------------------------------------- \ No newline at end of file
diff --git a/unit-test-frame-example.pd b/examples/example-unittest.pd
index ae658c1..c2bea09 100644
--- a/unit-test-frame-example.pd
+++ b/examples/example-unittest.pd
@@ -1,4 +1,6 @@
-#N canvas 336 28 746 629 10;
+#N canvas 87 55 746 629 10;
+#X declare -path ../;
+#X declare -stdpath extra/testtools/;
#X obj 53 300 unit-test-frame;
#X obj 26 104 cnv 15 150 150 empty empty empty 20 12 0 14 -233017 -66577
0;
@@ -10,7 +12,6 @@
-66577 0;
#X obj 374 200 sqrt;
#X obj 374 156 / 512;
-#X msg 53 226 unit-test-frame-example 0;
#X text 495 278 more info behind the question mark;
#X text 358 18 Optionally use index 0 - 511 to get a series of outputs
from the object or system under test.;
@@ -18,8 +19,11 @@ from the object or system under test.;
#X text 394 112 system under test;
#X text 358 52 Normalizing the object output is recommendable \, as
it makes stddev more meaningful.;
+#X msg 53 226 example 0;
+#X obj 28 19 declare -path ../;
+#X obj 28 51 declare -stdpath extra/testtools/;
#X connect 0 2 8 0;
-#X connect 5 0 9 0;
+#X connect 5 0 14 0;
#X connect 7 0 0 1;
#X connect 8 0 7 0;
-#X connect 9 0 0 0;
+#X connect 14 0 0 0;
diff --git a/unit-test-frame-example.wav b/examples/example.wav
index 1e79eee..1e79eee 100644
--- a/unit-test-frame-example.wav
+++ b/examples/example.wav
Binary files differ
diff --git a/unit-test-frame~-example.pd b/examples/example~-unittest.pd
index 39cefd1..cc3cd1b 100644
--- a/unit-test-frame~-example.pd
+++ b/examples/example~-unittest.pd
@@ -1,4 +1,6 @@
-#N canvas 426 40 714 575 10;
+#N canvas 81 36 714 575 10;
+#X declare -path ../;
+#X declare -stdpath extra/testtools/;
#X obj 37 297 unit-test-frame~;
#X obj 333 113 cnv 15 150 150 empty empty empty 20 12 0 14 -233017
-66577 0;
@@ -20,7 +22,9 @@ reset phase at test start.;
\, set a non-zero delay time (between test trigger and test snapshot).
This is needed to get the same test result every time \, independent
of the signal input history.;
-#X msg 37 233 unit-test-frame~-example 200;
+#X msg 37 233 example~ 200;
+#X obj 486 16 declare -path ../;
+#X obj 486 45 declare -stdpath extra/testtools/;
#X connect 0 2 2 0;
#X connect 2 0 3 1;
#X connect 3 0 4 0;
diff --git a/unit-test-frame~-example.wav b/examples/example~.wav
index 918c233..918c233 100644
--- a/unit-test-frame~-example.wav
+++ b/examples/example~.wav
Binary files differ
diff --git a/unit-test-frame.pd b/unit-test-frame.pd
index 9cd29ba..eb872b1 100644
--- a/unit-test-frame.pd
+++ b/unit-test-frame.pd
@@ -1,4 +1,4 @@
-#N canvas 435 37 710 662 10;
+#N canvas 66 59 710 662 10;
#X obj 620 302 bng 50 250 50 0 empty empty list 5 25 0 14 -203904 -262144
-1;
#X obj 315 301 bng 50 250 50 0 empty empty list 5 25 0 14 -203904 -262144
@@ -83,61 +83,7 @@ STDDEV-ZERO 4 35 0 10 -203904 -203904 -1 0 1;
#X connect 27 0 22 0;
#X connect 28 0 26 0;
#X restore 327 123 pd std.deviation;
-#N canvas 905 83 262 193 refname+ID 0;
-#X obj 26 47 inlet;
-#X obj 71 96 f \$0;
-#X obj 26 120 pack s f;
-#X obj 26 74 t a b;
-#X obj 26 152 s \$0-refname+ID;
-#X connect 0 0 3 0;
-#X connect 1 0 2 1;
-#X connect 2 0 4 0;
-#X connect 3 0 2 0;
-#X connect 3 1 1 0;
-#X restore 56 129 pd refname+ID;
-#X obj 39 177 s \$0-refname;
-#X obj 39 153 symbol;
#X obj 39 23 inlet;
-#N canvas 67 138 412 506 load-reference 0;
-#X obj 36 27 inlet;
-#X obj 36 203 soundfiler;
-#X obj 81 112 f \$0;
-#X obj 36 136 pack s f;
-#X obj 36 94 t a b;
-#X obj 36 461 s \$0-do-test;
-#X msg 36 173 read ./\$1.wav \$2-reference;
-#X obj 75 375 pack s s s s s s;
-#X obj 168 297 r \$0-refname;
-#X obj 75 432 stdout;
-#X obj 36 235 sel 512;
-#X obj 36 60 spigot 1;
-#X msg 81 27 0;
-#X text 119 29 at load \, try to read reference file and do test;
-#X msg 75 271 REFERENCE-FILE-ERROR reference file not found:;
-#X msg 168 324 \$1.wav;
-#X obj 168 349 symbol;
-#X obj 75 402 list trim;
-#X obj 127 432 print unit-test;
-#X connect 0 0 11 0;
-#X connect 1 0 10 0;
-#X connect 2 0 3 1;
-#X connect 3 0 6 0;
-#X connect 4 0 3 0;
-#X connect 4 1 2 0;
-#X connect 6 0 1 0;
-#X connect 7 0 17 0;
-#X connect 8 0 15 0;
-#X connect 10 0 5 0;
-#X connect 10 1 14 0;
-#X connect 11 0 4 0;
-#X connect 11 0 12 0;
-#X connect 12 0 11 1;
-#X connect 14 0 7 0;
-#X connect 15 0 16 0;
-#X connect 16 0 7 5;
-#X connect 17 0 9 0;
-#X connect 17 0 18 0;
-#X restore 74 105 pd load-reference;
#X obj 328 27 inlet;
#X obj 630 22 inlet;
#X obj 238 628 outlet;
@@ -214,93 +160,6 @@ STDDEV-ZERO 4 35 0 10 -203904 -203904 -1 0 1;
#X connect 3 0 4 0;
#X connect 4 0 2 0;
#X restore 100 507 pd view-reference;
-#N canvas 704 28 384 625 write-reference 0;
-#X obj 51 344 soundfiler;
-#X obj 51 287 list;
-#X obj 50 16 inlet;
-#X floatatom 82 378 5 0 0 0 - - -;
-#X obj 72 257 r \$0-refname+ID;
-#X text 90 16 bang;
-#X obj 51 124 r \$0-do-write-reference;
-#X obj 143 152 r \$0-abort-write-reference;
-#X obj 51 379 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
--1;
-#X obj 51 583 s \$0-do-test;
-#X obj 72 153 delay 500;
-#X obj 257 20 r \$0-refname;
-#X msg 257 46 \$1.wav;
-#X obj 257 72 symbol;
-#X obj 257 99 s \$0-ref-wav-name;
-#N canvas 682 430 395 255 write-reference-popup\$0 0;
-#X obj 88 174 bng 60 400 50 0 \$0-do-write-reference empty continue
-2 28 0 12 -260097 -262144 -1;
-#X obj 234 174 bng 60 300 50 0 \$0-abort-write-reference empty abort
-8 28 0 12 -204786 -262144 -1;
-#X obj 91 67 hsl 200 80 0 127 0 0 \$0-dummysend \$0-dummyreceive empty
--2 -8 0 10 -262144 -262144 -1 0 1;
-#X symbolatom 95 85 30 0 0 0 - #0-refname #0-dummysend;
-#X symbolatom 95 125 30 0 0 0 - #0-ref-wav-name #0-dummysend;
-#X text 93 67 reference name:;
-#X text 93 108 file name:;
-#X text 24 11 This action will overwrite your reference .wav file with
-the content of \$0-signal-under-test. The action can not be undone!
-;
-#X restore 51 95 pd write-reference-popup\$0;
-#X obj 50 68 s pd-write-reference-popup\$0;
-#X msg 50 43 vis 1;
-#X obj 72 230 s pd-write-reference-popup\$0;
-#X msg 72 205 vis 0;
-#X obj 143 180 delay 200;
-#X msg 51 315 write -wave -bytes 4 \$1 \$2-system-under-test;
-#N canvas 528 482 203 281 index0-511 0;
-#X obj 41 49 inlet;
-#X obj 41 224 outlet;
-#X obj 41 139 until;
-#X msg 41 107 512;
-#X obj 41 169 f;
-#X obj 72 169 + 1;
-#X obj 41 79 t b b;
-#X msg 80 139 0;
-#X connect 0 0 6 0;
-#X connect 2 0 4 0;
-#X connect 3 0 2 0;
-#X connect 4 0 5 0;
-#X connect 4 0 1 0;
-#X connect 5 0 4 1;
-#X connect 6 0 3 0;
-#X connect 6 1 7 0;
-#X connect 7 0 4 1;
-#X restore 51 411 pd index0-511;
-#X obj 70 476 tabread \$0-system-under-test;
-#X obj 70 511 tabwrite \$0-reference;
-#X obj 51 535 == 511;
-#X obj 51 443 t f f f;
-#X obj 51 559 sel 1;
-#X connect 0 0 3 0;
-#X connect 0 0 8 0;
-#X connect 1 0 21 0;
-#X connect 2 0 17 0;
-#X connect 4 0 1 1;
-#X connect 6 0 1 0;
-#X connect 6 0 10 0;
-#X connect 7 0 20 0;
-#X connect 8 0 22 0;
-#X connect 10 0 19 0;
-#X connect 11 0 12 0;
-#X connect 12 0 13 0;
-#X connect 13 0 14 0;
-#X connect 17 0 16 0;
-#X connect 19 0 18 0;
-#X connect 20 0 19 0;
-#X connect 21 0 0 0;
-#X connect 22 0 26 0;
-#X connect 23 0 24 0;
-#X connect 25 0 27 0;
-#X connect 26 0 25 0;
-#X connect 26 1 23 0;
-#X connect 26 2 24 1;
-#X connect 27 0 9 0;
-#X restore 40 208 pd write-reference;
#N canvas 739 28 261 427 test-result-messages 0;
#X obj 32 23 inlet;
#X obj 59 310 stdout;
@@ -495,7 +354,7 @@ is computed. A test result message is sent to the Pd window and stdout:
#X obj 29 39 loadbang;
#X obj 32 407 bng 50 250 50 0 empty empty test 5 25 0 14 -260097 -262144
-1;
-#X obj 38 555 bng 50 250 50 0 empty empty write 4 25 0 14 -260097 -262144
+#X obj 33 555 bng 50 250 50 0 empty empty write 4 25 0 14 -260097 -262144
-1;
#X text 124 714 ------------------------------------------------------------
;
@@ -517,9 +376,6 @@ an external object \, consider instantiating it with namespace \, like
latest release). Use button 'write'. The file will have 512 samples
in 32 bit .wav format. Even though the test output is not a signal
\, this is a good format to write.;
-#X text 124 733 [unit-test-frame.pd] uses only vanilla Pd classes.
-For testing external classes \, consider using namespaces like in [zexy/wrap].
-;
#X text 130 203 Use a bang from one of [unit-test-frame.pd] outlets
to trigger the object(s) when the test starts. Or use the index 0 -
511 outlet to generate a series of output values.;
@@ -529,6 +385,9 @@ stddev. Also note that large numbers are unprecise. Example: the difference
between 1e+12 in single precision and 1e+12 in double precision is
27968! Try this on:;
#X text 149 345 http://www.h-schmidt.net/FloatApplet/IEEE754.html;
+#X text 124 733 Apart from [ggee/getdir] \, [unit-test-frame.pd] uses
+only vanilla Pd classes. For testing external classes \, consider using
+namespaces like in [zexy/wrap].;
#X connect 17 0 24 0;
#X connect 21 0 25 0;
#X restore 555 165 pd info-unit-test\$0;
@@ -536,33 +395,202 @@ between 1e+12 in single precision and 1e+12 in double precision is
#X obj 384 629 outlet;
#X obj 238 577 t b b b b;
#X text 209 481 test-bang out;
-#X connect 0 0 30 0;
-#X connect 1 0 29 0;
-#X connect 2 0 31 0;
-#X connect 3 0 55 0;
-#X connect 6 0 28 0;
-#X connect 7 0 32 0;
-#X connect 11 0 33 0;
-#X connect 11 0 47 0;
-#X connect 14 0 13 0;
-#X connect 15 0 25 0;
-#X connect 17 0 36 0;
-#X connect 22 0 60 0;
-#X connect 23 0 24 0;
-#X connect 23 0 58 0;
-#X connect 25 0 14 0;
-#X connect 25 0 12 0;
-#X connect 25 0 16 0;
-#X connect 25 1 26 0;
-#X connect 28 0 22 0;
-#X connect 28 1 37 0;
-#X connect 28 2 23 0;
-#X connect 36 0 27 0;
-#X connect 38 0 6 0;
-#X connect 39 0 21 0;
-#X connect 55 0 56 0;
-#X connect 60 0 19 0;
-#X connect 60 1 20 0;
-#X connect 60 2 39 0;
-#X connect 60 3 59 0;
+#X obj 39 183 s \$0-refname;
+#X obj 39 74 symbol;
+#N canvas 673 76 412 506 load-reference 0;
+#X obj 36 27 inlet;
+#X obj 36 203 soundfiler;
+#X obj 81 112 f \$0;
+#X obj 36 136 pack s f;
+#X obj 36 94 t a b;
+#X obj 36 461 s \$0-do-test;
+#X obj 75 375 pack s s s s s s;
+#X obj 168 297 r \$0-refname;
+#X obj 75 432 stdout;
+#X obj 36 235 sel 512;
+#X obj 36 60 spigot 1;
+#X msg 81 27 0;
+#X text 119 29 at load \, try to read reference file and do test;
+#X msg 75 271 REFERENCE-FILE-ERROR reference file not found:;
+#X msg 168 324 \$1.wav;
+#X obj 168 349 symbol;
+#X obj 75 402 list trim;
+#X obj 127 432 print unit-test;
+#X msg 125 135 read ./\$1.wav \$2-reference;
+#X msg 36 173 read \$1.wav \$2-reference;
+#X connect 0 0 10 0;
+#X connect 1 0 9 0;
+#X connect 2 0 3 1;
+#X connect 3 0 19 0;
+#X connect 4 0 3 0;
+#X connect 4 1 2 0;
+#X connect 6 0 16 0;
+#X connect 7 0 14 0;
+#X connect 9 0 5 0;
+#X connect 9 1 13 0;
+#X connect 10 0 4 0;
+#X connect 10 0 11 0;
+#X connect 11 0 10 1;
+#X connect 13 0 6 0;
+#X connect 14 0 15 0;
+#X connect 15 0 6 5;
+#X connect 16 0 8 0;
+#X connect 16 0 17 0;
+#X connect 19 0 1 0;
+#X restore 58 155 pd load-reference;
+#N canvas 405 322 429 358 prepend-path 0;
+#X obj 21 13 inlet;
+#X obj 48 131 ggee/getdir 2;
+#X obj 48 104 t b a;
+#X obj 21 283 spigot 1;
+#X msg 66 235 0;
+#X obj 21 45 t a a;
+#X obj 21 169 pack s s;
+#X msg 21 200 \$1/\$2;
+#X msg 102 235 1;
+#X obj 102 266 pipe 100;
+#X obj 21 314 outlet;
+#X text 76 11 Try to prepend absolute path of the abstraction's parent.
+If [ggee/getdir] is not present \, the path is relative to the abstraction.
+;
+#X msg 21 75 .;
+#X connect 0 0 5 0;
+#X connect 1 0 6 0;
+#X connect 2 0 1 0;
+#X connect 2 1 6 1;
+#X connect 3 0 4 0;
+#X connect 3 0 8 0;
+#X connect 3 0 10 0;
+#X connect 4 0 3 1;
+#X connect 5 0 12 0;
+#X connect 5 1 2 0;
+#X connect 6 0 7 0;
+#X connect 7 0 3 0;
+#X connect 8 0 9 0;
+#X connect 9 0 3 1;
+#X connect 12 0 6 0;
+#X restore 58 101 pd prepend-path;
+#X obj 71 130 s \$0-refpath;
+#N canvas 240 70 389 572 write-reference 1;
+#X obj 51 436 soundfiler;
+#X obj 51 379 list;
+#X obj 50 16 inlet;
+#X floatatom 82 470 5 0 0 0 - - -;
+#X text 90 16 bang;
+#X obj 51 124 r \$0-do-write-reference;
+#X obj 143 152 r \$0-abort-write-reference;
+#X obj 51 471 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
+-1;
+#X obj 51 532 s \$0-do-test;
+#X obj 72 153 delay 500;
+#X msg 257 46 \$1.wav;
+#X obj 257 71 symbol;
+#X obj 257 99 s \$0-ref-wav-name;
+#N canvas 574 380 410 288 write-reference-popup\$0 0;
+#X obj 97 197 bng 60 400 50 0 \$0-do-write-reference empty continue
+2 28 0 12 -260097 -262144 -1;
+#X obj 231 197 bng 60 300 50 0 \$0-abort-write-reference empty abort
+8 28 0 12 -204786 -262144 -1;
+#X obj 29 67 hsl 350 100 0 127 0 0 \$0-dummysend \$0-dummyreceive empty
+-2 -8 0 10 -262144 -262144 -1 0 1;
+#X symbolatom 33 85 30 0 0 0 - #0-refname #0-dummysend;
+#X symbolatom 33 127 30 0 0 0 - #0-ref-wav-name #0-dummysend;
+#X text 31 67 reference name:;
+#X text 31 108 file name:;
+#X text 24 11 This action will overwrite your reference .wav file with
+the content of \$0-signal-under-test. The action can not be undone!
+;
+#X restore 51 95 pd write-reference-popup\$0;
+#X obj 50 68 s pd-write-reference-popup\$0;
+#X msg 50 43 vis 1;
+#X obj 72 230 s pd-write-reference-popup\$0;
+#X msg 72 205 vis 0;
+#X obj 143 177 delay 200;
+#X obj 72 264 r \$0-refpath;
+#X obj 72 292 t a b;
+#X obj 99 321 f \$0;
+#X obj 72 350 pack s f;
+#X msg 51 407 write -wave -bytes 4 \$1 \$2-system-under-test;
+#X obj 257 20 r \$0-refname;
+#N canvas 0 22 282 435 copy-to-reference 0;
+#X obj 36 50 inlet;
+#X msg 36 105 512;
+#X obj 36 136 until;
+#X obj 36 198 f;
+#X obj 68 198 + 1;
+#X obj 36 80 t b b;
+#X msg 51 169 0;
+#X obj 55 270 tabread \$0-system-under-test;
+#X obj 55 307 tabwrite \$0-reference;
+#X obj 36 332 == 511;
+#X obj 36 236 t f f f;
+#X obj 36 363 outlet;
+#X connect 0 0 5 0;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 3 0 4 0;
+#X connect 3 0 10 0;
+#X connect 4 0 3 1;
+#X connect 5 0 1 0;
+#X connect 5 1 6 0;
+#X connect 6 0 3 1;
+#X connect 7 0 8 0;
+#X connect 9 0 11 0;
+#X connect 10 0 9 0;
+#X connect 10 1 7 0;
+#X connect 10 2 8 1;
+#X restore 51 499 pd copy-to-reference;
+#X connect 0 0 3 0;
+#X connect 0 0 7 0;
+#X connect 1 0 23 0;
+#X connect 2 0 15 0;
+#X connect 5 0 1 0;
+#X connect 5 0 9 0;
+#X connect 6 0 18 0;
+#X connect 7 0 25 0;
+#X connect 9 0 17 0;
+#X connect 10 0 11 0;
+#X connect 11 0 12 0;
+#X connect 15 0 14 0;
+#X connect 17 0 16 0;
+#X connect 18 0 17 0;
+#X connect 19 0 20 0;
+#X connect 20 0 22 0;
+#X connect 20 1 21 0;
+#X connect 21 0 22 1;
+#X connect 22 0 1 1;
+#X connect 23 0 0 0;
+#X connect 24 0 10 0;
+#X connect 25 0 8 0;
+#X restore 39 208 pd write-reference;
+#X connect 0 0 26 0;
+#X connect 1 0 25 0;
+#X connect 2 0 27 0;
+#X connect 3 0 50 0;
+#X connect 6 0 24 0;
+#X connect 7 0 62 0;
+#X connect 11 0 28 0;
+#X connect 11 0 42 0;
+#X connect 12 0 21 0;
+#X connect 13 0 31 0;
+#X connect 18 0 55 0;
+#X connect 19 0 20 0;
+#X connect 19 0 53 0;
+#X connect 21 0 58 0;
+#X connect 21 1 22 0;
+#X connect 24 0 18 0;
+#X connect 24 1 32 0;
+#X connect 24 2 19 0;
+#X connect 31 0 23 0;
+#X connect 33 0 6 0;
+#X connect 34 0 17 0;
+#X connect 50 0 51 0;
+#X connect 55 0 15 0;
+#X connect 55 1 16 0;
+#X connect 55 2 34 0;
+#X connect 55 3 54 0;
+#X connect 58 0 57 0;
+#X connect 58 0 60 0;
+#X connect 60 0 59 0;
+#X connect 60 0 61 0;
#X coords 0 -1 1 1 650 270 2 30 230;
diff --git a/unit-test-frame~.pd b/unit-test-frame~.pd
index 9d9873c..085d74a 100644
--- a/unit-test-frame~.pd
+++ b/unit-test-frame~.pd
@@ -1,19 +1,18 @@
-#N canvas 433 135 724 590 10;
-#N canvas 213 116 398 498 write-reference 0;
-#X obj 51 344 soundfiler;
-#X obj 51 287 list;
+#N canvas 61 63 724 590 10;
+#N canvas 654 121 435 584 write-reference 0;
+#X obj 51 436 soundfiler;
+#X obj 51 379 list;
#X obj 50 16 inlet;
-#X floatatom 82 378 5 0 0 0 - - -;
-#X obj 72 257 r \$0-refname+ID;
+#X floatatom 82 470 5 0 0 0 - - -;
#X text 90 16 bang;
#X obj 51 124 r \$0-do-write-reference;
#X obj 143 152 r \$0-abort-write-reference;
-#X obj 51 379 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
+#X obj 51 471 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
-#X obj 241 446 s \$0-do-test;
-#X obj 70 408 tabplay~ \$0-signal-under-test;
-#X msg 51 315 write -wave -bytes 4 \$1 \$2-signal-under-test;
-#X obj 51 450 tabwrite~ \$0-reference;
+#X obj 241 538 s \$0-do-test;
+#X obj 70 500 tabplay~ \$0-signal-under-test;
+#X msg 51 407 write -wave -bytes 4 \$1 \$2-signal-under-test;
+#X obj 51 542 tabwrite~ \$0-reference;
#X obj 72 153 delay 500;
#X obj 257 20 r \$0-refname;
#X msg 257 46 \$1.wav;
@@ -39,26 +38,34 @@ the content of \$0-signal-under-test. The action can not be undone!
#X obj 72 230 s pd-write-reference-popup\$0;
#X msg 72 205 vis 0;
#X obj 143 177 delay 200;
+#X obj 72 264 r \$0-refpath;
+#X obj 72 292 t a b;
+#X obj 99 321 f \$0;
+#X obj 72 350 pack s f;
#X connect 0 0 3 0;
-#X connect 0 0 8 0;
-#X connect 1 0 11 0;
-#X connect 2 0 20 0;
-#X connect 4 0 1 1;
-#X connect 6 0 1 0;
-#X connect 6 0 13 0;
-#X connect 7 0 23 0;
-#X connect 8 0 10 0;
-#X connect 8 0 12 0;
-#X connect 10 0 12 0;
-#X connect 10 1 9 0;
-#X connect 11 0 0 0;
-#X connect 13 0 22 0;
+#X connect 0 0 7 0;
+#X connect 1 0 10 0;
+#X connect 2 0 19 0;
+#X connect 5 0 1 0;
+#X connect 5 0 12 0;
+#X connect 6 0 22 0;
+#X connect 7 0 9 0;
+#X connect 7 0 11 0;
+#X connect 9 0 11 0;
+#X connect 9 1 8 0;
+#X connect 10 0 0 0;
+#X connect 12 0 21 0;
+#X connect 13 0 14 0;
#X connect 14 0 15 0;
#X connect 15 0 16 0;
-#X connect 16 0 17 0;
-#X connect 20 0 19 0;
+#X connect 19 0 18 0;
+#X connect 21 0 20 0;
#X connect 22 0 21 0;
-#X connect 23 0 22 0;
+#X connect 23 0 24 0;
+#X connect 24 0 26 0;
+#X connect 24 1 25 0;
+#X connect 25 0 26 1;
+#X connect 26 0 1 1;
#X restore 43 219 pd write-reference;
#X obj 42 319 bng 50 250 50 0 empty empty write 4 25 0 14 -260097 -262144
-1;
@@ -156,19 +163,7 @@ the content of \$0-signal-under-test. The action can not be undone!
#X restore 255 137 pd check-samplerate;
#X msg 619 125 \; pd dsp 1;
#X obj 619 95 loadbang;
-#N canvas 905 83 262 193 refname+ID 0;
-#X obj 26 47 inlet;
-#X obj 71 96 f \$0;
-#X obj 26 120 pack s f;
-#X obj 26 74 t a b;
-#X obj 26 152 s \$0-refname+ID;
-#X connect 0 0 3 0;
-#X connect 1 0 2 1;
-#X connect 2 0 4 0;
-#X connect 3 0 2 0;
-#X connect 3 1 1 0;
-#X restore 46 134 pd refname+ID;
-#X obj 29 190 s \$0-refname;
+#X obj 29 188 s \$0-refname;
#X obj 472 390 hsl 195 100 0 127 0 0 empty empty empty -2 -8 0 10 -204786
-204786 -1 0 1;
#N canvas 0 22 450 300 (subpatch) 0;
@@ -187,7 +182,6 @@ the content of \$0-signal-under-test. The action can not be undone!
#X array \$0-signal-under-test 512 float 0;
#X coords 0 1 511 -1 200 100 1;
#X restore 255 390 graph;
-#X text 63 13 reference name;
#X obj 294 550 outlet;
#X obj 267 518 t b b;
#N canvas 739 28 261 427 test-result-messages 0;
@@ -253,7 +247,7 @@ STDDEV-ZERO 4 35 0 10 -204786 -204786 -1 0 1;
#X obj 618 257 bng 50 250 50 0 empty empty ? 15 25 0 30 -260097 -262144
-1;
#X floatatom 475 325 18 0 0 0 - #0-stddev -;
-#X obj 29 162 symbol;
+#X obj 29 68 symbol;
#X obj 45 258 hsl 195 50 0 112 0 0 \$0-dummysend \$0-dummyreceive empty
-2 -8 0 10 -204786 -204786 -1 0 1;
#X symbolatom 47 266 25 0 0 0 - #0-refname #0-dummysend;
@@ -304,14 +298,13 @@ STDDEV-ZERO 4 35 0 10 -204786 -204786 -1 0 1;
#X text 300 12 signal under test;
#X obj 463 257 cnv 15 150 25 empty empty [unit-test-frame~] 2 12 0
14 -262144 -1 0;
-#N canvas 67 138 412 506 load-reference 0;
+#N canvas 673 76 412 506 load-reference 0;
#X obj 36 27 inlet;
#X obj 36 203 soundfiler;
#X obj 81 112 f \$0;
#X obj 36 136 pack s f;
#X obj 36 94 t a b;
#X obj 36 461 s \$0-do-test;
-#X msg 36 173 read ./\$1.wav \$2-reference;
#X obj 75 375 pack s s s s s s;
#X obj 168 297 r \$0-refname;
#X obj 75 432 stdout;
@@ -324,26 +317,28 @@ STDDEV-ZERO 4 35 0 10 -204786 -204786 -1 0 1;
#X obj 168 349 symbol;
#X obj 75 402 list trim;
#X obj 127 432 print unit-test;
-#X connect 0 0 11 0;
-#X connect 1 0 10 0;
+#X msg 125 135 read ./\$1.wav \$2-reference;
+#X msg 36 173 read \$1.wav \$2-reference;
+#X connect 0 0 10 0;
+#X connect 1 0 9 0;
#X connect 2 0 3 1;
-#X connect 3 0 6 0;
+#X connect 3 0 19 0;
#X connect 4 0 3 0;
#X connect 4 1 2 0;
-#X connect 6 0 1 0;
-#X connect 7 0 17 0;
-#X connect 8 0 15 0;
-#X connect 10 0 5 0;
-#X connect 10 1 14 0;
-#X connect 11 0 4 0;
-#X connect 11 0 12 0;
-#X connect 12 0 11 1;
-#X connect 14 0 7 0;
-#X connect 15 0 16 0;
-#X connect 16 0 7 5;
-#X connect 17 0 9 0;
-#X connect 17 0 18 0;
-#X restore 64 104 pd load-reference;
+#X connect 6 0 16 0;
+#X connect 7 0 14 0;
+#X connect 9 0 5 0;
+#X connect 9 1 13 0;
+#X connect 10 0 4 0;
+#X connect 10 0 11 0;
+#X connect 11 0 10 1;
+#X connect 13 0 6 0;
+#X connect 14 0 15 0;
+#X connect 15 0 6 5;
+#X connect 16 0 8 0;
+#X connect 16 0 17 0;
+#X connect 19 0 1 0;
+#X restore 48 159 pd load-reference;
#N canvas 473 125 566 541 info-unit-test\$0 0;
#X text 144 337 STDDEV-ZERO 0;
#X text 144 379 STDDEV-LARGE <stddev>;
@@ -365,9 +360,6 @@ STDDEV-ZERO 4 35 0 10 -204786 -204786 -1 0 1;
#X text 127 421 The reference file must be in the same directory as
the test. If it is not found when the patch is loaded \, an error is
reported to the Pd window and stdout:;
-#X text 124 694 [unit-test-frame~.pd] uses only vanilla Pd classes.
-For testing external classes \, consider using namespaces like in [zexy/wrap].
-;
#X text 122 782 ------------------------------------------------------------
;
#X text 129 67 1: Test arguments must be sent as a list into the first
@@ -409,8 +401,11 @@ to reset a phase etc. when the test starts.;
#X text 129 155 2: The signal under test must be sent into the second
inlet. When testing an external object \, consider instantiating it
with namespace \, like [zexy/wrap].;
-#X connect 25 0 23 0;
-#X connect 29 0 30 0;
+#X text 127 692 Apart from [ggee/getdir] \, [unit-test-frame~.pd] uses
+only vanilla Pd classes. For testing external classes \, consider using
+namespaces like in [zexy/wrap].;
+#X connect 24 0 22 0;
+#X connect 28 0 29 0;
#X restore 488 96 pd info-unit-test\$0;
#X msg 538 512 vis 1;
#X text 337 215 auto-test (after loading / writing reference);
@@ -430,31 +425,66 @@ with namespace \, like [zexy/wrap].;
#X connect 4 0 2 0;
#X connect 4 0 2 1;
#X restore 276 63 pd listen;
+#N canvas 405 322 429 358 prepend-path 0;
+#X obj 21 13 inlet;
+#X obj 48 131 ggee/getdir 2;
+#X obj 48 104 t b a;
+#X obj 21 283 spigot 1;
+#X msg 66 235 0;
+#X obj 21 45 t a a;
+#X obj 21 169 pack s s;
+#X msg 21 200 \$1/\$2;
+#X msg 102 235 1;
+#X obj 102 266 pipe 100;
+#X obj 21 314 outlet;
+#X text 76 11 Try to prepend absolute path of the abstraction's parent.
+If [ggee/getdir] is not present \, the path is relative to the abstraction.
+;
+#X msg 21 75 .;
+#X connect 0 0 5 0;
+#X connect 1 0 6 0;
+#X connect 2 0 1 0;
+#X connect 2 1 6 1;
+#X connect 3 0 4 0;
+#X connect 3 0 8 0;
+#X connect 3 0 10 0;
+#X connect 4 0 3 1;
+#X connect 5 0 12 0;
+#X connect 5 1 2 0;
+#X connect 6 0 7 0;
+#X connect 7 0 3 0;
+#X connect 8 0 9 0;
+#X connect 9 0 3 1;
+#X connect 12 0 6 0;
+#X restore 48 105 pd prepend-path;
+#X text 68 13 reference name + delay;
+#X obj 64 132 s \$0-refpath;
#X connect 1 0 0 0;
-#X connect 2 0 18 0;
+#X connect 2 0 16 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
-#X connect 5 0 19 0;
+#X connect 5 0 17 0;
#X connect 7 0 6 0;
-#X connect 18 0 36 0;
-#X connect 18 1 17 0;
-#X connect 18 1 34 0;
-#X connect 18 1 35 0;
-#X connect 22 0 52 0;
-#X connect 24 0 9 0;
-#X connect 27 0 2 0;
-#X connect 30 0 32 0;
-#X connect 36 0 3 1;
-#X connect 36 0 29 0;
-#X connect 37 0 3 0;
-#X connect 37 0 57 0;
-#X connect 38 0 40 0;
-#X connect 40 0 24 0;
-#X connect 40 0 50 0;
-#X connect 40 0 8 0;
-#X connect 40 1 36 1;
-#X connect 40 1 46 0;
-#X connect 41 0 31 0;
-#X connect 42 0 33 0;
-#X connect 52 0 54 0;
+#X connect 16 0 34 0;
+#X connect 16 1 15 0;
+#X connect 16 1 32 0;
+#X connect 16 1 33 0;
+#X connect 20 0 50 0;
+#X connect 22 0 8 0;
+#X connect 22 0 56 0;
+#X connect 25 0 2 0;
+#X connect 28 0 30 0;
+#X connect 34 0 3 1;
+#X connect 34 0 27 0;
+#X connect 35 0 3 0;
+#X connect 35 0 55 0;
+#X connect 36 0 38 0;
+#X connect 38 0 22 0;
+#X connect 38 1 34 1;
+#X connect 38 1 44 0;
+#X connect 39 0 29 0;
+#X connect 40 0 31 0;
+#X connect 50 0 52 0;
+#X connect 56 0 58 0;
+#X connect 56 0 48 0;
#X coords 0 -1 1 1 650 250 2 30 250;