[riot-notifications] [RIOT-OS/RIOT] makefiles/utils/{strings, paths}: Add function library. (#11218)

Gaƫtan Harter notifications at github.com
Wed May 8 16:07:23 CEST 2019

cladmi commented on this pull request.

> +#	value: a string which should be empty
+#	message: The error message to display.
+# Returns:
+#	empty string
+assert_not = $(if $(1),$(error $(2)),)
+# Produce an error if the values are not equal
+# Parameters
+#	a: first string to match
+#	b: second string to match
+#	message (optional): The error message to display. If the message is empty a
+#					default message is shown.
+# Returns:
+#	empty string
+assert_eq = $(if $(call streq,$(1),$(2)),,$(error $(if $(3),$(3),Expected "$(2)" and got "$(1)")))

This one does not work as documented.

These two cases both work when they should not:

	@test -z "$(call assert_eq,a,a b,"This should not fail")"
	@test -z "$(call assert_eq,lol%,lola,"This should not fail")"

Problem is that `streq` is not `streq`. It would maybe just be better with a `define` so multiline using `ifneq`.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190508/a982aaa3/attachment.html>

More information about the notifications mailing list