Skip to content

Commit a4cd7b0

Browse files
committed
Created parallel test class to speed up testing
1 parent 64ab4e8 commit a4cd7b0

File tree

13 files changed

+574
-49
lines changed

13 files changed

+574
-49
lines changed

AutoUpdater/updater.dox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ you will have to wait for it to finish to get your update result or check for up
114114
@notifyAc{runningChanged()}
115115
}
116116

117-
@sa Updater::exitedNormally, Updater::getErrorCode, Updater::getErrorLog
117+
@sa Updater::checkForUpdates, Updater::abortUpdateCheck, Updater::exitedNormally, Updater::getErrorCode, Updater::getErrorLog
118118
*/
119119

120120
/*!

AutoUpdater/updatetask.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ bool LoopUpdateTask::nextTask()
8585
this->nextPoint = this->pauseSpan().addToDateTime(NOW);
8686
return true;
8787
}
88-
} else if(this->repetitionsLeft < 0)
88+
} else if(this->repetitionsLeft < 0) {
89+
this->nextPoint = this->pauseSpan().addToDateTime(NOW);
8990
return true;
91+
}
9092

9193
return false;
9294
}

AutoUpdaterWidgets/updatecontroller.cpp

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,6 @@ bool UpdateController::isRunning() const
6868
return d->running;
6969
}
7070

71-
QWidget *UpdateController::parentWindow() const
72-
{
73-
const Q_D(UpdateController);
74-
return d->window;
75-
}
76-
77-
void UpdateController::setParentWindow(QWidget *parentWindow)
78-
{
79-
Q_D(UpdateController);
80-
d->window = parentWindow;
81-
d->infoDialog->setNewParent(parentWindow);
82-
}
83-
8471
bool UpdateController::runAsAdmin() const
8572
{
8673
const Q_D(UpdateController);
@@ -122,6 +109,28 @@ Updater *UpdateController::getUpdater() const
122109
return d->mainUpdater;
123110
}
124111

112+
QWidget *UpdateController::parentWidget() const
113+
{
114+
const Q_D(UpdateController);
115+
return d->window;
116+
}
117+
118+
void UpdateController::setParent(QWidget *parent)
119+
{
120+
Q_D(UpdateController);
121+
d->window = parent;
122+
d->infoDialog->setNewParent(parent);
123+
this->QObject::setParent(parent);
124+
}
125+
126+
void UpdateController::setParent(QObject *parent)
127+
{
128+
Q_D(UpdateController);
129+
d->window = NULL;
130+
d->infoDialog->setNewParent(NULL);
131+
this->QObject::setParent(parent);
132+
}
133+
125134
bool UpdateController::start(DisplayLevel displayLevel)
126135
{
127136
Q_D(UpdateController);

AutoUpdaterWidgets/updatecontroller.dox

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
@brief Shows sample images for the updater for all the supported platforms
55

6+
Back to UpdaterController.
7+
68
## Windows - Windows 10
79
#### The Updater Elements
810
@image html ./doc/images/win/dialog_ask.png "Ask Dialog"<br>
@@ -74,11 +76,11 @@ to do is starting this controller. This can be done in 4 ways:
7476
For a full collection of all immages, please go to the @ref image_page "Image Page"
7577

7678
## Example
77-
This example will show you the full capability of the controller. Since there is no
79+
This example will show you the basic capabilities of the controller. Since there is no
7880
mainwindow in this example, you will only see the controller dialogs. Please not that
7981
you can control how much of that dialogset will be shown to the user. This example is
8082
reduced! for a full example with all parts of the controller, check the
81-
Tests/WidegtsTest application.
83+
Tests/WidegtsTest application!
8284

8385
@attention Since this library requires the maintenancetool that is deployed with every
8486
Qt Installer Framework installation, the examples cannot be tested without a
@@ -115,3 +117,59 @@ int main(int argc, char *argv[])
115117
}
116118
@endcode
117119
*/
120+
121+
/*!
122+
@property QtAutoUpdater::UpdateController::maintenanceToolPath
123+
124+
@default{Updater::maintenanceToolPath}
125+
126+
This property is simply the forewarded Updater::maintenanceToolPath. Check the
127+
documentation of that property for more details.
128+
129+
@accessors{
130+
@readAc{maintenanceToolPath()}
131+
@constantAc
132+
@finalAc
133+
}
134+
135+
@sa Updater::maintenanceToolPath
136+
*/
137+
138+
/*!
139+
@property QtAutoUpdater::Updater::running
140+
141+
@default{`false`}
142+
143+
The controller can only run once at a time. If this property returns `true`, you will
144+
have to wait for it to finish to start it again. Please note that "running" includes
145+
not just that actual update check, but all the dialogs too. This means the Updater::running
146+
property of the attached updater can return `false` while this one returns `true`.
147+
148+
@accessors{
149+
@readAc{isRunning()}
150+
@notifyAc{runningChanged()}
151+
}
152+
153+
@sa UpdateController::getUpdater, UpdateController::start, UpdateController::cancelUpdate
154+
*/
155+
156+
/*!
157+
@property QtAutoUpdater::Updater::runAsAdmin
158+
159+
@default{`true`}
160+
161+
Specifies whether the controller should run the updater (**not** the update check) as
162+
admin/root. If set `true`, the user will be prompted to allow this elevation (and enter
163+
his password).
164+
165+
@note This property only specifies a "suggestion" to the user. If you want to disallow
166+
the user to change this, you will have to explicitly set it to be unchangable using
167+
the write accessor function of this property.
168+
169+
@accessors{
170+
@readAc{runAsAdmin()}
171+
@writeAc{setRunAsAdmin()}
172+
}
173+
174+
@sa UpdateController::getUpdater, UpdateController::start, UpdateController::cancelUpdate
175+
*/

