Commit 211df6b6 authored by Clinton Stimpson's avatar Clinton Stimpson
Browse files

ENH:  Integrate Python testing framework with ParaView.  If testing with python
      is enabled, the play/record menus/dialogs give python as an option.

      It currently can query any QObject property and in python you can compare
      it to a known value.  Just throw an exception if the test fails.
      It can also take snapshots of arbitrary widgets and compare them to
      baselines.

      Also added a test that loads a histogram and takes a snapshot of the
      histogram widget and compares it to a baseline.
parent fe6b1ede
PROJECT(QtTesting)
#OPTION(QT_TESTING_WITH_PYTHON "Build Testing with Python" ON)
SET(QT_TESTING_WITH_PYTHON OFF)
OPTION(QT_TESTING_WITH_PYTHON "Build Testing with Python" ON)
SET(QT_TESTING_WITH_XML ON)
IF(QT_TESTING_WITH_PYTHON)
INCLUDE(${CMAKE_ROOT}/Modules/FindPythonLibs.cmake)
INCLUDE_DIRECTORIES(
${PYTHON_INCLUDE_PATH}
)
......@@ -40,6 +42,7 @@ QT4_WRAP_CPP(MOC_BUILT_SOURCES
pqComboBoxEventTranslator.h
pqDoubleSpinBoxEventTranslator.h
pqEventDispatcher.h
pqEventObserver.h
pqEventPlayer.h
pqEventSource.h
pqEventTranslator.h
......@@ -48,6 +51,7 @@ QT4_WRAP_CPP(MOC_BUILT_SOURCES
pqRecordEventsDialog.h
pqSpinBoxEventTranslator.h
pqStdoutEventObserver.h
pqTestUtility.h
pqThreadedEventSource.h
pqTabBarEventTranslator.h
pqWidgetEventTranslator.h
......@@ -91,6 +95,8 @@ ADD_LIBRARY(QtTesting
pqDoubleSpinBoxEventTranslator.h
pqEventDispatcher.cxx
pqEventDispatcher.h
pqEventObserver.cxx
pqEventObserver.h
pqEventPlayer.cxx
pqEventPlayer.h
pqEventTranslator.cxx
......@@ -112,6 +118,8 @@ ADD_LIBRARY(QtTesting
pqTabBarEventPlayer.h
pqTabBarEventTranslator.cxx
pqTabBarEventTranslator.h
pqTestUtility.cxx
pqTestUtility.h
pqThreadedEventSource.cxx
pqThreadedEventSource.h
pqWidgetEventPlayer.h
......
......@@ -41,7 +41,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QtTest>
#include <QtDebug>
pqAbstractActivateEventPlayer::pqAbstractActivateEventPlayer()
pqAbstractActivateEventPlayer::pqAbstractActivateEventPlayer(QObject * p)
: pqWidgetEventPlayer(p)
{
}
......
......@@ -44,7 +44,7 @@ class pqAbstractActivateEventPlayer :
public pqWidgetEventPlayer
{
public:
pqAbstractActivateEventPlayer();
pqAbstractActivateEventPlayer(QObject* p = 0);
bool playEvent(QObject* Object, const QString& Command, const QString& Arguments, bool& Error);
......
......@@ -35,7 +35,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QAbstractButton>
#include <QtDebug>
pqAbstractBooleanEventPlayer::pqAbstractBooleanEventPlayer()
pqAbstractBooleanEventPlayer::pqAbstractBooleanEventPlayer(QObject* p)
: pqWidgetEventPlayer(p)
{
}
......
......@@ -44,7 +44,7 @@ class pqAbstractBooleanEventPlayer :
public pqWidgetEventPlayer
{
public:
pqAbstractBooleanEventPlayer();
pqAbstractBooleanEventPlayer(QObject* p=0);
bool playEvent(QObject* Object, const QString& Command, const QString& Arguments, bool& Error);
......
......@@ -40,7 +40,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <iostream>
pqAbstractButtonEventTranslator::pqAbstractButtonEventTranslator()
pqAbstractButtonEventTranslator::pqAbstractButtonEventTranslator(QObject* p)
: pqWidgetEventTranslator(p)
{
}
......
......@@ -49,7 +49,7 @@ class pqAbstractButtonEventTranslator :
Q_OBJECT
public:
pqAbstractButtonEventTranslator();
pqAbstractButtonEventTranslator(QObject* p=0);
virtual bool translateEvent(QObject* Object, QEvent* Event, bool& Error);
......
......@@ -35,7 +35,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QDoubleSpinBox>
#include <QtDebug>
pqAbstractDoubleEventPlayer::pqAbstractDoubleEventPlayer()
pqAbstractDoubleEventPlayer::pqAbstractDoubleEventPlayer(QObject* p)
: pqWidgetEventPlayer(p)
{
}
......
......@@ -45,7 +45,7 @@ class pqAbstractDoubleEventPlayer :
public pqWidgetEventPlayer
{
public:
pqAbstractDoubleEventPlayer();
pqAbstractDoubleEventPlayer(QObject* p=0);
bool playEvent(QObject* Object, const QString& Command, const QString& Arguments, bool& Error);
......
......@@ -36,7 +36,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QSpinBox>
#include <QtDebug>
pqAbstractIntEventPlayer::pqAbstractIntEventPlayer()
pqAbstractIntEventPlayer::pqAbstractIntEventPlayer(QObject* p)
: pqWidgetEventPlayer(p)
{
}
......
......@@ -45,7 +45,7 @@ class pqAbstractIntEventPlayer :
public pqWidgetEventPlayer
{
public:
pqAbstractIntEventPlayer();
pqAbstractIntEventPlayer(QObject* p=0);
bool playEvent(QObject* Object, const QString& Command, const QString& Arguments, bool& Error);
......
......@@ -62,7 +62,8 @@ static QModelIndex GetIndex(QAbstractItemView& View, const QString& Name)
///////////////////////////////////////////////////////////////////////////////
// pqAbstractItemViewEventPlayer
pqAbstractItemViewEventPlayer::pqAbstractItemViewEventPlayer()
pqAbstractItemViewEventPlayer::pqAbstractItemViewEventPlayer(QObject* p)
: pqWidgetEventPlayer(p)
{
}
......
......@@ -45,7 +45,7 @@ class pqAbstractItemViewEventPlayer :
public pqWidgetEventPlayer
{
public:
pqAbstractItemViewEventPlayer();
pqAbstractItemViewEventPlayer(QObject* p=0);
bool playEvent(QObject* Object, const QString& Command, const QString& Arguments, bool& Error);
......
......@@ -51,7 +51,8 @@ static const QString str(const QModelIndex& index)
return result;
}
pqAbstractItemViewEventTranslator::pqAbstractItemViewEventTranslator() :
pqAbstractItemViewEventTranslator::pqAbstractItemViewEventTranslator(QObject* p)
: pqWidgetEventTranslator(p),
CurrentObject(0)
{
}
......
......@@ -51,7 +51,7 @@ class pqAbstractItemViewEventTranslator :
Q_OBJECT
public:
pqAbstractItemViewEventTranslator();
pqAbstractItemViewEventTranslator(QObject* p=0);
virtual bool translateEvent(QObject* Object, QEvent* Event, bool& Error);
......
......@@ -35,7 +35,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QAbstractSlider>
#include <QEvent>
pqAbstractSliderEventTranslator::pqAbstractSliderEventTranslator() :
pqAbstractSliderEventTranslator::pqAbstractSliderEventTranslator(QObject* p)
: pqWidgetEventTranslator(p),
CurrentObject(0)
{
}
......
......@@ -47,7 +47,7 @@ class pqAbstractSliderEventTranslator :
Q_OBJECT
public:
pqAbstractSliderEventTranslator();
pqAbstractSliderEventTranslator(QObject* p=0);
virtual bool translateEvent(QObject* Object, QEvent* Event, bool& Error);
......
......@@ -36,7 +36,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QLineEdit>
#include <QtDebug>
pqAbstractStringEventPlayer::pqAbstractStringEventPlayer()
pqAbstractStringEventPlayer::pqAbstractStringEventPlayer(QObject* p)
: pqWidgetEventPlayer(p)
{
}
......
......@@ -45,7 +45,7 @@ class pqAbstractStringEventPlayer :
public pqWidgetEventPlayer
{
public:
pqAbstractStringEventPlayer();
pqAbstractStringEventPlayer(QObject* p=0);
bool playEvent(QObject* Object, const QString& Command, const QString& Arguments, bool& Error);
......
......@@ -37,7 +37,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QWidget>
#include <QtDebug>
pqBasicWidgetEventPlayer::pqBasicWidgetEventPlayer()
pqBasicWidgetEventPlayer::pqBasicWidgetEventPlayer(QObject* p)
: pqWidgetEventPlayer(p)
{
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment