Menu

#8 2.0.0: Tests fail in build environment

2.0
open
nobody
2023-06-17
2021-01-07
David Runge
No

Hi! I package drumstick for Arch Linux and while building 2.0.0 I also tried to run the test targets. The build environment is a clean chroot (a systemd-nspawn environment into which all dependencies of the package and a base system are installed).

However, I get:

make: Entering directory '/build/drumstick/src/drumstick-2.0.0/build'
Running tests...
Test project /build/drumstick/src/drumstick-2.0.0/build
    Start 1: alsaTest1
1/6 Test #1: alsaTest1 ........................   Passed    0.00 sec
    Start 2: alsaTest2
2/6 Test #2: alsaTest2 ........................***Failed    0.00 sec
    Start 3: fileTest1
3/6 Test #3: fileTest1 ........................   Passed    0.00 sec
    Start 4: fileTest2
4/6 Test #4: fileTest2 ........................   Passed    0.00 sec
    Start 5: rtTest
5/6 Test #5: rtTest ...........................Subprocess aborted***Exception:   0.07 sec
    Start 6: widgetsTest
6/6 Test #6: widgetsTest ......................Subprocess aborted***Exception:   0.07 sec

50% tests passed, 3 tests failed out of 6

Total Test time (real) =   0.16 sec

The following tests FAILED:
          2 - alsaTest2 (Failed)
          5 - rtTest (Subprocess aborted)
          6 - widgetsTest (Subprocess aborted)
Errors while running CTest
make: *** [Makefile:126: test] Error 8

I am not sure how to get further information on the nature of the failures, as I couldn't find any more in-depth logs about the test runs.

If I can provide further information, please let me know!

Discussion

  • Pedro Lopez-Cabanillas

    You may run the tests outside CMake/ctest, changing to the build/bin directory and executing the programs directly:

    $ cd '/build/drumstick/src/drumstick-2.0.0/build/bin'
    $ ./alsaTest2
    * Start testing of AlsaTest2 *
    Config: Using QtTest library 5.12.10, Qt 5.12.10 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.1 20160406 (Red Hat 5.3.1-6))
    PASS : AlsaTest2::initTestCase()
    PASS : AlsaTest2::testTimer()
    PASS : AlsaTest2::cleanupTestCase()
    Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 1033ms
    * Finished testing of AlsaTest2 *

    The alsaTest2 just checks the ALSA timer. You build environment may be unsuitable for a good MIDI timer.

    For the rtTest and widgetsTest, you may get the crash backtrace with gdb:

    $ gdb rtTest
    (gdb) run
    ...
    (gdb) bt

     
  • Pedro Lopez-Cabanillas

    Anyway, unitary tests are ment to be written and run by the developers. The goal is to automatically detect incompatibilities after changing the source code. It requires a development evironment with features like the GUI and hardware available to run the applications.

    For instance, QtCreator has a nice "Tests results" facility, very convenient...
    QtCreator

     

    Last edit: Pedro Lopez-Cabanillas 2021-01-07
  • Pedro Lopez-Cabanillas

    Ticket moved from /p/drumstick/bugs/24/

    Can't be converted:

    • _milestone: v2.x
    • _priority: 5
     
  • Pedro Lopez-Cabanillas

    • Milestone: v2.x --> 2.0
     
  • Pedro Lopez-Cabanillas

    Today when working with ticket [#49] I've found this issue too. Running the ALSA test needs the library and kernel modules and there is no alternative, but the RT and Widgets tests at lest may be run with this environment variable (you need the Qt offscreen plugin):

    $ export QT_QPA_PLATFORM=offscreen
    
     

    Related

    Bugs and New Feature Requests: #49


Log in to post a comment.