Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Run test as superuser inside QtCreator

Run test as superuser inside QtCreator

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
test automationroot permissionserial port
2 Posts 2 Posters 485 Views
  • 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.
  • C Offline
    C Offline
    CristianoNarcisiVidex
    wrote on last edited by
    #1

    Hi all
    i am developing my own test project and i am struggling to solve this issue. I would like to exploit the amazing GUI of QtCreator for checking if the modifications i have been making provoke any regressions. Unfortunately, i have to use QSerialPort and, because of my OS is Ubuntu, i need the super user permission for opening that port. The tests obviously fails because i am trying to send data over a closed serial port. How can i run it as superuser?

    Some spoliers:

    • checking the Run as root user option either in Debug or Release mode doesn't help me. It seems that the Test Results-> Run All Tests button catches its configurations from somewhere else

    Any help will be very appreciated

    Thank you very much

    Cristiano Narcisi

    jsulmJ 1 Reply Last reply
    0
    • C CristianoNarcisiVidex

      Hi all
      i am developing my own test project and i am struggling to solve this issue. I would like to exploit the amazing GUI of QtCreator for checking if the modifications i have been making provoke any regressions. Unfortunately, i have to use QSerialPort and, because of my OS is Ubuntu, i need the super user permission for opening that port. The tests obviously fails because i am trying to send data over a closed serial port. How can i run it as superuser?

      Some spoliers:

      • checking the Run as root user option either in Debug or Release mode doesn't help me. It seems that the Test Results-> Run All Tests button catches its configurations from somewhere else

      Any help will be very appreciated

      Thank you very much

      Cristiano Narcisi

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @CristianoNarcisiVidex said in Run test as superuser inside QtCreator:

      because of my OS is Ubuntu, i need the super user permission for opening that port

      That's wrong.
      You simply have to add your user to the group which has access to the device file of your serial port.
      See https://askubuntu.com/questions/58119/changing-permissions-on-serial-port
      "The issue with the permissions for /dev/ttyACM0 can be permanantly solved by adding yourself to the dialout group.
      You can do this with:
      sudo usermod -a -G dialout $USER
      Logout and then log back in for the group changes to take effect.
      "

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      5

      • Login

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