makefile/utils: Add a function for checking that a string is not empty.#10439
makefile/utils: Add a function for checking that a string is not empty.#10439cladmi merged 3 commits intoRIOT-OS:masterfrom
Conversation
c46a682 to
7f9018f
Compare
|
I will add a test so that it is run in murdock. |
|
I added a test and updated the behavior of your test to verify the returned value of It can be tested by replacing, in the Makefile, the tested target by the other: On the naming, I would prefer having the directory named |
683d0ea to
11cd49d
Compare
|
I renamed it to |
|
Nice catch on the typo in the error message. Codacy wants one line less in the README… you can inline fix it directly. I re-ran the tests and verified that they also detected the errors by tweaking the test |
11cd49d to
f4153d2
Compare
|
Done. Stupid codacy. |
f4153d2 to
9d252a8
Compare
A call to `$(ensure_value x,y)` will fail with message y if x is empty, and otherwise return x. This can be useto write more compact makefiles, while still producing friendly error messages.
make -f test-checks.mk test-ensure_value should succeed, while make -f test-checks.mk test-ensure_value-negative should fail.
This will allow testing the build system 'utils' functions.
cladmi
left a comment
There was a problem hiding this comment.
Agreed with the implementation and tested too.
Contribution description
A call to
$(call ensure_value,x,y)will fail with message y if x is empty, and otherwise return x. This can be useto write more compact makefiles, while still producing friendly error messages.Testing procedure
I should provide an automated test for this, in the meantime:
Issues/PRs references
Split from #10342.