summaryrefslogtreecommitdiff
path: root/tests/scripts/features/override
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2009-06-04 06:30:27 +0000
committerPaul Smith <psmith@gnu.org>2009-06-04 06:30:27 +0000
commit81f3e4babd128f6740d05b371122762924522fb6 (patch)
treeeeb19eaf947791c834620ff72c9b80e77d9fcc8b /tests/scripts/features/override
parent5b4d419476e9fbda8ea26017f6ec15956d103ed9 (diff)
downloadgunmake-81f3e4babd128f6740d05b371122762924522fb6.tar.gz
- Modify access of config and gnulib Savannah modules to use GIT
- Fix Savannah bug #24655. - Fix Savannah bug #24588. - Fix Savannah bug #24277. - Fix Savannah bug #25697. - Fix Savannah bug #25694. - Fix Savannah bug #25460. - Fix Savannah bug #26207. - Fix Savannah bug #25712. - Fix Savannah bug #26593. - Fix various doc issues.
Diffstat (limited to 'tests/scripts/features/override')
-rw-r--r--tests/scripts/features/override55
1 files changed, 33 insertions, 22 deletions
diff --git a/tests/scripts/features/override b/tests/scripts/features/override
index 23e4f2b..fff6c4e 100644
--- a/tests/scripts/features/override
+++ b/tests/scripts/features/override
@@ -1,34 +1,45 @@
-$description = "The following test creates a makefile to ...";
+# -*-perl-*-
-$details = "";
-
-open(MAKEFILE,"> $makefile");
-
-# The Contents of the MAKEFILE ...
-
-print MAKEFILE "override define foo\n"
- ."\@echo First comes the definition.\n"
- ."\@echo Then comes the override.\n"
- ."endef\n"
- ."all: \n"
- ."\t\$(foo)\n";
+$description = "Test the override directive on variable assignments.";
-# END of Contents of MAKEFILE
-
-close(MAKEFILE);
+$details = "";
-&run_make_with_options($makefile,"foo=Hello",&get_logfile);
+# TEST 0: Basic override
-# Create the answer to what should be produced by this Makefile
-$answer = "First comes the definition.\n"
- ."Then comes the override.\n";
+run_make_test('
+X = start
+override recur = $(X)
+override simple := $(X)
+X = end
+all: ; @echo "$(recur) $(simple)"
+',
+ 'recur=I simple=J', "end start\n");
-&compare_output($answer,&get_logfile(1));
+# TEST 1: Override with append
-1;
+run_make_test('
+X += X1
+override X += X2
+override Y += Y1
+Y += Y2
+all: ; @echo "$(X) $(Y)"
+',
+ '', "X1 X2 Y1\n");
+# TEST 2: Override with append to the command line
+run_make_test(undef, 'X=C Y=C', "C X2 C Y1\n");
+# Test override of define/endef
+run_make_test('
+override define foo
+@echo First comes the definition.
+@echo Then comes the override.
+endef
+all: ; $(foo)
+',
+ 'foo=Hello', "First comes the definition.\nThen comes the override.\n");
+1;