From 1ef712c6a513978afeaa7ae8bf61ad8ba8c0fefa Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Thu, 6 Jan 2022 04:21:08 +0400 Subject: [PATCH] [Makefile] Added a simple test that verifies output. Mostly as an example of use for test command. --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index dcebd2a..cc12346 100644 --- a/Makefile +++ b/Makefile @@ -23,4 +23,8 @@ install: uninstall: rm -f ${DESTDIR}usr/bin/${TARGET} - rm -f ${DESTDIR}usr/share/licenses/${TARGET}/LICENSE \ No newline at end of file + 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"; } \ No newline at end of file