AutoUpdaterWidgets/updatecontroller.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ namespace QtAutoUpdater
1717
Q_OBJECT
1818

1919
//! Holds the path of the attached maintenancetool
20-
Q_PROPERTY(QString maintenanceToolPath READ maintenanceToolPath CONSTANT)
20+
Q_PROPERTY(QString maintenanceToolPath READ maintenanceToolPath CONSTANT FINAL)
2121
//! Specifies whether the controller is currently active or not
2222
Q_PROPERTY(bool running READ isRunning NOTIFY runningChanged)
23-
//! Holds the window to be used as parent for all dialogs
24-
Q_PROPERTY(QWidget* parentWindow READ parentWindow WRITE setParentWindow)
2523
//! Specifies whether the controller should run the updater as admin or not
2624
Q_PROPERTY(bool runAsAdmin READ runAsAdmin WRITE setRunAsAdmin)
2725
//! Holds the arguments to invoke the updater with
@@ -61,10 +59,6 @@ namespace QtAutoUpdater
6159
DisplayLevel currentDisplayLevel() const;
6260
//! READ-Accessor for UpdateController::running
6361
bool isRunning() const;
64-
//! READ-Accessor for UpdateController::parentWindow
65-
QWidget* parentWindow() const;
66-
//! WRITE-Accessor for UpdateController::parentWindow
67-
void setParentWindow(QWidget* parentWindow);
6862
//! READ-Accessor for UpdateController::runAsAdmin
6963
bool runAsAdmin() const;
7064
//! WRITE-Accessor for UpdateController::runAsAdmin
@@ -79,6 +73,13 @@ namespace QtAutoUpdater
7973
//! Returns the Updater object used by the controller
8074
Updater *getUpdater() const;
8175

76+
//! Returns the parent window
77+
QWidget* parentWidget() const;
78+
//! Changes the updaters parent to a new widget
79+
void setParent(QWidget* parent);
80+
//! Changes the updaters parent to an object without a widget
81+
void setParent(QObject* parent);
82+
8283
public slots:
8384
//! Starts the controller with the specified level.
8485
bool start(DisplayLevel displayLevel = ProgressLevel);

AutoUpdaterWidgets/updatecontroller_p.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#ifndef UPDATECONTROLLER_P_H
22
#define UPDATECONTROLLER_P_H
33

4+
#include <updater.h>
45
#include "updatecontroller.h"
56
#include "progressdialog.h"
67
#include "updateinfodialog.h"
7-
#include <updater.h>
88

99
namespace QtAutoUpdater
1010
{

QtAutoUpdater.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ SUBDIRS += \
77

88
DISTFILES += README.md \
99
LICENSE \
10-
merge_libs_scripts/win/merge_libs.bat \
1110
doc/QtAutoUpdater.doxy
1211

1312
AutoUpdaterWidgets.depends += AutoUpdater

Tests/UpdaterTest/UpdaterTest.pro

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ CONFIG -= app_bundle
1616
TEMPLATE = app
1717

1818

19-
SOURCES += tst_updatertest.cpp
19+
SOURCES += tst_updatertest.cpp \
20+
testmanager.cpp
2021
DEFINES += SRCDIR=\\\"$$PWD/\\\"
2122

2223
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../AutoUpdater/release/ -lAutoUpdater
@@ -35,3 +36,6 @@ else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/
3536
else:mac:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../AutoUpdater/libAutoUpdater.a
3637
else:mac:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../AutoUpdater/libAutoUpdater_debug.a
3738
else:unix: PRE_TARGETDEPS += $$OUT_PWD/../../AutoUpdater/libAutoUpdater.a
39+
40+
HEADERS += \
41+
testmanager.h

0 commit comments

Comments
 (0)