summaryrefslogtreecommitdiff
path: root/tests/scripts/functions
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@kolpackov.net>2005-11-17 07:27:28 +0000
committerBoris Kolpackov <boris@kolpackov.net>2005-11-17 07:27:28 +0000
commit1fd3f9d79cdf3f03450129020d3310b726003ed3 (patch)
tree8a1869edb1370956940a676841a3a2048a51c6e3 /tests/scripts/functions
parent3dd1faa5c849dbeb59a88653068c010699ce86f7 (diff)
downloadgunmake-1fd3f9d79cdf3f03450129020d3310b726003ed3.tar.gz
Implemented the flavor function which returns the flavor of
a variable ('simple', 'recursive', or 'undefined').
Diffstat (limited to 'tests/scripts/functions')
-rw-r--r--tests/scripts/functions/flavor44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/scripts/functions/flavor b/tests/scripts/functions/flavor
new file mode 100644
index 0000000..80d6be7
--- /dev/null
+++ b/tests/scripts/functions/flavor
@@ -0,0 +1,44 @@
+# -*-perl-*-
+$description = "Test the flavor function.";
+
+$details = "";
+
+
+# Test #1: Test general logic.
+#
+run_make_test('
+s := s
+r = r
+
+$(info u $(flavor u))
+$(info s $(flavor s))
+$(info r $(flavor r))
+
+ra += ra
+rc ?= rc
+
+$(info ra $(flavor ra))
+$(info rc $(flavor rc))
+
+s += s
+r += r
+
+$(info s $(flavor s))
+$(info r $(flavor r))
+
+
+.PHONY: all
+all:;@:
+',
+'',
+'u undefined
+s simple
+r recursive
+ra recursive
+rc recursive
+s simple
+r recursive');
+
+
+# This tells the test driver that the perl test script executed properly.
+1;