summaryrefslogtreecommitdiff
path: root/src/kmk/tests/scripts/features/override
diff options
context:
space:
mode:
authorRitesh Raj Sarraf <rrs@debian.org>2013-12-02 14:27:40 -0500
committerRitesh Raj Sarraf <rrs@debian.org>2013-12-02 14:27:40 -0500
commit00cc15e3ce4fc63e509a575ae3016ca80afcc344 (patch)
tree3e5d21daf12cbe8c9f163401eee6eb902305fb69 /src/kmk/tests/scripts/features/override
parentb31bdef8a3eba48bf069962004794c7ca58a6b92 (diff)
downloadkbuild-00cc15e3ce4fc63e509a575ae3016ca80afcc344.tar.gz
Imported Upstream version 0.1.9998svn2695+dfsgupstream/0.1.9998svn2695+dfsgupstream
Diffstat (limited to 'src/kmk/tests/scripts/features/override')
-rw-r--r--src/kmk/tests/scripts/features/override55
1 files changed, 33 insertions, 22 deletions
diff --git a/src/kmk/tests/scripts/features/override b/src/kmk/tests/scripts/features/override
index 23e4f2b..fff6c4e 100644
--- a/src/kmk/tests/scripts/features/override
+++ b/src/kmk/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;