--- /dev/null
+//
+// SKID Examples: System In Test
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2014
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#include <QApplication>
+#include <QBoxLayout>
+#include <QDebug>
+#include <QLabel>
+#include <QMenu>
+#include <QMenuBar>
+#include <QMessageBox>
+
+#include "calculator.h"
+
+Calculator::Calculator ( QWidget *parent, Qt::WindowFlags f ) : QDialog ( parent, f )
+{
+ setWindowTitle("Stupid Calculator");
+
+ QVBoxLayout*vl;
+ setLayout(vl=new QVBoxLayout);
+ QMenuBar*mb;
+ vl->addWidget(mb=new QMenuBar,0);
+ QMenu*m=mb->addMenu("&Window");
+ m->addAction("&About",this,SLOT(about()));
+ m->addAction("About Q&t",qApp,SLOT(aboutQt()));
+ m->addSeparator();
+ m->addAction("&Quit",qApp,SLOT(quit()));
+
+ m=mb->addMenu("&Calculate");
+ m->addAction("&Add",this,SLOT(addSomething()));
+ m->addAction("&Multiply",this,SLOT(multiplySomething()));
+
+ vl->addWidget(new QLabel("Please use the menu!"),1);
+}
+
+void Calculator::addSomething()
+{
+
+}
+
+void Calculator::multiplySomething()
+{
+
+}
+
+void Calculator::about()
+{
+ QMessageBox::about(this,"About Stupid Calculator",
+ "<html><h1>About Stupid Calculator</h1>"
+ "This is a very stupid an unergonomic calculator."
+ "Do not expect it to make much sense, it exists to demonstrate"
+ "SKID GUI manipulation techniques.<p>"
+ );
+}
--- /dev/null
+//
+// SKID Examples: System In Test
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2014
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#ifndef SKID_EXAMPLE_CALCULATOR_H
+#define SKID_EXAMPLE_CALCULATOR_H
+
+#include <QDialog>
+
+class Calculator:public QDialog
+{
+ Q_OBJECT
+ public:
+ explicit Calculator ( QWidget *parent = 0, Qt::WindowFlags f = 0 );
+ public slots:
+ void addSomething();
+ void multiplySomething();
+
+ void about();
+};
+
+#endif
--- /dev/null
+#project file for system in test example: non-instrumented GUI
+TEMPLATE = app
+TARGET = guisit
+QT += widgets
+
+include(../../common.pri)
+DESTDIR = $$BINDIR
+
+#our actual sources:
+SOURCES += sitmain.cpp calculator.cpp
+HEADERS += calculator.h
\ No newline at end of file
--- /dev/null
+#project file for system in test example: instrumented GUI
+TEMPLATE = app
+TARGET = guisiti
+QT += widgets
+
+include(../../common.pri)
+DESTDIR = $$BINDIR
+INCLUDEPATH += ../../runnerlib/qt5gui/include
+
+#our actual sources:
+SOURCES += sitinstrumented.cpp calculator.cpp
+HEADERS += calculator.h
\ No newline at end of file
--- /dev/null
+//
+// SKID Examples: System In Test
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2014
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#include <QApplication>
+#include <QDebug>
+
+#include "calculator.h"
+#include <skidguiinit.h>
+
+
+int main(int ac,char**av)
+{
+ QApplication app(ac,av);
+ if(!Skid::Gui::initialize())
+ qDebug()<<"Unable to instrument this program with SKID GUI controller";
+
+ Calculator c;
+ c.show();
+
+ return app.exec();
+}
\ No newline at end of file
--- /dev/null
+//
+// SKID Examples: System In Test
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2014
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#include <QApplication>
+
+#include "calculator.h"
+
+
+int main(int ac,char**av)
+{
+ QApplication app(ac,av);
+
+ Calculator c;
+ c.show();
+
+ return app.exec();
+}
\ No newline at end of file
--- /dev/null
+//
+// SKID Examples: GUI Style Plugin Interface
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2014
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#include <QStylePlugin>
+#include <QStyleFactory>
+#include <QDebug>
+#include <QCoreApplication>
+
+#include "gplugin.h"
+#include "observer.h"
+
+#if defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
+#define STYLE "fusion"
+#elif defined(Q_OS_WIN)
+#define STYLE "windows"
+#elif defined(Q_OS_MAC)
+#define STYLE "macintosh"
+#else
+#define STYLE "fusion"
+#endif
+
+QStyle *SkidStylePlugin::create ( const QString &key )
+{
+ qDebug()<<"SKID init via Style Path";
+ Skid::Gui::Observer::initialize();
+ QString substyle=STYLE;
+ if(1){
+ const QByteArray st=qgetenv("SKIDSTYLE");
+ if(!st.isEmpty())
+ substyle=QString::fromLocal8Bit(st);
+ }
+ if(qApp!=nullptr){
+ for(const QString&arg:qApp->arguments())
+ if(arg.startsWith("-skidstyle="))
+ substyle=arg.mid(11);
+ }
+ if(key=="skidstyle"){
+ qDebug()<<"SKID creating instance of style"<<substyle<<"out of"<<QStyleFactory::keys();
+ return QStyleFactory::create(substyle);
+ }else{
+ return nullptr;
+ }
+}
+
+QStringList SkidStylePlugin::keys() const
+{
+ return QStringList()<<"skidstyle";
+}
--- /dev/null
+//
+// SKID Examples: GUI Style Plugin Interface
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2014
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#ifndef SKID_GUI_STYLE_PLUGIN_H
+#define SKID_GUI_STYLE_PLUGIN_H
+
+#include <QStylePlugin>
+
+///The pseudo style used to infuse a GUI based system-in-test with the SKID GUI observer.
+///It is usually selected by setting the QT_PLUGIN_PATH and QT_STYLE_OVERRIDE variables,
+///alternatively the -style parameter can be used or the program can be instrumented directly.
+///It returns the platform default style instead of creating a new one.
+///The environment variable SKIDSTYLE or the parameter -skidstyle=(style)
+///can be used to select a real style.
+class SkidStylePlugin:public QStylePlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "skidstyle.json")
+
+ public:
+ SkidStylePlugin() {}
+
+ QStringList keys() const;
+ QStyle *create(const QString &key);
+};
+
+#endif
--- /dev/null
+#project file for SKID pseudo style plugin
+
+#test runners are applications...
+TEMPLATE = lib
+CONFIG += plugin
+TARGET = skidstyle
+
+#it is usually designed to be non-graphical
+QT += gui widgets
+
+#config
+include (../common.pri)
+DESTDIR = $$LIBDIR/styles
+
+#our actual sources:
+SOURCES += gplugin.cpp observer.cpp
+HEADERS += gplugin.h observer.h
--- /dev/null
+//
+// SKID Examples: GUI Style Plugin Interface
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2014
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#include "observer.h"
+#include <QCoreApplication>
+#include <QTimer>
+#include <QDebug>
+
+using namespace Skid::Gui;
+
+static Observer *observer=nullptr;
+
+void Observer::initialize()
+{
+ if(observer)return;
+ observer=new Observer;
+ qDebug()<<"Initialized SKID GUI Observer";
+}
+
+static void observer_init(){Observer::initialize();}
+
+Q_COREAPP_STARTUP_FUNCTION(observer_init);
+
+Observer::Observer() : QObject()
+{
+ qApp->installEventFilter(this);
+}
+
+bool Observer::eventFilter ( QObject *, QEvent *event )
+{
+ if(event)
+ switch(event->type())
+ {
+ //events that influence window visibility
+ case QEvent::Close:
+ case QEvent::Hide:
+ case QEvent::Show:
+ case QEvent::ShowWindowRequest:
+ QTimer::singleShot(0,this,SLOT(reschedule()));
+ break;
+ default:/*nothing*/ break;
+ }
+ //pass events on to the actual program
+ return false;
+}
+
+void Observer::reschedule()
+{
+ qDebug()<<"SKID scheduler";
+}
--- /dev/null
+//
+// SKID Examples: GUI Style Plugin Interface
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2014
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#ifndef SKID_GUI_OBSERVER_H
+#define SKID_GUI_OBSERVER_H
+
+#include <QObject>
+
+namespace Skid { namespace Gui {
+
+class Observer:public QObject
+{
+ Q_OBJECT
+ public:
+ static void initialize();
+ protected:
+ bool eventFilter(QObject *obj, QEvent *event);
+ Observer ();
+ private slots:
+ void reschedule();
+};
+
+
+//end of namespace
+}}
+
+#endif
--- /dev/null
+{ "Keys": [ "skidstyle" ] }
\ No newline at end of file
--- /dev/null
+//
+// network connection include file for SKID
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2014
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#ifndef SKID_NETWORK_CONNECTION_H
+#define SKID_NETWORK_CONNECTION_H
+
+#include <QObject>
+
+class QTcpSocket;
+class QLocalSocket;
+class QSslSocket;
+
+namespace Skid {
+class Connection:public QObject
+{
+ Q_OBJECT
+ public:
+ explicit Connection ( QTcpSocket*, QObject *parent = 0 );
+ private slots:
+ void readData();
+};
+
+}
+
+#endif
--- /dev/null
+//
+// main include file for SKID
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2014
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#ifndef SKID_NETLIB_QT_SKID_EXPORT_H
+#define SKID_NETLIB_QT_SKID_EXPORT_H
+
+#include <QtGlobal>
+
+#ifdef SKIDNET_LIBBUILDSTATIC
+# define SKID_NETLIB_EXPORT
+#else
+# ifdef SKIDNET_LIBBUILD
+# define SKID_NETLIB_EXPORT Q_DECL_EXPORT
+# else
+# define SKID_NETLIB_EXPORT Q_DECL_IMPORT
+# endif
+#endif
+
+#endif
\ No newline at end of file
--- /dev/null
+//
+// main network include file for SKID
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2014
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+///\file skid.h
+///Include this file to gain access to all SKID runner facilities.
+
+#ifndef SKID_NETLIB_QT_SKID_H
+#define SKID_NETLIB_QT_SKID_H
+
+#include "skidnet-export.h"
+
+///This is the main namespace in which all SKID specific functions and classes exist.
+namespace Skid {
+};
+
+
+#include "skid-connection.h"
+
+using namespace Skid;
+
+#endif
--- /dev/null
+#project file for SKID network lib
+
+#change this if you want to change the way the library is linked
+# static - static library (linked into runner executable)
+# shared - DLL or shared object (potentially less disk space, but you need to deploy the DLL)
+# Note: don't use CONFIG directly it will be overwritten below
+RUNNERBUILD += static
+#RUNNERBUILD += shared
+
+#how to handle debug symbols of the runner lib itself
+# debug - with debug symbols
+# release - no debug symbols, release mode
+# debug_and_release - build both (recommended for Windows)
+# -> with Visual Studio the above have to match your runner
+CONFIG += debug
+#CONFIG += release
+#CONFIG += debug_and_release
+
+#END of configuration
+##########################
+
+include (../common.pri)
+
+#non-negotiable configuration :-)
+DEFINES += SKIDNET_LIBBUILD=1
+
+equals(RUNNERBUILD, static) {
+ DEFINES += SKIDNET_LIBBUILDSTATIC=1
+ PRL_EXPORT_DEFINES += SKIDNET_LIBBUILDSTATIC=1
+ CONFIG += static
+} else {
+ CONFIG += shared separate_debug_info
+}
+
+
+#target spec
+TEMPLATE = lib
+TARGET = skidnet
+DESTDIR = $$LIBDIR
+QT += network
+QT -= gui
+
+#source dirs
+INCLUDEPATH += $$PWD/include $$PWD/src
+DEPENDPATH += $$INCLUDEPATH
+
+#sources
+SOURCES += \
+ src/skid-connection.cpp
+
+HEADERS += \
+ include/skid-connection.h
\ No newline at end of file
--- /dev/null
+//
+// network connection for SKID
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2014
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#include "skidnet.h"
+
+Connection::Connection ( QTcpSocket*, QObject *parent )
+ :QObject(parent)
+{
+}
+
+void Connection::readData(){}
+
--- /dev/null
+#project file for SKID runnerlib for Qt5 based test runners
+
+#TODO: move this to skid.config
+#change this if you want to change the way the library is linked
+# static - static library (linked into runner executable)
+# shared - DLL or shared object (potentially less disk space, but you need to deploy the DLL)
+# Note: don't use CONFIG directly it will be overwritten below
+RUNNERBUILD += static
+#RUNNERBUILD += shared
+
+#how to handle debug symbols of the runner lib itself
+# debug - with debug symbols
+# release - no debug symbols, release mode
+# debug_and_release - build both (recommended for Windows)
+# -> with Visual Studio the above have to match your runner
+CONFIG += debug
+#CONFIG += release
+#CONFIG += debug_and_release
+
+#END of configuration
+##########################
+
+include (../../common.pri)
+
+#non-negotiable configuration :-)
+DEFINES += RUNNERQT5_LIBBUILD=1
+
+equals(RUNNERBUILD, static) {
+ DEFINES += RUNNERQT5_LIBBUILDSTATIC=1
+ PRL_EXPORT_DEFINES += RUNNERQT5_LIBBUILDSTATIC=1
+ CONFIG += static
+} else {
+ CONFIG += shared separate_debug_info
+}
+
+
+#target spec
+TEMPLATE = lib
+TARGET = skidguiqt5
+DESTDIR = $$LIBDIR
+QT += network
+QT -= gui
+
+#source dirs
+INCLUDEPATH += $$PWD/include $$PWD/src
+DEPENDPATH += $$INCLUDEPATH
+
+#sources
+SOURCES +=
+
+HEADERS +=
\ No newline at end of file
--- /dev/null
+//
+// SKID Examples: System In Test - initialize the GUI wrapper
+// This file is included by applications that want to auto-initialize.
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2014
+//
+// Copyright: See README/COPYING files that come with this distribution
+//
+//
+
+#ifndef SKID_GUI_PLUGIN_INIT_H
+#define SKID_GUI_PLUGIN_INIT_H
+
+#include <QStyleFactory>
+#include <QStyle>
+
+namespace Skid { namespace Gui {
+
+static inline bool initialize()
+{
+ //call the factory, which will implicitly load the plugin,
+ //the side effect of this is that the SKID GUI controller is initialized,
+ //... we don't really need the style object though ...
+ QStyle *st=QStyleFactory::create("skidstyle");
+ if(st){
+ delete st;
+ return true;
+ }else
+ return false;
+}
+
+}}
+
+#endif
TEMPLATE = subdirs
SUBDIRS = copygen version \
agent controller gui \
- runnerqt5 \
+ runnerqt5 guiqt5 guiplugin \
qt-simple qt-distrib \
- sit
+ sit guisit guisiti network
runnerqt5.file = runnerlib/qt5/runnerqt5.pro
sit.file = examples/system-in-test/sit.pro
sit.depends = copygen version
+guisit.file = examples/gui-system-in-test/sit.pro
+guisit.depends = copygen version
+
+guisiti.file = examples/gui-system-in-test/siti.pro
+guisiti.depends = copygen version guiqt5
+
+guiqt5.file = runnerlib/qt5gui/guilibqt5.pro
+guiqt5.depends = copygen version
+
gui.depends = copygen version
+guiplugin.file = guiplugin/guiplugin.pro
+
copygen.file = copygen/copygen.pro
version.depends = copygen