From 4b99aab8601b99cb79acda18fbc9fe782e2c0b39 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Wed, 18 Jan 2017 10:22:00 +0100 Subject: [PATCH] Makefile: Add 'test' target Add basic regression tests. These tests make sure that each command has been properly built and can be executed. Signed-off-by: Sebastien GODARD --- Makefile.in | 11 +++++++++++ tests/001 | 1 + tests/002 | 1 + tests/003 | 1 + tests/004 | 1 + tests/005 | 1 + tests/006 | 1 + tests/007 | 1 + tests/008 | 1 + 9 files changed, 19 insertions(+) create mode 100644 tests/001 create mode 100644 tests/002 create mode 100644 tests/003 create mode 100644 tests/004 create mode 100644 tests/005 create mode 100644 tests/006 create mode 100644 tests/007 create mode 100644 tests/008 diff --git a/Makefile.in b/Makefile.in index 0f56a4c..3a85497 100644 --- a/Makefile.in +++ b/Makefile.in @@ -570,6 +570,17 @@ else po-files: endif +TESTDIR="tests" +TESTRUN="/bin/sh" +TESTLIST:=$(shell ls $(TESTDIR) | egrep '^[0-9]+$$' | sort -n) + +unit: + @echo $(X) 2>&1 + @cat $(TESTDIR)/$(X) | $(TESTRUN) + +test: all + @$(foreach x, $(TESTLIST), $(MAKE) X=$x unit;) + clean: rm -f sadc sar sadf iostat tapestat mpstat pidstat cifsiostat *.o *.a core TAGS find nls -name "*.gmo" -exec rm -f {} \; diff --git a/tests/001 b/tests/001 new file mode 100644 index 0000000..fe4a230 --- /dev/null +++ b/tests/001 @@ -0,0 +1 @@ +./sar -V >/dev/null diff --git a/tests/002 b/tests/002 new file mode 100644 index 0000000..25d6c98 --- /dev/null +++ b/tests/002 @@ -0,0 +1 @@ +./iostat -V >/dev/null diff --git a/tests/003 b/tests/003 new file mode 100644 index 0000000..39c460d --- /dev/null +++ b/tests/003 @@ -0,0 +1 @@ +./mpstat -V >/dev/null diff --git a/tests/004 b/tests/004 new file mode 100644 index 0000000..6d54ec8 --- /dev/null +++ b/tests/004 @@ -0,0 +1 @@ +./sadc -V >/dev/null diff --git a/tests/005 b/tests/005 new file mode 100644 index 0000000..c1404f6 --- /dev/null +++ b/tests/005 @@ -0,0 +1 @@ +./sadf -V >/dev/null diff --git a/tests/006 b/tests/006 new file mode 100644 index 0000000..9c6dad3 --- /dev/null +++ b/tests/006 @@ -0,0 +1 @@ +./pidstat -V >/dev/null diff --git a/tests/007 b/tests/007 new file mode 100644 index 0000000..fdb0e09 --- /dev/null +++ b/tests/007 @@ -0,0 +1 @@ +./tapestat -V >/dev/null diff --git a/tests/008 b/tests/008 new file mode 100644 index 0000000..cd496ae --- /dev/null +++ b/tests/008 @@ -0,0 +1 @@ +./cifsiostat -V >/dev/null -- 2.40.0