From b424a2eebbbbf19e253d9098317de378f3dc7d4b Mon Sep 17 00:00:00 2001 From: Thomas Oltmann Date: Sun, 9 Jan 2022 15:25:15 +0100 Subject: Implemented a simple test suite The test suite simply runs makel in turn on all Makefiles in tests/, and compares makel's exit codes with the expected exit codes that are written in the Makefiles themselves. This system could be improved by comparing warning classes instead, and using text identifiers instead of numerical codes which might be subject to change. Revision 2 of this patch: Make target to run the test suite is now called 'check' to avoid confusion. --- tests/bad_ws.mk | 2 ++ tests/cont_of_blank.mk | 3 +++ tests/cont_to_blank.mk | 3 +++ tests/eof_cont.mk | 3 +++ tests/ws_before_comment.mk | 2 ++ 5 files changed, 13 insertions(+) create mode 100644 tests/bad_ws.mk create mode 100644 tests/cont_of_blank.mk create mode 100644 tests/cont_to_blank.mk create mode 100644 tests/eof_cont.mk create mode 100644 tests/ws_before_comment.mk (limited to 'tests') diff --git a/tests/bad_ws.mk b/tests/bad_ws.mk new file mode 100644 index 0000000..7b3a0f7 --- /dev/null +++ b/tests/bad_ws.mk @@ -0,0 +1,2 @@ +#:6: + foo: bar # This line is preceded by a vertical tab diff --git a/tests/cont_of_blank.mk b/tests/cont_of_blank.mk new file mode 100644 index 0000000..ea9fac4 --- /dev/null +++ b/tests/cont_of_blank.mk @@ -0,0 +1,3 @@ +#:2: +\ + OBJS= diff --git a/tests/cont_to_blank.mk b/tests/cont_to_blank.mk new file mode 100644 index 0000000..20ed281 --- /dev/null +++ b/tests/cont_to_blank.mk @@ -0,0 +1,3 @@ +#:2: +OBJS=\ + diff --git a/tests/eof_cont.mk b/tests/eof_cont.mk new file mode 100644 index 0000000..989d6fd --- /dev/null +++ b/tests/eof_cont.mk @@ -0,0 +1,3 @@ +#:4: +# Continuation to end-of-file +OBJS=\ diff --git a/tests/ws_before_comment.mk b/tests/ws_before_comment.mk new file mode 100644 index 0000000..1157b05 --- /dev/null +++ b/tests/ws_before_comment.mk @@ -0,0 +1,2 @@ +#:6: + # This is not actually a valid comment -- cgit v1.2.3-70-g09d2