--- old/test/make/TestMakeBase.gmk 2015-05-05 15:35:36.265210908 +0200 +++ new/test/make/TestMakeBase.gmk 2015-05-05 15:35:36.177207238 +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