From 6e921753d6a0e7a7592ad0733b5a73bc401b1c1c Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Thu, 6 Feb 2020 07:28:08 +0100 Subject: [PATCH] Makefile: add trivial test For now only the basic functionality of the script is tested. --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 470fdd7..ca82b82 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,7 @@ help: @$(info help - show this overview) @$(info lint - code style checks) @$(info spelling - check spelling) + @$(info test - run tests) @$(info tgz - create release archive) .PHONY: all @@ -72,3 +73,9 @@ lint: .PHONY: spelling spelling: find -name .git -prune -or -name $(DIST_DIR) -prune -or -type f | xargs codespell + +.PHONY: test +test: $(TARGET_FILE) + @# verify that the assembled shell script can be interpreted by the local shell + @if echo "list" | "$(abspath $(TARGET_FILE))" | grep -qw "uptime"; then \ + echo "Test OK"; else echo "Test FAILED"; false; fi