Add test for examples parsing

Change-Id: Id2ec8afcdbdff97e12b32b836c955552589081c4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Eike Ziller
2023-03-09 11:30:31 +01:00
parent 3859b70375
commit 87b5176fd2
7 changed files with 198 additions and 9 deletions

View File

@@ -3,6 +3,8 @@
#pragma once
#include "qtsupport_global.h"
#include <coreplugin/welcomepagehelper.h>
#include <utils/expected.h>
#include <utils/filepath.h>
@@ -11,7 +13,7 @@ namespace QtSupport::Internal {
enum InstructionalType { Example = 0, Demo, Tutorial };
class ExampleItem : public Core::ListItem
class QTSUPPORT_EXPORT ExampleItem : public Core::ListItem
{
public:
Utils::FilePath projectPath;
@@ -20,7 +22,6 @@ public:
Utils::FilePath mainFile; /* file to be visible after opening filesToOpen */
Utils::FilePaths dependencies;
InstructionalType type;
int difficulty = 0;
bool hasSourceCode = false;
bool isVideo = false;
bool isHighlighted = false;
@@ -29,10 +30,18 @@ public:
QStringList platforms;
};
Utils::expected_str<QList<ExampleItem *>> parseExamples(const Utils::FilePath &manifest,
const Utils::FilePath &examplesInstallPath,
const Utils::FilePath &demosInstallPath,
bool examples);
QTSUPPORT_EXPORT Utils::expected_str<QList<ExampleItem *>> parseExamples(
const Utils::FilePath &manifest,
const Utils::FilePath &examplesInstallPath,
const Utils::FilePath &demosInstallPath,
bool examples);
QTSUPPORT_EXPORT Utils::expected_str<QList<ExampleItem *>> parseExamples(
const QByteArray &manifestData,
const Utils::FilePath &manifestPath,
const Utils::FilePath &examplesInstallPath,
const Utils::FilePath &demosInstallPath,
bool examples);
} // namespace QtSupport::Internal