|
7.
|
|
|
Below we are having a look at the ``glib2.0`` source package. In a very simple case the file would look like this::
|
|
|
|
Im Folgenden schauen wir uns das Quellpaket ``glib2.0`` an. Im einfachsten Fall sieht die Datei so aus::
|
|
Translated by
Maik Wagner
|
|
|
|
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.
|
|
|
|
Das stellt für den Test ``debian/tests/build`` sicher, dass die Pakete ``libglib2.0-dev`` und ``build-essential`` installiert sind.
|
|
Translated by
Florian Diesch
|
|
Reviewed by
Daniel Holbach
|
|
|
|
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.
|
|
|
|
Sie können in der ``Depends``-Zeile ``@`` benutzen, um festzulegen, dass Sie alle Pakete installiert haben wollen, die aus dem jeweiligen Quellpaket erzeugt werden.
|
|
Translated by
Florian Diesch
|
|
Reviewed by
Daniel Holbach
|
|
|
|
Located in
../ubuntu-packaging-guide/auto-pkg-test.rst:31
|
|
10.
|
|
|
The actual tests
|
|
|
|
Die eigentlichen Tests
|
|
Translated by
Florian Diesch
|
|
Reviewed by
Daniel Holbach
|
|
|
|
Located in
../ubuntu-packaging-guide/auto-pkg-test.rst:37
|
|
11.
|
|
|
The accompanying test for the example above might be:
|
|
|
|
Der passende Test für das obige Beispiel könnte folgender sein:
|
|
Translated and reviewed by
Daniel Holbach
|
|
|
|
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.
|
|
|
|
An dieser Stelle wird ein sehr einfaches Stück C-Code in ein temporäres Verzeichnis geschrieben. Dies wird mit den Systembibliotheken übersetzt (wobei die Flags und Bibliothekpfade benutzt werden, wie sie uns von `pkg-config` geliefert werden). Dann wird der resultierende Binär-Code ausgeführt, der grundlegende Funtionen in glib testet.
|
|
Translated and reviewed by
Daniel Holbach
|
|
|
|
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.
|
|
|
|
Während der Test selbst sehr klein und einfach ist, umfasst er doch eine Menge: Es wird sichergestellt, dass das -dev Paket alle nötigen Abhängigkeiten besitzt, dass von dem Paket funktionierende pkg-Konfigurationsdateien installiert werden, dass die Header und Bibliotheken richtig platziert werden, oder dass der Kompiler und Linker funktionieren. Das hilft dabei, kritische Fehler schon sehr früh aufzudecken.
|
|
Translated by
Moritz Oberhauser
|
|
Reviewed by
Daniel Holbach
|
|
|
|
Located in
../ubuntu-packaging-guide/auto-pkg-test.rst:76
|
|
14.
|
|
|
Executing the test
|
|
|
|
Den Test ausführen
|
|
Translated and reviewed by
Daniel Holbach
|
|
|
|
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.
|
|
|
|
Während das Testskript leicht selbst ausgeführt werden kann, wird dringend empfohlen, ``autopkgtest`` aus dem ``autopkgtest`` Paket zu verwenden. Somit kann überprüft werden, dass Ihr Test funktioniert. In anderen Fällen wird es der Test wenn er im Ubuntu Continuous Integration (CI) System fehlschlägt, nicht in Ubuntu landen. Dies verhindet eben so, dass Ihre Workstation mit Testpaketen oder Testkonfiguration zugemüllt wird, wenn der Test etwas weiteres als das einfache Beispiel oben macht.
|
|
Translated by
Maik Wagner
|
|
|
|
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.
|
|
|
|
Die `README.running-tests <running_tests_local_>`_ (`online version <DEP8_>`_) Dokumentation erklärt alle verfügbaren Testumgebund (schroot, LXE, QEMU etc.) und die üblichsten Szenarien um Ihre Tests mit ``autopkgtest`` laufen zu lassen. Beispielsweise mit lokal erstellten Binärdateien, lokal modifizierten Tests etc.
|
|
Translated by
Maik Wagner
|
|
|
|
Located in
../ubuntu-packaging-guide/auto-pkg-test.rst:91
|