Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Running cross compiled unit tests with qemu (from yocto SDK)
Forum Updated to NodeBB v4.3 + New Features

Running cross compiled unit tests with qemu (from yocto SDK)

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
6 Posts 2 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    drebelpai
    wrote on last edited by drebelpai
    #1

    To build a Qt app within WSL and run it (x86_64), I followed this link, and it went well, it launches, however I'm relying on X, not Wayland. Couldn't find anything explaining what dependencies I need for Wayland.

    Then I moved towards cross-compiling. Created this question on StackOverflow

    Basically I'm getting

    qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
    qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
    qt.qpa.plugin: Could not find the Qt platform plugin "eglfs" in ""
    This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    
    qemu: uncaught target signal 6 (Aborted) - core dumped
    Aborted
    

    Seems like, as my image/SDK won't have any X, I can't rely on xcb. What dependencies I need to add to my SDK to be able to simply run the Unit Tests under qemu?

    SGaistS 1 Reply Last reply
    0
    • D drebelpai

      To build a Qt app within WSL and run it (x86_64), I followed this link, and it went well, it launches, however I'm relying on X, not Wayland. Couldn't find anything explaining what dependencies I need for Wayland.

      Then I moved towards cross-compiling. Created this question on StackOverflow

      Basically I'm getting

      qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
      qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
      qt.qpa.plugin: Could not find the Qt platform plugin "eglfs" in ""
      This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
      
      qemu: uncaught target signal 6 (Aborted) - core dumped
      Aborted
      

      Seems like, as my image/SDK won't have any X, I can't rely on xcb. What dependencies I need to add to my SDK to be able to simply run the Unit Tests under qemu?

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You should start your application with the QT_DEBUG_PLUGINS environment variable set to 1 to see exactly why the plugins fail to load.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        You should start your application with the QT_DEBUG_PLUGINS environment variable set to 1 to see exactly why the plugins fail to load.

        D Offline
        D Offline
        drebelpai
        wrote on last edited by
        #3

        @SGaist
        When I did that (passing to qemu), I still get the same thing, only the first line is new:

        qemu-aarch64 -L $SDKTARGETSYSROOT -E QT_DEBUG_PLUGINS=1 install/Debug/bin/appExample
        QFactoryLoader::QFactoryLoader() checking directory path "<path-to-app>/install/Debug/bin/platforms" ...
        qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
        qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
        qt.qpa.plugin: Could not find the Qt platform plugin "eglfs" in ""
        This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
        
        qemu: uncaught target signal 6 (Aborted) - core dumped
        Aborted
        

        There's nothing installed in /bin/platforms, but also there's not installed on x86_64 as well, and still loads successfully.

        SGaistS 1 Reply Last reply
        0
        • D drebelpai

          @SGaist
          When I did that (passing to qemu), I still get the same thing, only the first line is new:

          qemu-aarch64 -L $SDKTARGETSYSROOT -E QT_DEBUG_PLUGINS=1 install/Debug/bin/appExample
          QFactoryLoader::QFactoryLoader() checking directory path "<path-to-app>/install/Debug/bin/platforms" ...
          qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
          qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
          qt.qpa.plugin: Could not find the Qt platform plugin "eglfs" in ""
          This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
          
          qemu: uncaught target signal 6 (Aborted) - core dumped
          Aborted
          

          There's nothing installed in /bin/platforms, but also there's not installed on x86_64 as well, and still loads successfully.

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Might be a silly question but did you deploy Qt in your emulator ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          D 1 Reply Last reply
          0
          • SGaistS SGaist

            Might be a silly question but did you deploy Qt in your emulator ?

            D Offline
            D Offline
            drebelpai
            wrote on last edited by drebelpai
            #5

            @SGaist AFAIK my question can be silly as well :)

            My main question is, given an SDK generated by Yocto (that is used to compile a Qt application and its UTs) how can I run the Unit Tests using only qemu? (If this was a plain Cpp app, the line I used to run it would suffice)

            So, yeah, the sysroot where the qemu lives, and it uses has Qt.


            I tried now to copy the platforms/ folder under /opt/sdk-folder/0.0.1/sysroot/.../usr/lib/plugins/platforms/ to the path it says it was trying to reach(where I built it), and it works. Do you know which env variable Qt uses to look for it? Then I might be able to correctly set it up!

            D 1 Reply Last reply
            0
            • D drebelpai

              @SGaist AFAIK my question can be silly as well :)

              My main question is, given an SDK generated by Yocto (that is used to compile a Qt application and its UTs) how can I run the Unit Tests using only qemu? (If this was a plain Cpp app, the line I used to run it would suffice)

              So, yeah, the sysroot where the qemu lives, and it uses has Qt.


              I tried now to copy the platforms/ folder under /opt/sdk-folder/0.0.1/sysroot/.../usr/lib/plugins/platforms/ to the path it says it was trying to reach(where I built it), and it works. Do you know which env variable Qt uses to look for it? Then I might be able to correctly set it up!

              D Offline
              D Offline
              drebelpai
              wrote on last edited by
              #6

              For anyone that came here trying to manually run Qemu unit tests (without booting up an image) for Qt:

              qemu-aarch64 -L $SDKTARGETSYSROOT -E QT_QPA_PLATFORM_PLUGIN_PATH=$SDKTARGETSYSROOT/usr/lib/plugins <path-to/testing-bin>

              Works!
              Note: I don't know if that's the best solution, and it might be the case that there's a cleaner solution though :) Please improve it
              Note2: This forces you to run it manually, not with ctest. Ideas on how to run it through ctest are welcome.

              Take into account that this is also a simple solution. And only works for plain Qt, qmltests are still not working.

              1 Reply Last reply
              1

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved