Autopkgtests In Kubuntu
Updated 264 Days AgoPublic

Usually, KDE packages in Kubuntu have one or two autopkgtests; the 'testsuite' and optionally, the 'acc' (if the source package provides a -dev package installing headers in /usr/include)

testsuite

This autopkgtest is meant to execute the unit tests of the software being packaged (i.e. what you would get with make test if you are building from a vanilla source)

Common tricks to fix the 'testsuite' autopkgtest
Provide a $HOME directory:

Some tests would fail if there isn't a proper $HOME directory, so to fix that you may add this code to debian/tests/testsuite:

if [ -z "$HOME" ] || [ ! -d "$HOME" ]; then
    [ -e debian/tests.home ] || mkdir debian/tests.home
    export HOME="$(pwd)/debian/tests.home"
    trap "rm -rf debian/tests.home" EXIT
fi
Run the tests with xvfb-run

Many times you need to run the autotests inside an X server. To simulate this, you may run the tests with with xvfb-run, example:
https://git.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/ark/commit/?h=kubuntu_zesty_archive&id=a0617393ed813d4c1185fe46361f12698231dff5

Sometimes you may also need to pass screen arguments to xvfb-run, usually we pass --server-args="-screen 0 1024x768x24"

Run the tests with a dbus session

TODO

Run the tests with window manager

TODO

acc (headers check)

This one is meant to check the /usr/include/ headers installed by the -dev package; this test may fail because of any of these reasons:

  • a) One of the headers contains an #include against other header provided by other package; that other package isn't in the depends of the -dev package being tested, so the header building will fail, therefore the test will fail. This way we know thanks to these test if the -dev depends are ok.
  • b) One of the headers contains an #include against a header which is not installed. This is usually an upstream issue.
  • c) The '-fno-keep-inline-functions' gcc flag wasn't used. If this flag is not present, the acc test may fail. Not because the package in question has issues, but because in this case the test itself is the problem. To make sure this flag is being passed to gcc, you can change the test this way. To do something like that automatically you may use the ka-acctest-noinline program from KA.
  • d) Some other reason. You would need to find out why and how to fix it. Good luck ;)
Last Author
joselema
Projects
None
Subscribers
None