Received: by mail.netbsd.org (Postfix, from userid 605) id BB8F884E42; Thu, 19 Mar 2020 22:46:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 43B3084E36 for ; Thu, 19 Mar 2020 22:46:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 3AF8dlKpIhb1 for ; Thu, 19 Mar 2020 22:46:34 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id B9C5184D2D for ; Thu, 19 Mar 2020 22:46:34 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id B370CFB27; Thu, 19 Mar 2020 22:46:34 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1584657994190460" MIME-Version: 1.0 Date: Thu, 19 Mar 2020 22:46:34 +0000 From: "Roland Illig" Subject: CVS commit: pkgsrc/regress/infra-unittests To: pkgsrc-changes@NetBSD.org Reply-To: rillig@netbsd.org X-Mailer: log_accum Message-Id: <20200319224634.B370CFB27@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1584657994190460 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: rillig Date: Thu Mar 19 22:46:34 UTC 2020 Modified Files: pkgsrc/regress/infra-unittests: subst.sh Log Message: regress/infra-unittests: add more tests for subst.mk failures To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 pkgsrc/regress/infra-unittests/subst.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1584657994190460 Content-Disposition: inline Content-Length: 2494 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/regress/infra-unittests/subst.sh diff -u pkgsrc/regress/infra-unittests/subst.sh:1.1 pkgsrc/regress/infra-unittests/subst.sh:1.2 --- pkgsrc/regress/infra-unittests/subst.sh:1.1 Thu Mar 19 16:58:35 2020 +++ pkgsrc/regress/infra-unittests/subst.sh Thu Mar 19 22:46:34 2020 @@ -297,11 +297,64 @@ EOF create_file_lines "exists" "this file exists" test_file "testcase.mk" > "$tmpdir/actual-output" && exitcode=0 || exitcode=$? - assert_that "$exitcode" --equals "0" + create_file_lines "expected-output" \ '=> Substituting "class" in *exist* *not-found*' \ 'warning: [subst.mk:class] Ignoring non-existent file "./*not-found*".' - assert_that "actual-output" --file-equals "expected-output" assert_that "exists" --file-contains-exactly "this example exists" + assert_that "$exitcode" --equals "0" +fi + + +if testcase "multiple missing files, all are reported at once"; then + + create_file "testcase.mk" < "$tmpdir/actual-output" && exitcode=0 || exitcode=$? + + create_file_lines "expected-output" \ + '=> Substituting "class" in does not exist' \ + 'warning: [subst.mk:class] Ignoring non-existent file "./does".' \ + 'warning: [subst.mk:class] Ignoring non-existent file "./not".' \ + 'warning: [subst.mk:class] Ignoring non-existent file "./exist".' + + assert_that "actual-output" --file-equals "expected-output" + assert_that "$exitcode" --equals "0" +fi + + +if testcase "multiple no-op files, all are reported at once"; then + + create_file "testcase.mk" < "$tmpdir/actual-output" && exitcode=0 || exitcode=$? + + create_file_lines "expected-output" \ + '=> Substituting "class" in first second third' \ + 'info: [subst.mk:class] Nothing changed in ./first.' \ + 'info: [subst.mk:class] Nothing changed in ./second.' \ + 'info: [subst.mk:class] Nothing changed in ./third.' + + assert_that "actual-output" --file-equals "expected-output" + assert_that "$exitcode" --equals "0" fi --_----------=_1584657994190460--