summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2012-03-03 22:12:46 +0000
committerPaul Smith <psmith@gnu.org>2012-03-03 22:12:46 +0000
commita77c5c09100ef56940546b543dd1c515529ca4bb (patch)
treedc4aa65797a96e5d72b02ab479429fa51784c151 /tests
parent88f1bc8b55b9f5abf35fdf974310c1063fa41068 (diff)
downloadgunmake-a77c5c09100ef56940546b543dd1c515529ca4bb.tar.gz
Fix Savannah bug #35410: handle escape chars in filter/filter-out
Also add a valgrind suppression file for Guile-enabled make.
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog6
-rw-r--r--tests/guile.supp31
-rwxr-xr-xtests/run_make_tests.pl2
-rw-r--r--tests/scripts/functions/filter-out32
4 files changed, 61 insertions, 10 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 210dfb2..2c2284f 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,5 +1,11 @@
2012-03-03 Paul Smith <psmith@gnu.org>
+ * scripts/functions/filter-out: Add filter tests and test escape
+ operations. See Savannah bug #35410.
+
+ * guile.supp: Suppress valgrind errors from Guile
+ * run_make_tests.pl: Use the Guile suppression file.
+
* scripts/misc/bs-nl: Check for POSIX and non-POSIX
backslash/newline handling. Addresses Savannah bug #16670.
diff --git a/tests/guile.supp b/tests/guile.supp
new file mode 100644
index 0000000..9e9b01b
--- /dev/null
+++ b/tests/guile.supp
@@ -0,0 +1,31 @@
+# Guile valgrind suppression file
+# Created with Guile 1.8.7
+
+# --- Garbage collection
+{
+ guilegc
+ Memcheck:Cond
+ ...
+ fun:scm_gc_for_newcell
+}
+{
+ guilegc
+ Memcheck:Value4
+ ...
+ fun:scm_gc_for_newcell
+}
+{
+ guilegc
+ Memcheck:Value8
+ ...
+ fun:scm_gc_for_newcell
+}
+
+
+# -- scm_alloc_struct
+{
+ guileheap
+ Memcheck:Leak
+ ...
+ fun:scm_alloc_struct
+}
diff --git a/tests/run_make_tests.pl b/tests/run_make_tests.pl
index 33f4506..88f62a9 100755
--- a/tests/run_make_tests.pl
+++ b/tests/run_make_tests.pl
@@ -33,7 +33,7 @@
$valgrind = 0; # invoke make with valgrind
$valgrind_args = '';
-$memcheck_args = '--num-callers=15 --tool=memcheck --leak-check=full';
+$memcheck_args = '--num-callers=15 --tool=memcheck --leak-check=full --suppressions=guile.supp';
$massif_args = '--num-callers=15 --tool=massif --alloc-fn=xmalloc --alloc-fn=xcalloc --alloc-fn=xrealloc --alloc-fn=xstrdup --alloc-fn=xstrndup';
$pure_log = undef;
diff --git a/tests/scripts/functions/filter-out b/tests/scripts/functions/filter-out
index 6c8b27a..1fe4819 100644
--- a/tests/scripts/functions/filter-out
+++ b/tests/scripts/functions/filter-out
@@ -1,6 +1,6 @@
# -*-perl-*-
-$description = "Test the filter-out function.";
+$description = "Test the filter and filter-out functions.";
$details = "The makefile created in this test has two variables. The
filter-out function is first used to discard names ending in
@@ -11,18 +11,32 @@ which is only used if there are multiple literals present in both
the pattern and text arguments. The result of both filter-out
functions is the same single .elc name.\n";
-open(MAKEFILE,"> $makefile");
+# Basic test -- filter
+run_make_test(q!
+files1 := $(filter %.o, foo.elc bar.o lose.o)
+files2 := $(filter %.o foo.i, foo.i bar.i lose.i foo.elc bar.o lose.o)
+all: ; @echo '$(files1) $(files2)'
+!,
+ '', "bar.o lose.o foo.i bar.o lose.o\n");
-print MAKEFILE <<'EOF';
+# Basic test -- filter-out
+run_make_test(q!
files1 := $(filter-out %.o, foo.elc bar.o lose.o)
files2 := $(filter-out foo.i bar.i lose.i %.o, foo.i bar.i lose.i foo.elc bar.o lose.o)
-all: ; @echo $(files1) $(files2)
-EOF
+all: ; @echo '$(files1) $(files2)'
+!,
+ '', "foo.elc foo.elc\n");
-close(MAKEFILE);
+# Escaped patterns
+run_make_test(q!all:;@echo '$(filter foo\%bar,foo%bar fooXbar)'!,
+ '', "foo%bar\n");
-&run_make_with_options($makefile, "", &get_logfile, 0);
-$answer = "foo.elc foo.elc\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(q!all:;@echo '$(filter foo\%\%\\\\\%\%bar,foo%%\\%%bar fooX\\Ybar)'!,
+ '', "foo%%\\%%bar\n");
+
+run_make_test(q!
+X = $(filter foo\\\\\%bar,foo\%bar foo\Xbar)
+all:;@echo '$(X)'!,
+ '', "foo\\%bar\n");
1;