r3998 - in trunk: . tests tests/bse tests/filecheck
- From: timj svn gnome org
- To: svn-commits-list gnome org
- Subject: r3998 - in trunk: . tests tests/bse tests/filecheck
- Date: Sat, 21 Oct 2006 11:46:49 -0400 (EDT)
Author: timj
Date: 2006-10-21 11:46:43 -0400 (Sat, 21 Oct 2006)
New Revision: 3998
Modified:
trunk/ChangeLog
trunk/Makefile.am
trunk/tests/Makefile.am
trunk/tests/bse/Makefile.am
trunk/tests/filecheck/Makefile.am
trunk/tests/testwavechunk.c
Log:
Sat Oct 21 17:44:03 2006 Tim Janik <timj gtk org>
* tests/testwavechunk.c: refactored to sanitize print outs
and to run slow tests seperately.
* tests/bse/Makefile.am: moved cxxbinding test to slow tests.
* tests/Makefile.am: speed up resampler quick tests by using
larger steppings in the frequency scanning.
* tests/filecheck/Makefile.am: moved loading tests to slowcheck.
* Makefile.am: ignore report.out on distcleanchecks.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-10-21 15:41:40 UTC (rev 3997)
+++ trunk/ChangeLog 2006-10-21 15:46:43 UTC (rev 3998)
@@ -1,3 +1,17 @@
+Sat Oct 21 17:44:03 2006 Tim Janik <timj gtk org>
+
+ * tests/testwavechunk.c: refactored to sanitize print outs
+ and to run slow tests seperately.
+
+ * tests/bse/Makefile.am: moved cxxbinding test to slow tests.
+
+ * tests/Makefile.am: speed up resampler quick tests by using
+ larger steppings in the frequency scanning.
+
+ * tests/filecheck/Makefile.am: moved loading tests to slowcheck.
+
+ * Makefile.am: ignore report.out on distcleanchecks.
+
Sat Oct 21 04:01:11 2006 Tim Janik <timj gtk org>
* Makefile.decl: preinitialize TESTS, auto-check SLOWTESTS and
Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am 2006-10-21 15:41:40 UTC (rev 3997)
+++ trunk/Makefile.am 2006-10-21 15:46:43 UTC (rev 3998)
@@ -41,7 +41,7 @@
@echo $(ALL_CHECKED_MSG) | sed 's/./=/g'
# fixup automake-1.9.6 distuninstallcheck:-rule reporting files created by update-mime-database(1)
-filter_stale_uninstalled = | egrep -v '^.*/share/mime/(subclasses|globs|magic|XMLnamespaces|aliases)$$'
+filter_stale_uninstalled = | egrep -v '^.*/share/mime/(subclasses|globs|magic|XMLnamespaces|aliases)|./report.out$$'
distuninstallcheck_listfiles = find . -type f -print # standard automake-1.9 setting
distuninstallcheck_listfiles += $(filter_stale_uninstalled) # amend by required filtering
# fixup automake-1.9.6 distcheck:-rule, which attempts to rebuild a dist tarball from within the test-build
@@ -71,9 +71,7 @@
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) install \
- && $(MAKE) $(AM_MAKEFLAGS) check \
- && $(MAKE) $(AM_MAKEFLAGS) slowcheck \
- && $(MAKE) $(AM_MAKEFLAGS) perf \
+ && $(MAKE) $(AM_MAKEFLAGS) report \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
Modified: trunk/tests/Makefile.am
===================================================================
--- trunk/tests/Makefile.am 2006-10-21 15:41:40 UTC (rev 3997)
+++ trunk/tests/Makefile.am 2006-10-21 15:46:43 UTC (rev 3998)
@@ -73,6 +73,7 @@
progs_ldadd = $(top_builddir)/bse/libbse.la
# testwavechunk
TESTS += testwavechunk
+SLOWTESTS += testwavechunk
testwavechunk_SOURCES = testwavechunk.c cxxdummy.cc
testwavechunk_LDADD = $(progs_ldadd)
# perftest
@@ -85,15 +86,15 @@
testresampler_LDADD = $(progs_ldadd)
# === Resampler tests ===
-check-before: resampler-quick-checks
+check-after: resampler-quick-checks
resampler-quick-checks:
: ## some quick checks (resampler-checks contains actual tests - use make slowcheck)
./testresampler filter-impl
- ./testresampler accuracy --up --precision=8 --freq-scan=180,18000,180 --max-threshold=45
- ./testresampler accuracy --down --precision=12 --freq-scan=90,9000,90 --max-threshold=72
- ./testresampler accuracy --fpu --up --precision=16 --freq-scan=180,18000,180 --max-threshold=89.5
- ./testresampler accuracy --fpu --oversample --precision=20 --freq-scan=180,18000,180 --max-threshold=113.5
- ./testresampler accuracy --subsample --precision=24 --freq-scan=90,9000,90 --max-threshold=126
+ ./testresampler accuracy --up --precision=8 --freq-scan=180,18000,1979 --max-threshold=45
+ ./testresampler accuracy --down --precision=12 --freq-scan=90,9000,997 --max-threshold=72
+ ./testresampler accuracy --fpu --up --precision=16 --freq-scan=180,18000,1453 --max-threshold=89.5
+ ./testresampler accuracy --fpu --oversample --precision=20 --freq-scan=180,18000,1671 --max-threshold=113.5
+ ./testresampler accuracy --subsample --precision=24 --freq-scan=90,9000,983 --max-threshold=126
slowcheck: resampler-checks
resampler-checks:
Modified: trunk/tests/bse/Makefile.am
===================================================================
--- trunk/tests/bse/Makefile.am 2006-10-21 15:41:40 UTC (rev 3997)
+++ trunk/tests/bse/Makefile.am 2006-10-21 15:46:43 UTC (rev 3998)
@@ -18,7 +18,6 @@
$(SFIDL) --core-cxx $(SFIDL_INC) -I$(top_builddir) $< > $@ || (rm $@ ; exit 1 )
# bsecxxapi.hh
GENERATED_CLEANFILES += bsecxxapi.hh
-$(srcdir)/cxxbinding.cc: bsecxxapi.hh
bsecxxapi.hh: $(top_srcdir)/bse/bse.idl $(SFIDL)
cd . \
&& echo -e "#include <sfi/sficxx.hh>\n" > xgen-$(@F) \
@@ -28,7 +27,6 @@
&& rm -f xgen-$(@F)
# bsecxxapi.cc
GENERATED_CLEANFILES += bsecxxapi.cc
-$(srcdir)/cxxbinding.cc: bsecxxapi.cc
bsecxxapi.cc: bsecxxapi.hh $(top_srcdir)/bse/bse.idl $(SFIDL)
cd . \
&& echo -e "#include \"bsecxxapi.hh\"\n" > xgen-$(@F) \
@@ -51,12 +49,16 @@
#
noinst_PROGRAMS = $(TESTS)
progs_ldadd = $(top_builddir)/bse/libbse.la
-TESTS += cxxbinding
+
+SLOWTESTS += cxxbinding
cxxbinding_SOURCES = cxxbinding.cc bsecxxapi.cc
-cxxbinding_LDADD = $(progs_ldadd)
+cxxbinding_LDADD = $(progs_ldadd)
+$(srcdir)/cxxbinding.cc: bsecxxapi.hh
+$(srcdir)/cxxbinding.cc: bsecxxapi.cc
+
TESTS += filtertest
filtertest_SOURCES = filtertest.cc
-filtertest_LDADD = $(progs_ldadd)
+filtertest_LDADD = $(progs_ldadd)
EXTRA_DIST += empty.ogg
#
Modified: trunk/tests/filecheck/Makefile.am
===================================================================
--- trunk/tests/filecheck/Makefile.am 2006-10-21 15:41:40 UTC (rev 3997)
+++ trunk/tests/filecheck/Makefile.am 2006-10-21 15:46:43 UTC (rev 3998)
@@ -25,7 +25,8 @@
test -e distfiles.list
test -e $(DISTFILE_LIST_NAME)
cd $(top_builddir) && make distfile-list DISTFILE_LIST=$(DISTFILE_LIST_NAME)
-.PHONY: bse-loading-check bse-version-check
+
+.PHONY: bse-version-check
bse-version-check: distfiles.list
TESTVERSION="$(BSE_MAJOR_VERSION).$(BSE_MINOR_VERSION)." ; \
for tfile in `grep '\.bse$$' distfiles.list` ; do \
@@ -39,6 +40,9 @@
&& echo $$MESSAGETEXT | sed 's/./=/g' \
&& echo $$MESSAGETEXT \
&& echo $$MESSAGETEXT | sed 's/./=/g'
+check: bse-version-check
+
+.PHONY: bse-loading-check
SKIP_PATTERN = "tests/latency/midi-latency.bse|tests/audio/minisong.bse"
bse-loading-check: distfiles.list
for tfile in `grep '\.bse$$' distfiles.list` ; do \
@@ -56,8 +60,9 @@
&& echo $$MESSAGETEXT | sed 's/./=/g' \
&& echo $$MESSAGETEXT \
&& echo $$MESSAGETEXT | sed 's/./=/g'
+slowcheck: bse-loading-check
+
CLEANFILES += distfiles.list warnings.tmp
-check-after: bse-version-check bse-loading-check
plugin_globs = '$(top_builddir)/plugins/.libs/*.so:$(top_builddir)/plugins/freeverb/.libs/*.so'
EXTRA_DIST += checkproject.scm
BSESCM = $(strip \
Modified: trunk/tests/testwavechunk.c
===================================================================
--- trunk/tests/testwavechunk.c 2006-10-21 15:41:40 UTC (rev 3997)
+++ trunk/tests/testwavechunk.c 2006-10-21 15:46:43 UTC (rev 3998)
@@ -19,6 +19,7 @@
#include <bse/gslwavechunk.h>
#include <bse/gsldatahandle.h>
#include <bse/bsemain.h>
+#include <sfi/sfitests.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -35,7 +36,7 @@
VERBOSITY_PADDING,
VERBOSITY_CHECKS,
};
-static guint verbosity = VERBOSITY_SETUP;
+static guint verbosity = VERBOSITY_NONE;
static gfloat my_data[] = {
0.555555555,1,2,3,4,5,6,7,8,9,
@@ -52,11 +53,11 @@
#define MINI_DEBUG_SIZE (16)
static void
-run_tests (GslWaveLoopType loop_type,
- gint play_dir,
- gint loop_first,
- gint loop_last,
- gint loop_count)
+run_loop_test (GslWaveLoopType loop_type,
+ gint play_dir,
+ gint loop_first,
+ gint loop_last,
+ gint loop_count)
{
gfloat *tmpstorage = g_new (gfloat, DEBUG_SIZE);
gfloat *cmpblock = tmpstorage + DEBUG_SIZE / 2;
@@ -191,92 +192,112 @@
g_print ("\n");
}
+static void
+reversed_datahandle_test (void)
+{
+ GslDataHandle *myhandle;
+ GslDataHandle *rhandle1, *rhandle2;
+ GslLong o, l, i, e;
+ BseErrorType error;
+
+ TSTART ("reversed datahandle");
+
+ myhandle = gsl_data_handle_new_mem (1, 32, 44100, 440, my_data_length, my_data, NULL);
+ rhandle1 = gsl_data_handle_new_reverse (myhandle);
+ gsl_data_handle_unref (myhandle);
+ rhandle2 = gsl_data_handle_new_reverse (rhandle1);
+ gsl_data_handle_unref (rhandle1);
+ error = gsl_data_handle_open (rhandle2);
+ if (error)
+ g_error ("failed to open rhandle2: %s", bse_error_blurb (error));
+ gsl_data_handle_unref (rhandle2);
+
+ TASSERT (gsl_data_handle_length (rhandle2) == gsl_data_handle_length (myhandle));
+
+ for (i = 1; i < 8; i++)
+ {
+ o = 0;
+ l = gsl_data_handle_length (rhandle2);
+ while (l)
+ {
+ gfloat d1[8], d2[8];
+
+ e = gsl_data_handle_read (myhandle, o, MIN (i, l), d1);
+ TCHECK (e == MIN (i, l));
+ e = gsl_data_handle_read (rhandle2, o, MIN (i, l), d2);
+ TCHECK (e == MIN (i, l));
+ TCHECK (memcmp (d1, d2, sizeof (d1[0]) * e) == 0);
+ l -= e;
+ o += e;
+ }
+ TOK();
+ }
+ gsl_data_handle_close (rhandle2);
+
+ TDONE();
+}
+
+static void
+simple_loop_tests (void)
+{
+ TSTART ("simple loop");
+ run_loop_test (GSL_WAVE_LOOP_NONE, -1, 0, 0, 0);
+ TOK();
+ run_loop_test (GSL_WAVE_LOOP_NONE, 1, 0, 0, 0);
+ TOK();
+ run_loop_test (GSL_WAVE_LOOP_NONE, -1, 0, 0, 0);
+ TOK();
+ run_loop_test (GSL_WAVE_LOOP_JUMP, 1, 0, 0, 0);
+ TOK();
+ run_loop_test (GSL_WAVE_LOOP_PINGPONG, 1, 0, 0, 0);
+ TOK();
+ run_loop_test (GSL_WAVE_LOOP_JUMP, -1, 0, 0, 0);
+ TOK();
+ run_loop_test (GSL_WAVE_LOOP_PINGPONG, -1, 0, 0, 0);
+ TOK();
+ TDONE();
+}
+
+static void
+brute_force_loop_tests (void)
+{
+ gint i, j, k, count = 6;
+ for (i = 1; i <= count; i++)
+ {
+ TSTART ("brute force loop test %d/%d", i, 6);
+ for (j = 0; j < my_data_length - 1; j++)
+ {
+ for (k = j + 1; k < my_data_length; k++)
+ {
+ run_loop_test (GSL_WAVE_LOOP_JUMP, 1, j, k, i);
+ run_loop_test (GSL_WAVE_LOOP_PINGPONG, 1, j, k, i);
+ run_loop_test (GSL_WAVE_LOOP_JUMP, -1, j, k, i);
+ run_loop_test (GSL_WAVE_LOOP_PINGPONG, -1, j, k, i);
+ }
+ TOK();
+ }
+ TDONE();
+ }
+}
+
int
main (gint argc,
gchar *argv[])
{
/* init */
- SfiInitValue values[] = {
+ SfiInitValue ivalues[] = {
{ "stand-alone", "true" }, /* no rcfiles etc. */
{ "wave-chunk-padding", NULL, 1, },
{ "wave_chunk_big_pad", NULL, 2, },
{ "dcache_block_size", NULL, 16, },
{ NULL }
};
- bse_init_inprocess (&argc, &argv, NULL, values);
- gint i, j, k;
+ bse_init_test (&argc, &argv, ivalues);
- if (1)
- {
- GslDataHandle *myhandle;
- GslDataHandle *rhandle1, *rhandle2;
- GslLong o, l, i, e;
- BseErrorType error;
+ reversed_datahandle_test();
+ simple_loop_tests();
+ if (sfi_init_settings().test_slow)
+ brute_force_loop_tests();
- g_print ("reversed datahandle test:...\n");
-
- myhandle = gsl_data_handle_new_mem (1, 32, 44100, 440, my_data_length, my_data, NULL);
- rhandle1 = gsl_data_handle_new_reverse (myhandle);
- gsl_data_handle_unref (myhandle);
- rhandle2 = gsl_data_handle_new_reverse (rhandle1);
- gsl_data_handle_unref (rhandle1);
- error = gsl_data_handle_open (rhandle2);
- if (error)
- g_error ("failed to open rhandle2: %s", bse_error_blurb (error));
- gsl_data_handle_unref (rhandle2);
-
- g_assert (gsl_data_handle_length (rhandle2) == gsl_data_handle_length (myhandle));
-
- for (i = 1; i < 8; i++)
- {
- o = 0;
- l = gsl_data_handle_length (rhandle2);
- while (l)
- {
- gfloat d1[8], d2[8];
-
- e = gsl_data_handle_read (myhandle, o, MIN (i, l), d1);
- g_assert (e == MIN (i, l));
- e = gsl_data_handle_read (rhandle2, o, MIN (i, l), d2);
- g_assert (e == MIN (i, l));
- g_assert (memcmp (d1, d2, sizeof (d1[0]) * e) == 0);
- l -= e;
- o += e;
- }
- }
- gsl_data_handle_close (rhandle2);
- g_print ("passed.\n");
- }
-
- if (1)
- {
- g_print ("primitive loop tests:...\n");
-
- run_tests (GSL_WAVE_LOOP_NONE, -1, 0, 0, 0);
-
- run_tests (GSL_WAVE_LOOP_NONE, 1, 0, 0, 0);
- run_tests (GSL_WAVE_LOOP_NONE, -1, 0, 0, 0);
- run_tests (GSL_WAVE_LOOP_JUMP, 1, 0, 0, 0);
- run_tests (GSL_WAVE_LOOP_PINGPONG, 1, 0, 0, 0);
- run_tests (GSL_WAVE_LOOP_JUMP, -1, 0, 0, 0);
- run_tests (GSL_WAVE_LOOP_PINGPONG, -1, 0, 0, 0);
- g_print ("passed.\n");
- }
-
- if (1)
- {
- g_print ("brute loop tests:...\n");
- for (i = 1; i < 7; i++)
- for (j = 0; j < my_data_length - 1; j++)
- for (k = j + 1; k < my_data_length; k++)
- {
- run_tests (GSL_WAVE_LOOP_JUMP, 1, j, k, i);
- run_tests (GSL_WAVE_LOOP_PINGPONG, 1, j, k, i);
- run_tests (GSL_WAVE_LOOP_JUMP, -1, j, k, i);
- run_tests (GSL_WAVE_LOOP_PINGPONG, -1, j, k, i);
- }
- g_print ("passed.\n");
- }
-
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]