pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files pkgtools/pkglint: fix test for ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/cedc39f47259
branches:  trunk
changeset: 398798:cedc39f47259
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue Jul 30 18:31:43 2019 +0000

description:
pkgtools/pkglint: fix test for doc/CHANGES removals

diffstat:

 pkgtools/pkglint/files/pkgsrc.go      |   2 +-
 pkgtools/pkglint/files/pkgsrc_test.go |  22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletions(-)

diffs (44 lines):

diff -r 9e7c611e82e5 -r cedc39f47259 pkgtools/pkglint/files/pkgsrc.go
--- a/pkgtools/pkglint/files/pkgsrc.go  Tue Jul 30 18:28:32 2019 +0000
+++ b/pkgtools/pkglint/files/pkgsrc.go  Tue Jul 30 18:31:43 2019 +0000
@@ -613,7 +613,7 @@
 }
 
 func (src *Pkgsrc) checkRemovedAfterLastFreeze() {
-       if src.LastFreezeStart == "" || G.Wip {
+       if src.LastFreezeStart == "" || G.Wip || !G.Opts.CheckGlobal {
                return
        }
 
diff -r 9e7c611e82e5 -r cedc39f47259 pkgtools/pkglint/files/pkgsrc_test.go
--- a/pkgtools/pkglint/files/pkgsrc_test.go     Tue Jul 30 18:28:32 2019 +0000
+++ b/pkgtools/pkglint/files/pkgsrc_test.go     Tue Jul 30 18:31:43 2019 +0000
@@ -277,6 +277,28 @@
        t.SetUpPackage("category/still-there")
        t.FinishSetUp()
 
+       // No error message since -Cglobal is not given.
+       t.CheckOutputEmpty()
+}
+
+func (s *Suite) Test_Pkgsrc_checkRemovedAfterLastFreeze__check_global(c *check.C) {
+       t := s.Init(c)
+
+       t.SetUpCommandLine("-Wall", "-Cglobal", "--source")
+       t.CreateFileLines("doc/CHANGES-2019",
+               CvsID,
+               "",
+               "\tUpdated category/updated-before to 1.0 [updater 2019-04-01]",
+               "\tmk/bsd.pkg.mk: started freeze for pkgsrc-2019Q1 branch [freezer 2019-06-21]",
+               "\tmk/bsd.pkg.mk: freeze ended for pkgsrc-2019Q1 branch [freezer 2019-06-25]",
+               "\tUpdated category/updated-after to 1.0 [updater 2019-07-01]",
+               "\tAdded category/added-after version 1.0 [updater 2019-07-01]",
+               "\tMoved category/moved-from to category/moved-to [author 2019-07-02]",
+               "\tDowngraded category/downgraded to 1.0 [author 2019-07-03]",
+               "\tUpdated category/still-there to 1.0 [updater 2019-07-04]")
+       t.SetUpPackage("category/still-there")
+       t.FinishSetUp()
+
        // It doesn't matter whether the last visible package change was before
        // or after the latest freeze. The crucial point is that the most
        // interesting change is the invisible one, which is the removal.



Home | Main Index | Thread Index | Old Index