< prev index next >

test/make/TestMakeBase.gmk

Print this page

        

@@ -31,10 +31,20 @@
 THIS_FILE := $(SRC_ROOT)/test/make/TestMakeBase.gmk
 DEPS := $(THIS_FILE) \
     $(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)
   SLEEP_ON_MAC := sleep 1
 endif

@@ -75,10 +85,21 @@
 ifeq ($(call equals, $(EQUALS_VALUE1), $(EQUALS_VALUE1)), )
   $(error The strings >$(EQUALS_VALUE1)< and >$(EQUALS_VALUE1)< are not equal)
 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
 SHELL_QUOTE_RESULT := $(shell $(ECHO) $(call ShellQuote, \
     $(SHELL_QUOTE_VALUE)))
< prev index next >