summaryrefslogtreecommitdiff
path: root/tests
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
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')
-rw-r--r--tests/ChangeLog4
-rw-r--r--tests/scripts/functions/flavor44
2 files changed, 48 insertions, 0 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index d30f0c9..01aecc6 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2005-11-17 Boris Kolpackov <boris@kolpackov.net>
+
+ * scripts/functions/flavor: Add a test for the flavor function.
+
2005-11-14 Boris Kolpackov <boris@kolpackov.net>
* scripts/variables/INCLUDE_DIRS: Add a test for the .INCLUDE_DIRS
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;