Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt "monkey" Testing - simulate random clicks and keypresses

Tags:

testing

qt

qttest

Is there a framework to simulate a deterministically pseudorandom series of clicks imposed upon a Qt application - in order to try to trigger any memory leaks, threading errors etc - typical monkey-testing?

Some exotic, monkey use for QTestLib?

like image 809
qdot Avatar asked Sep 10 '12 14:09

qdot


1 Answers

Yes, you can use the useful unit test module. Look in particular at the class QTestEventList. Just provide the QWidget you want to test, or the QMainWindow or whatever subclass you want and add the list of events you want to generate. If you want to generate a sequence of points so that you can reproduce in case of failure, use qsrand() and qrand().

like image 68
Luca Carlon Avatar answered Oct 04 '22 05:10

Luca Carlon