From 68c727828e7698b8a7127f49bc99de4d0618ed36 Mon Sep 17 00:00:00 2001 From: rillig Date: Sun, 3 May 2020 08:42:22 +0000 Subject: regress/infra-unittests: demonstrate wrong help topics without keywords --- regress/infra-unittests/help.sh | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'regress') diff --git a/regress/infra-unittests/help.sh b/regress/infra-unittests/help.sh index 98eac24a2f5..c117aeaa28d 100644 --- a/regress/infra-unittests/help.sh +++ b/regress/infra-unittests/help.sh @@ -1,5 +1,5 @@ #! /bin/sh -# $NetBSD: help.sh,v 1.1 2020/03/30 06:40:53 rillig Exp $ +# $NetBSD: help.sh,v 1.2 2020/05/03 08:42:22 rillig Exp $ # # Test cases for "bmake help", mainly implemented in mk/help/help.awk. # @@ -92,3 +92,31 @@ if test_case_begin "short help topic"; then test_case_end fi + + +if test_case_begin "comments without keywords"; then + + # In the top-level Makefile, the SUBDIR section contains a few + # comment lines, which are implementation comments and do not + # contain keywords. These should not appear in the help. + + create_file_lines "Makefile" \ + 'SUBDIR+= subdir1' \ + '# Comment1' \ + '# Comment2' \ + '# Comment3' \ + 'SUBDIR+= subdir2' + + TOPIC=':all' awk -f "$pkgsrcdir/mk/help/help.awk" \ + 'Makefile' >"out" + + # FIXME: should be empty + assert_that 'out' --file-is-lines \ + '===> Makefile (keywords:):' \ + '# Comment1' \ + '# Comment2' \ + '# Comment3' \ + 'SUBDIR+= subdir2' + + test_case_end +fi -- cgit v1.2.3