[Makefile] Added a simple test that verifies output. Mostly as an example of use for test command.

This commit is contained in:
Alexander Andreev 2022-01-06 04:21:08 +04:00
parent 3d52d708bc
commit 1ef712c6a5
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -24,3 +24,7 @@ install:
uninstall:
rm -f ${DESTDIR}usr/bin/${TARGET}
rm -f ${DESTDIR}usr/share/licenses/${TARGET}/LICENSE
test:
@echo -n "Does input \"3.68 120 30d\" gives 317.95? "
@test "${shell ./kwh-cost 3.68 120 30d}" = "317.95" && { echo -e "\e[32mYES\e[0m"; } || { echo -e "\e[31mNO\e[0m"; }