Run test as superuser inside QtCreator
-
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
-
@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.
"