Enable build-time tests

Bug #1958385 reported by Andreas Hasenack
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libyang2 (Ubuntu)
Fix Released
Undecided
Andreas Hasenack

Bug Description

The build-time tests are disabled by default, and have to be enabled explicitly.

From the README file:
"""
## Tests

libyang includes several tests built with [cmocka](https://cmocka.org/). The tests
can be found in `tests` subdirectory and they are designed for checking library
functionality after code changes. Additional regression tests done with
a corpus of fuzzing inputs that previously caused crashes are done.
Those are available in `tests/fuzz` and are built automatically with the
cmocka unit tests.

The tests are by default built in the `Debug` build mode by running
```
$ make
```

In case of the `Release` mode, the tests are not built by default (it requires
additional dependency), but they can be enabled via cmake option:
```
$ cmake -DENABLE_TESTS=ON ..
```
"""

I suggest the last approach, to keep the build type "Release".

I actually tried that, and hit a bug[1], for which upstream committed a fix[2] to the devel branch.

1. https://github.com/CESNET/libyang/issues/1773
2. https://github.com/CESNET/libyang/commit/de2e8b272b8238258f36c42386f3f2c9806026fd

Tags: server-todo

Related branches

Changed in libyang2 (Ubuntu):
assignee: nobody → Andreas Hasenack (ahasenack)
status: New → Triaged
tags: added: server-todo
Changed in libyang2 (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libyang2 - 2.0.112-6ubuntu1

---------------
libyang2 (2.0.112-6ubuntu1) jammy; urgency=medium

  * Enable build time tests (LP: #1958385):
    - d/rules: set -DENABLE_TESTS=ON
    - d/p/fix-test-suite-wrt-FILE.patch: fix test suite failure due
      to __FILE__ being a relative path

 -- Andreas Hasenack <email address hidden> Thu, 20 Jan 2022 21:03:40 +0000

Changed in libyang2 (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.