summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog5
-rw-r--r--tests/scripts/features/varnesting47
2 files changed, 29 insertions, 23 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index d800b49..32213bb 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-29 Paul Smith <psmith@gnu.org>
+
+ * scripts/features/varnesting: Test resetting of variables while
+ expanding them. See Savannah patch #7534
+
2011-06-12 Paul Smith <psmith@gnu.org>
* scripts/features/archives: Check archives with whitespace at the
diff --git a/tests/scripts/features/varnesting b/tests/scripts/features/varnesting
index 15d5071..d8f3ffb 100644
--- a/tests/scripts/features/varnesting
+++ b/tests/scripts/features/varnesting
@@ -1,29 +1,30 @@
-$description = "The following test creates a makefile to ...";
+# -*-perl-*-
+$description = "Test recursive variables";
$details = "";
-open(MAKEFILE,"> $makefile");
-
-# The Contents of the MAKEFILE ...
-
-print MAKEFILE "x = variable1\n"
- ."variable2 := Hello\n"
- ."y = \$(subst 1,2,\$(x))\n"
- ."z = y\n"
- ."a := \$(\$(\$(z)))\n"
- ."all: \n"
- ."\t\@echo \$(a)\n";
-
-# END of Contents of MAKEFILE
-
-close(MAKEFILE);
-
-&run_make_with_options($makefile,"",&get_logfile);
-
-# Create the answer to what should be produced by this Makefile
-$answer = "Hello\n";
-
-&compare_output($answer,&get_logfile(1));
+run_make_test('
+x = variable1
+variable2 := Hello
+y = $(subst 1,2,$(x))
+z = y
+a := $($($(z)))
+all:
+ @echo $(a)
+',
+ '', "Hello\n");
+
+# This tests resetting the value of a variable while expanding it.
+# You may only see problems with this if you're using valgrind or
+# some other memory checker that poisons freed memory.
+# See Savannah patch #7534
+
+run_make_test('
+VARIABLE = $(eval VARIABLE := echo hi)$(VARIABLE)
+wololo:
+ @$(VARIABLE)
+',
+ '', "hi\n");
1;