--- a/test/make/TestMakeBase.gmk Wed May 06 10:47:21 2015 +0200
+++ b/test/make/TestMakeBase.gmk Wed May 06 11:15:27 2015 +0200
@@ -33,6 +33,16 @@
$(SRC_ROOT)/make/common/MakeBase.gmk \
#
+# Assert two strings are equal
+# 1 - Tested value
+# 2 - Exepected value
+# 3 - Error message
+define assert-equals
+ ifneq ($$(strip $1),$$(strip $2))
+ $$(error $3 - Expected >$$(strip $2)< - Got >$$(strip $1)<)
+ endif
+endef
+
# On macosx, file system timestamps only have 1 second resultion so must add
# sleeps to properly test dependencies.
ifeq ($(OPENJDK_BUILD_OS), macosx)
@@ -77,6 +87,17 @@
endif
################################################################################
+# Test remove-prefixes
+
+$(eval $(call assert-equals, \
+ $(call remove-prefixes, pre, prefix postfix), fix postfix, \
+ Prefixes not properly removed))
+
+$(eval $(call assert-equals, \
+ $(call remove-prefixes, pre post, prefix postfix), fix fix, \
+ Prefixes not properly removed))
+
+################################################################################
# Test ShellQuote
SHELL_QUOTE_VALUE := foo '""' "''" bar