test/make/TestMakeBase.gmk
changeset 53683 48ff68e2fe5c
parent 52342 9341b077bd55
child 54380 e297c7bb6469
--- a/test/make/TestMakeBase.gmk	Thu Feb 07 10:26:32 2019 +0100
+++ b/test/make/TestMakeBase.gmk	Thu Feb 07 12:35:45 2019 +0100
@@ -116,6 +116,28 @@
 endif
 
 ################################################################################
+# Test boolean operators
+
+$(eval $(call assert-equals, $(call And,  true  true  true ), true))
+$(eval $(call assert-equals, $(call And,  true  false true ), false))
+$(eval $(call assert-equals, $(call And,  false false false ), false))
+$(eval $(call assert-equals, $(call And, true), true))
+$(eval $(call assert-equals, $(call And, false), false))
+$(eval $(call assert-equals, $(call And,    ), true))
+
+$(eval $(call assert-equals, $(call Or,  true  true  true ), true))
+$(eval $(call assert-equals, $(call Or,  true  false true ), true))
+$(eval $(call assert-equals, $(call Or,  false false false ), false))
+$(eval $(call assert-equals, $(call Or, true), true))
+$(eval $(call assert-equals, $(call Or, false), false))
+$(eval $(call assert-equals, $(call Or,    ), false))
+
+# We cannot catch $(error) while testing, but you can enable this manually
+# by uncommenting and watch make fails.
+#$(eval $(call assert-equals, $(call And,  non-boolean  ), $(error ...)))
+#$(eval $(call assert-equals, $(call Or,  non-boolean  ), $(error ...)))
+
+################################################################################
 # Test remove-prefixes
 
 $(eval $(call assert-equals, \