[ CC'ing the original author of the patch. ] On 2017-03-06 22:27 -0300, Tiago Stürmer Daitx wrote:
> Package: ncurses > Version: 6.0+20161126-1 > Severity: wishlist > Tags: patch > > Dear Maintainer, > > Please consider applying the following patch (or the original one [1]) > to include support for autopkgtest to the ncurses package. This has > been part of Ubuntu since 2013 [1,2] and all tests passes for the > supported archs [3]. Thanks for forwarding the patch, and apologies for not having replied sooner. > diff -Nru ncurses-6.0+20161126/debian/control > ncurses-6.0+20161126/debian/control > --- ncurses-6.0+20161126/debian/control 2016-11-28 15:50:38.000000000 > -0200 > +++ ncurses-6.0+20161126/debian/control 2016-11-30 02:13:08.000000000 > -0200 > @@ -13,6 +14,7 @@ > Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/ncurses.git > Vcs-Git: https://anonscm.debian.org/git/collab-maint/ncurses.git > Homepage: http://invisible-island.net/ncurses/ > +XS-Testsuite: autopkgtest This header seems to be unnecessary these days. As of dpkg 1.17.11, dpkg-source automatically adds the Testsuite field to the .dsc file if debian/tests/control exists. > diff -Nru ncurses-6.0+20161126/debian/tests/build > ncurses-6.0+20161126/debian/tests/build > --- ncurses-6.0+20161126/debian/tests/build 1969-12-31 21:00:00.000000000 > -0300 > +++ ncurses-6.0+20161126/debian/tests/build 2016-05-25 14:41:01.000000000 > -0300 > @@ -0,0 +1,93 @@ > +#!/bin/sh > +# autopkgtest check: Build and run a program against ncurses, to verify that > +# the headers and pkg-config file are installed correctly > +# (C) 2012 Canonical Ltd. > +# Author: Vibhav Pant <vibh...@ubuntu.com> There is a Copyright header but no license information. Can I assume that the file is under the same license as the rest of ncurses? > +/* Test delwin and endwin */ > +void test_delete_and_exit_functions(WINDOW * win) > +{ > + assert(delwin(win) != ERR); > + assert(endwin() != ERR); > +} > + > +int main() > +{ > + WINDOW *win; > + > + win = initscr(); > + if (win == NULL) { > + fprintf(stderr, "initscr failed\n"); > + return 1; > + } > + test_printw_functions(win); > + test_addch_functions(win); > + test_input_functions(win); > + test_vwprintw(win, "\nTesting mwvprintf\n"); > + > + return 0; > +} > +EOF I was wondering why there is no call to test_delete_and_exit_functions(win) here, but when I added it I noticed that the assertions in that function actually fail if there is no controlling terminal. And even with a controlling terminal, endwin() fails under autopkgtest although it succeeds when executing the test program directly. This might warrant some comment. > diff -Nru ncurses-6.0+20161126/debian/tests/control > ncurses-6.0+20161126/debian/tests/control > --- ncurses-6.0+20161126/debian/tests/control 1969-12-31 21:00:00.000000000 > -0300 > +++ ncurses-6.0+20161126/debian/tests/control 2016-05-25 14:41:01.000000000 > -0300 > @@ -0,0 +1,2 @@ > +Tests: build > +Depends: libncurses5-dev, build-essential, pkg-config I think build-essential is not strictly necessary, gcc should be enough. But that's not really important. Cheers, Sven