|
7.
|
|
|
Below we are having a look at the ``glib2.0`` source package. In a very simple case the file would look like this::
|
|
|
|
Ниже мы рассмотрим пакет исходного кода ``glib2.0``. В очень простом случае он будет выглядеть так::
|
|
Translated by
Anton Patsev
|
|
Reviewed by
Anton Patsev
|
|
|
|
Located in
../ubuntu-packaging-guide/auto-pkg-test.rst:22
|
|
8.
|
|
|
For the test in ``debian/tests/build`` this would ensure that the packages ``libglib2.0-dev`` and ``build-essential`` are installed.
|
|
|
|
Это будет означать, что для теста ``debian/tests/build`` требуются пакеты ``libglib2.0-dev`` и ``build-essential``.
|
|
Translated by
Dmitry Shachnev
|
|
Reviewed by
Anton Patsev
|
|
|
|
Located in
../ubuntu-packaging-guide/auto-pkg-test.rst:28
|
|
9.
|
|
|
You can use ``@`` in the ``Depends`` line to indicate that you want all the packages installed which are built by the source package in question.
|
|
|
|
В поле ``Depends`` можно указать ``@``, если вы хотите установки всех бинарных пакетов, собранных из рассматриваемого пакета исходного кода.
|
|
Translated by
Dmitry Shachnev
|
|
Reviewed by
Anton Patsev
|
|
|
|
Located in
../ubuntu-packaging-guide/auto-pkg-test.rst:31
|
|
10.
|
|
|
The actual tests
|
|
|
|
Настоящие тесты
|
|
Translated by
Dmitry Shachnev
|
|
Reviewed by
Anton Patsev
|
|
|
|
Located in
../ubuntu-packaging-guide/auto-pkg-test.rst:37
|
|
11.
|
|
|
The accompanying test for the example above might be:
|
|
|
|
Тест, соответствующий рассмотренному выше примеру, будет выглядеть так:
|
|
Translated by
Dmitry Shachnev
|
|
Reviewed by
Anton Patsev
|
|
|
|
Located in
../ubuntu-packaging-guide/auto-pkg-test.rst:39
|
|
12.
|
|
|
Here a very simple piece of C code is written to a temporary directory. Then this is compiled with system libraries (using flags and library paths as provided by `pkg-config`). Then the compiled binary, which just exercises some parts of core glib functionality, is run.
|
|
|
|
Здесь небольшая программа на языке C копируется во временную директорию, затем компилируется с использованием системных библиотек (с использованием флагов и путей к библиотекам, определённых через ``pkg-config``). Затем запускается скомпилированный файл, который запускает несколько основных функций glib.
|
|
Translated by
Dmitry Shachnev
|
|
Reviewed by
Anton Patsev
|
|
|
|
Located in
../ubuntu-packaging-guide/auto-pkg-test.rst:71
|
|
13.
|
|
|
While this test is very small and simple, it covers quite a lot: that your -dev package has all necessary dependencies, that your package installs working pkg-config files, headers and libraries are put into the right place, or that the compiler and linker work. This helps to uncover critical issues early on.
|
|
|
|
Хотя этот тест очень маленький и простой, он проверяет многое: что ваш -dev пакет имеет все необходимые зависимости, что ваш пакет устанавливает рабочие файлы pkg-config, заголовочные файлы и библиотеки помещаются в нужное место, или что компилятор и компоновщик работают. Это помогает обнаружить критические ошибки на ранней стадии.
|
|
Translated by
Aleksey Kabanov
|
|
Reviewed by
Anton Patsev
|
|
|
|
Located in
../ubuntu-packaging-guide/auto-pkg-test.rst:76
|
|
14.
|
|
|
Executing the test
|
|
|
|
Выполнение теста
|
|
Translated by
Dmitry Shachnev
|
|
Reviewed by
Anton Patsev
|
|
|
|
Located in
../ubuntu-packaging-guide/auto-pkg-test.rst:82
|
|
15.
|
|
|
While the test script can be easily executed on its own, it is strongly recommended to actually use ``autopkgtest`` from the ``autopkgtest`` package for verifying that your test works; otherwise, if it fails in the Ubuntu Continuous Integration (CI) system, it will not land in Ubuntu. This also avoids cluttering your workstation with test packages or test configuration if the test does something more intrusive than the simple example above.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../ubuntu-packaging-guide/auto-pkg-test.rst:84
|
|
16.
|
|
|
The `README.running-tests <running_tests_local_>`_ (`online version <DEP8_>`_) documentation explains all available testbeds (schroot, LXD, QEMU, etc.) and the most common scenarios how to run your tests with ``autopkgtest``, e. g. with locally built binaries, locally modified tests, etc.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../ubuntu-packaging-guide/auto-pkg-test.rst:91
|