-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from azubieta/implement_updates_using_github_…
…releases Implement updates using GitHub releases
- Loading branch information
Showing
8 changed files
with
153 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <QString> | ||
#include <QtTest> | ||
|
||
#include <QStringList> | ||
#include "../src/FilesCache.h" | ||
|
||
class FilesCacheTests : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
FilesCacheTests(); | ||
|
||
private Q_SLOTS: | ||
void testSaveAndLoadFileNames(); | ||
}; | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "UpdaterTests.h" | ||
|
||
#include <QSignalSpy> | ||
|
||
#include "../src/QSimpleUpdater/include/QSimpleUpdater.h" | ||
|
||
void UpdaterTests::testCheckForUpdates() | ||
{ | ||
QString githubApiReleasesUrl ="https://api.github.com/repos/mooltipass/moolticute/releases"; | ||
QSimpleUpdater *updater = QSimpleUpdater::getInstance(); | ||
|
||
updater->setModuleVersion(githubApiReleasesUrl, "0.0"); | ||
updater->setNotifyOnUpdate(githubApiReleasesUrl, true); | ||
updater->setDownloaderEnabled(githubApiReleasesUrl, true); | ||
updater->setNotifyOnFinish(githubApiReleasesUrl, "All done"); | ||
|
||
updater->checkForUpdates(githubApiReleasesUrl); | ||
|
||
QSignalSpy spyChecking(updater, &QSimpleUpdater::checkingFinished); | ||
spyChecking.wait(5000); | ||
|
||
QSignalSpy spyDownload(updater, &QSimpleUpdater::downloadFinished); | ||
spyDownload.wait(30000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include <QString> | ||
#include <QtTest> | ||
|
||
#include <QStringList> | ||
|
||
class UpdaterTests : public QObject | ||
{ | ||
Q_OBJECT | ||
private Q_SLOTS: | ||
void testCheckForUpdates(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include <QtTest> | ||
|
||
#include "FilesCacheTests.h" | ||
#include "UpdaterTests.h" | ||
|
||
#define TEST_CLASS(TestClass, status) \ | ||
{ \ | ||
TestClass tc; \ | ||
status |= QTest::qExec(&tc, argc, argv);\ | ||
} | ||
|
||
|
||
// Note: This is equivalent to QTEST_APPLESS_MAIN for multiple test classes. | ||
int main(int argc, char** argv) | ||
{ | ||
QApplication app(argc, argv); | ||
app.setAttribute(Qt::AA_Use96Dpi, true); | ||
|
||
int status = 0; | ||
TEST_CLASS(FilesCache, status); | ||
TEST_CLASS(UpdaterTests, status); | ||
|
||
return status; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters