Add style command && applied new style format to existing code && setup tests plugins

This commit is contained in:
Quentin Rouland 2019-03-21 11:22:12 +01:00
parent aa4018c680
commit 7dc320f8ce
30 changed files with 355 additions and 267 deletions

13
.astylerc Normal file
View File

@ -0,0 +1,13 @@
suffix=none
recursive
--style=kr
--indent=spaces=4
--align-pointer=name
--align-reference=name
--convert-tabs
--attach-namespaces
--max-code-length=100
--max-instatement-indent=120
--pad-header
--pad-oper
--lineend=linux

View File

@ -37,7 +37,6 @@ set(DESKTOP_FILE_NAME ${PROJECT_NAME}.desktop)
add_executable(${PROJECT_NAME} main.cpp) add_executable(${PROJECT_NAME} main.cpp)
qt5_use_modules(${PROJECT_NAME} Gui Qml Quick) qt5_use_modules(${PROJECT_NAME} Gui Qml Quick)
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
@ -98,3 +97,18 @@ file(GLOB_RECURSE PROJECT_SRC_FILES
) )
add_custom_target(${PROJECT_NAME}_FILES ALL SOURCES ${PROJECT_SRC_FILES}) add_custom_target(${PROJECT_NAME}_FILES ALL SOURCES ${PROJECT_SRC_FILES})
# Tests
enable_testing(true)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories(tests/plugins)
find_package(Qt5Test)
add_executable(TestGpg tests/plugins/TestGpg.cpp)
add_executable(TestPass tests/plugins/TestPass.cpp)
target_link_libraries(TestGpg Qt5::Test)
target_link_libraries(TestPass Qt5::Test)
add_test(TestGpg TestGpg)
add_test(TestPass TestPass)

View File

@ -11,15 +11,15 @@ A password management app for Ubuntu Touch aiming to be compatible with [ZX2C4
For more options/details see the [clickable documentation](http://clickable.bhdouglass.com/en/latest/index.html) For more options/details see the [clickable documentation](http://clickable.bhdouglass.com/en/latest/index.html)
## Custom clickable command ## Custom clickable command
* ```clickable c ``` : clean third directory and run ```clickable clean``` * ```clickable test ``` : run test for all plugins
* ```clickable cr ``` : clean third directory and run ```clickable``` * ```clickable test_gpg ``` : run test for gpg plugin
* ```clickable r``` : run ```clickable --dirty``` * ```clickable test_pass``` : run test for pass plugin
* ```clickable crd ``` : clean third directory and run ```clickable desktop``` * ```clickable style ``` : reformat the code (Required : [astyle](astyle.sourceforge.ne) & [https://github.com/jesperhh/qmlfmt](https://github.com/jesperhh/qmlfmt))
* ```clickable rd ``` : run ```clickable desktop --dirty ```
# Contributing # Contributing
Any contributions are welcome using the github issue & pull request system. Any contributions are welcome using the github issue & pull request system.
Please try to respect the code style format by runnning ```clickable style``` before committing.
# Features # Features

View File

@ -1,5 +1,4 @@
{ {
template": "unconfined",
"policy_groups": [], "policy_groups": [],
"policy_version": 16.04 "policy_version": 16.04
} }

View File

@ -2,11 +2,11 @@
"template": "cmake", "template": "cmake",
"kill": "UTPass", "kill": "UTPass",
"scripts": { "scripts": {
"c": "third/clean.sh && clickable clean", "clean": "third/clean.sh && rm -rf build",
"cr": "third/clean.sh && clickable", "style": "astyle --options=.astylerc \"plugins/*.cpp,*.h\" && qmlfmt -w qml",
"r": "clickable --dirty", "test": "clickable run \"cd build && make test\"",
"crd": "third/clean.sh && clickable desktop", "test_gpg": "clickable run \"cd build && ./TestGpg\"",
"rd": "clickable desktop --dirty" "test_pass": "clickable run \"cd build && ./TestPass\""
}, },
"dependencies_build": [ "dependencies_build": [
"texinfo", "texinfo",

View File

@ -17,7 +17,8 @@
using namespace GpgME; using namespace GpgME;
using namespace QGpgME; using namespace QGpgME;
Gpg::Gpg() { Gpg::Gpg()
{
auto error = initializeLibrary(OpenPGP); auto error = initializeLibrary(OpenPGP);
if (error) { if (error) {
qDebug() << "Code Error : " << error.code(); qDebug() << "Code Error : " << error.code();
@ -25,7 +26,8 @@ Gpg::Gpg() {
qFatal("GpgME init fail"); qFatal("GpgME init fail");
} }
QString gnuhome = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation).append("/gpghome"); QString gnuhome = QStandardPaths::writableLocation(
QStandardPaths::AppDataLocation).append("/gpghome");
QDir dir(gnuhome); QDir dir(gnuhome);
if (!dir.exists()) if (!dir.exists())
dir.mkpath("."); dir.mkpath(".");
@ -37,16 +39,17 @@ Gpg::Gpg() {
qDebug() << "Code Error : " << error.code(); qDebug() << "Code Error : " << error.code();
qDebug() << "Error str : " << error.asString(); qDebug() << "Error str : " << error.asString();
qFatal("Engine check Fail"); qFatal("Engine check Fail");
} }
qDebug() << "GpgME Engine Version :" << engineInfo(OpenPGP).version(); qDebug() << "GpgME Engine Version :" << engineInfo(OpenPGP).version();
} }
void Gpg::list_dir() { void Gpg::list_dir()
{
qDebug() << "hello world!"; qDebug() << "hello world!";
} }
QString Gpg::decrypt(const QByteArray cipherText) { QString Gpg::decrypt(const QByteArray cipherText)
{
/*auto decJob = openpgp()->decryptJob(); /*auto decJob = openpgp()->decryptJob();
auto ctx = DecryptJob::context(decJob);*/ auto ctx = DecryptJob::context(decJob);*/
@ -61,7 +64,8 @@ QString Gpg::decrypt(const QByteArray cipherText) {
return QString::fromUtf8(plainText);*/ return QString::fromUtf8(plainText);*/
} }
QString Gpg::decrypt_file(const QString path) { QString Gpg::decrypt_file(const QString path)
{
/*QFile file(path); /*QFile file(path);
if (!file.open(QIODevice::ReadOnly)) { if (!file.open(QIODevice::ReadOnly)) {
qErrnoWarning("Can't open the File"); qErrnoWarning("Can't open the File");
@ -71,7 +75,8 @@ QString Gpg::decrypt_file(const QString path) {
return this->decrypt(plainText);*/ return this->decrypt(plainText);*/
} }
QByteArray Gpg::encrypt(const QString str) { QByteArray Gpg::encrypt(const QString str)
{
/*auto listjob = openpgp()->keyListJob(false, false, false); /*auto listjob = openpgp()->keyListJob(false, false, false);
std::vector<Key> keys; std::vector<Key> keys;
auto keylistresult = listjob->exec(QStringList() << QStringLiteral("alfa@example.net"), false, keys); auto keylistresult = listjob->exec(QStringList() << QStringLiteral("alfa@example.net"), false, keys);
@ -86,7 +91,8 @@ QByteArray Gpg::encrypt(const QString str) {
return cipherText;*/ return cipherText;*/
} }
bool Gpg::encrypt_file(const QString str, const QString path) { bool Gpg::encrypt_file(const QString str, const QString path)
{
/*QFile file(path); /*QFile file(path);
if (!file.open(QIODevice::WriteOnly)) { if (!file.open(QIODevice::WriteOnly)) {
qErrnoWarning("Can't open the File"); qErrnoWarning("Can't open the File");
@ -96,7 +102,8 @@ bool Gpg::encrypt_file(const QString str, const QString path) {
return true;*/ return true;*/
} }
QString Gpg::get_key_id(QString uid) { QString Gpg::get_key_id(QString uid)
{
qDebug() << "Getting the key id " << uid; qDebug() << "Getting the key id " << uid;
auto *job = openpgp()->keyListJob(false, false, false); auto *job = openpgp()->keyListJob(false, false, false);
std::vector<Key> keys; std::vector<Key> keys;
@ -112,7 +119,8 @@ QString Gpg::get_key_id(QString uid) {
return kId; return kId;
} }
QStringList Gpg::get_all_keys_id() { QStringList Gpg::get_all_keys_id()
{
qDebug() << "Show all available key"; qDebug() << "Show all available key";
auto job = openpgp()->keyListJob(false, false, false); auto job = openpgp()->keyListJob(false, false, false);
std::vector<Key> keys; std::vector<Key> keys;
@ -125,14 +133,15 @@ QStringList Gpg::get_all_keys_id() {
} }
auto r = QStringList(); auto r = QStringList();
for (const auto &key: keys) { for (const auto &key : keys) {
r.append(QLatin1String(key.keyID())); r.append(QLatin1String(key.keyID()));
qDebug() << "Key" << QLatin1String(key.keyID()); qDebug() << "Key" << QLatin1String(key.keyID());
} }
return r; return r;
} }
bool Gpg::import_key(QString path) { bool Gpg::import_key(QString path)
{
qDebug() << "Importing the key file" << path; qDebug() << "Importing the key file" << path;
QFile file(path); QFile file(path);
if (!file.open(QIODevice::ReadOnly)) { if (!file.open(QIODevice::ReadOnly)) {
@ -157,7 +166,7 @@ bool Gpg::import_key(QString path) {
qDebug() << "Result null" << result.isNull(); qDebug() << "Result null" << result.isNull();
qDebug() << "newUserIDs" << result.newUserIDs(); qDebug() << "newUserIDs" << result.newUserIDs();
for (const auto &key: result.imports()) for (const auto &key : result.imports())
qDebug() << "Key" << key.fingerprint(); qDebug() << "Key" << key.fingerprint();
return true; return true;

View File

@ -3,10 +3,11 @@
#include <QObject> #include <QObject>
class Gpg : public QObject { class Gpg : public QObject
{
Q_OBJECT Q_OBJECT
public: public:
Gpg(); Gpg();
~Gpg() = default; ~Gpg() = default;

View File

@ -3,7 +3,8 @@
#include "plugin.h" #include "plugin.h"
#include "gpg.h" #include "gpg.h"
void FileSystemPlugin::registerTypes(const char *uri) { void FileSystemPlugin::registerTypes(const char *uri)
{
//@uri Pass //@uri Pass
qmlRegisterSingletonType<Gpg>(uri, 1, 0, "Gpg", [](QQmlEngine *, QJSEngine *) -> QObject * { return new Gpg; }); qmlRegisterSingletonType<Gpg>(uri, 1, 0, "Gpg", [](QQmlEngine *, QJSEngine *) -> QObject * { return new Gpg; });
} }

View File

@ -3,12 +3,13 @@
#include <QQmlExtensionPlugin> #include <QQmlExtensionPlugin>
class FileSystemPlugin : public QQmlExtensionPlugin { class FileSystemPlugin : public QQmlExtensionPlugin
{
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID Q_PLUGIN_METADATA(IID
"org.qt-project.Qt.QQmlExtensionInterface") "org.qt-project.Qt.QQmlExtensionInterface")
public: public:
void registerTypes(const char *uri); void registerTypes(const char *uri);
}; };

View File

@ -3,11 +3,13 @@
#include "pass.h" #include "pass.h"
Pass::Pass() { Pass::Pass()
{
} }
void Pass::speak() { void Pass::speak()
{
qDebug() << "Starting app from main.cpp"; qDebug() << "Starting app from main.cpp";
} }

View File

@ -3,11 +3,12 @@
#include <QObject> #include <QObject>
class Pass : public QObject { class Pass : public QObject
{
Q_OBJECT Q_OBJECT
QString gpgHome; QString gpgHome;
public: public:
Pass(); Pass();
~Pass() override = default; ~Pass() override = default;

View File

@ -3,7 +3,8 @@
#include "plugin.h" #include "plugin.h"
#include "pass.h" #include "pass.h"
void PassPlugin::registerTypes(const char *uri) { void PassPlugin::registerTypes(const char *uri)
{
//@uri Pass //@uri Pass
qmlRegisterSingletonType<Pass>(uri, 1, 0, "Pass", [](QQmlEngine *, QJSEngine *) -> QObject * { return new Pass; }); qmlRegisterSingletonType<Pass>(uri, 1, 0, "Pass", [](QQmlEngine *, QJSEngine *) -> QObject * { return new Pass; });
} }

View File

@ -3,12 +3,13 @@
#include <QQmlExtensionPlugin> #include <QQmlExtensionPlugin>
class PassPlugin : public QQmlExtensionPlugin { class PassPlugin : public QQmlExtensionPlugin
{
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID Q_PLUGIN_METADATA(IID
"org.qt-project.Qt.QQmlExtensionInterface") "org.qt-project.Qt.QQmlExtensionInterface")
public: public:
void registerTypes(const char *uri) override; void registerTypes(const char *uri) override;
}; };

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: utpass.qrouland\n" "Project-Id-Version: utpass.qrouland\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-03-20 22:31+0000\n" "POT-Creation-Date: 2019-03-21 16:44+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,32 +17,32 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: ../qml/pages/PasswordList.qml:17 #: ../qml/pages/Settings.qml:8 ../qml/pages/headers/MainHeader.qml:49
msgid "Back"
msgstr ""
#: ../qml/pages/PasswordList.qml:39
msgid "No password found in the current folder"
msgstr ""
#: ../qml/pages/Settings.qml:8 ../qml/pages/headers/MainHeader.qml:47
msgid "Settings" msgid "Settings"
msgstr "" msgstr ""
#: ../qml/pages/headers/MainHeader.qml:8 ../qml/pages/headers/StackHeader.qml:8 #: ../qml/pages/PasswordList.qml:16
#: ../qml/pages/Info.qml:43 UTPass.desktop.in.h:1 msgid "Back"
msgid "UTPass"
msgstr "" msgstr ""
#: ../qml/pages/headers/MainHeader.qml:23 #: ../qml/pages/PasswordList.qml:38
#: ../qml/pages/headers/MainHeader.qml:36 msgid "No password found in the current folder"
msgid "Search"
msgstr "" msgstr ""
#: ../qml/pages/headers/MainHeader.qml:54 ../qml/pages/Info.qml:9 #: ../qml/pages/Info.qml:9 ../qml/pages/headers/MainHeader.qml:56
msgid "Info" msgid "Info"
msgstr "" msgstr ""
#: ../qml/pages/Info.qml:43 ../qml/pages/headers/MainHeader.qml:8
#: ../qml/pages/headers/StackHeader.qml:8 UTPass.desktop.in.h:1
msgid "UTPass"
msgstr ""
#: ../qml/pages/Info.qml:53 #: ../qml/pages/Info.qml:53
msgid "Suggest improvement(s) or report a bug(s)" msgid "Suggest improvement(s) or report a bug(s)"
msgstr "" msgstr ""
#: ../qml/pages/headers/MainHeader.qml:23
#: ../qml/pages/headers/MainHeader.qml:38
msgid "Search"
msgstr ""

View File

@ -6,7 +6,7 @@ import Gpg 1.0
import "components" import "components"
MainView { MainView {
id: root id: "root"
objectName: "mainView" objectName: "mainView"
applicationName: "utpass.qrouland" applicationName: "utpass.qrouland"
@ -18,7 +18,12 @@ MainView {
id: pageStack id: pageStack
anchors.fill: parent anchors.fill: parent
Component.onCompleted: push(pageStack.push(Qt.resolvedUrl("pages/PasswordList.qml"))) Component.onCompleted: push(pageStack.push(
Qt.resolvedUrl(
"pages/PasswordList.qml")))
}
Component.onCompleted: {
Gpg.import_key("password-store/public.key")
Gpg.get_all_keys_id()
} }
Component.onCompleted: { Gpg.import_key("password-store/public.key"); Gpg.get_all_keys_id();}
} }

View File

@ -25,7 +25,12 @@ Component {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { if (fileIsDir){ folderModel.folder = folderModel.folder + "/" + fileName ; backAction.visible = true;} } onClicked: {
if (fileIsDir) {
folderModel.folder = folderModel.folder + "/" + fileName
backAction.visible = true
}
}
} }
CustomBorder { CustomBorder {

View File

@ -6,13 +6,13 @@ Item {
property string url property string url
property string text property string text
property bool commonBorder : true property bool commonBorder: true
property int lBorderwidth : 0 property int lBorderwidth: 0
property int rBorderwidth : 0 property int rBorderwidth: 0
property int tBorderwidth : 0 property int tBorderwidth: 0
property int bBorderwidth : 0 property int bBorderwidth: 0
property int commonBorderWidth : 0 property int commonBorderWidth: 0
property string borderColor : UbuntuColors.warmGrey property string borderColor: UbuntuColors.warmGrey
width: parent.width width: parent.width
height: units.gu(6) height: units.gu(6)
@ -39,11 +39,13 @@ Item {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { Qt.openUrlExternally(parent.parent.url); } onClicked: {
Qt.openUrlExternally(parent.parent.url)
}
} }
CustomBorder { CustomBorder {
id : cb id: cb
commonBorder: parent.parent.commonBorder commonBorder: parent.parent.commonBorder
lBorderwidth: parent.parent.lBorderwidth lBorderwidth: parent.parent.lBorderwidth
rBorderwidth: parent.parent.rBorderwidth rBorderwidth: parent.parent.rBorderwidth

View File

@ -2,5 +2,4 @@ pragma Singleton
import QtQuick 2.4 import QtQuick 2.4
Item { Item {
} }

5
qml/models/Passtore.qml Normal file
View File

@ -0,0 +1,5 @@
pragma Singleton
import QtQuick 2.4
Item {
}

View File

@ -5,7 +5,7 @@ import "../components"
Page { Page {
header: StackHeader { header: StackHeader {
id : infoHeader id: infoHeader
title: i18n.tr('Info') title: i18n.tr('Info')
} }
@ -55,5 +55,3 @@ Page {
} }
} }
} }

View File

@ -4,10 +4,9 @@ import Qt.labs.folderlistmodel 2.1
import "../components" import "../components"
import "headers" import "headers"
Page { Page {
header : MainHeader { header: MainHeader {
flickable : nav flickable: nav
leadingActionBar.height: units.gu(4) leadingActionBar.height: units.gu(4)
leadingActionBar.actions: [ leadingActionBar.actions: [
@ -15,11 +14,11 @@ Page {
id: backAction id: backAction
iconName: "back" iconName: "back"
text: i18n.tr("Back") text: i18n.tr("Back")
visible:false visible: false
onTriggered: { onTriggered: {
folderModel.folder = folderModel.parentFolder; folderModel.folder = folderModel.parentFolder
if(folderModel.rootFolder === folderModel.folder) { if (folderModel.rootFolder === folderModel.folder) {
backAction.visible = false; backAction.visible = false
} }
} }
} }

View File

@ -4,7 +4,7 @@ import "headers"
Page { Page {
header: StackHeader { header: StackHeader {
id:settingsHeader id: settingsHeader
title: i18n.tr('Settings') title: i18n.tr('Settings')
} }
@ -26,5 +26,3 @@ Page {
} }
} }
} }

View File

@ -8,23 +8,25 @@ PageHeader {
title: i18n.tr("UTPass") title: i18n.tr("UTPass")
contents: Item { contents: Item {
height : parent.height height: parent.height
width: parent.width width: parent.width
Label { Label {
id : labelTitle id: labelTitle
text: mainHeader.title text: mainHeader.title
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
visible: true visible: true
} }
TextField { TextField {
id: searchBar id: searchBar
anchors.right : parent.right anchors.right: parent.right
anchors.left : parent.left anchors.left: parent.left
placeholderText: i18n.tr("Search") placeholderText: i18n.tr("Search")
height: units.gu(4) height: units.gu(4)
visible: false visible: false
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onFocusChanged: {} onFocusChanged: {
}
} }
} }
@ -35,8 +37,8 @@ PageHeader {
iconName: "search" iconName: "search"
text: i18n.tr("Search") text: i18n.tr("Search")
onTriggered: { onTriggered: {
searchBar.visible = !searchBar.visible; searchBar.visible = !searchBar.visible
labelTitle.visible = !searchBar.visible; labelTitle.visible = !searchBar.visible
if (searchBar.visible === true) { if (searchBar.visible === true) {
searchBar.focus = true searchBar.focus = true
} }

View File

@ -8,10 +8,10 @@ PageHeader {
title: i18n.tr("UTPass") title: i18n.tr("UTPass")
contents: Item { contents: Item {
height : parent.height height: parent.height
width: parent.width width: parent.width
Label { Label {
id : labelTitle id: labelTitle
text: stackHeader.title text: stackHeader.title
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }

View File

@ -2,33 +2,31 @@
// @ https://stackoverflow.com/questions/16534489/qml-control-border-width-and-color-on-any-one-side-of-rectangle-element#16562823 // @ https://stackoverflow.com/questions/16534489/qml-control-border-width-and-color-on-any-one-side-of-rectangle-element#16562823
import QtQuick 2.4 import QtQuick 2.4
Rectangle Rectangle {
{ property bool commonBorder: true
property bool commonBorder : true
property int lBorderwidth : 1 property int lBorderwidth: 1
property int rBorderwidth : 1 property int rBorderwidth: 1
property int tBorderwidth : 1 property int tBorderwidth: 1
property int bBorderwidth : 1 property int bBorderwidth: 1
property int commonBorderWidth : 1 property int commonBorderWidth: 1
z : -1 z: -1
property string borderColor : "white" property string borderColor: "white"
color: borderColor color: borderColor
anchors anchors {
{
left: parent.left left: parent.left
right: parent.right right: parent.right
top: parent.top top: parent.top
bottom: parent.bottom bottom: parent.bottom
topMargin : commonBorder ? -commonBorderWidth : -tBorderwidth topMargin: commonBorder ? -commonBorderWidth : -tBorderwidth
bottomMargin : commonBorder ? -commonBorderWidth : -bBorderwidth bottomMargin: commonBorder ? -commonBorderWidth : -bBorderwidth
leftMargin : commonBorder ? -commonBorderWidth : -lBorderwidth leftMargin: commonBorder ? -commonBorderWidth : -lBorderwidth
rightMargin : commonBorder ? -commonBorderWidth : -rBorderwidth rightMargin: commonBorder ? -commonBorderWidth : -rBorderwidth
} }
} }

View File

@ -2,9 +2,9 @@ pragma Singleton
import QtQuick 2.4 import QtQuick 2.4
Item { Item {
readonly property color claret : "#77172A" readonly property color claret: "#77172A"
readonly property color raisin_black : "#AE2B25" readonly property color raisin_black: "#AE2B25"
readonly property color steel_blue : "#462C98" readonly property color steel_blue: "#462C98"
readonly property color twilight_lavender : "#754888" readonly property color twilight_lavender: "#754888"
readonly property color eerie_black : "#191716" readonly property color eerie_black: "#191716"
} }

17
tests/plugins/TestGpg.cpp Normal file
View File

@ -0,0 +1,17 @@
#include <QtTest/QtTest>
class TestGpg: public QObject
{
Q_OBJECT
private slots:
void toUpper();
};
void TestGpg::toUpper()
{
QString str = "Hello";
QCOMPARE(str.toUpper(), QString("HELLO"));
}
QTEST_MAIN(TestGpg)
#include "TestGpg.moc"

View File

@ -0,0 +1,17 @@
#include <QtTest/QtTest>
class TestPass: public QObject
{
Q_OBJECT
private slots:
void toUpper();
};
void TestPass::toUpper()
{
QString str = "Hello";
QCOMPARE(str.toUpper(), QString("HELLO"));
}
QTEST_MAIN(TestPass)
#include "TestPass.moc"

View File

@ -56,7 +56,7 @@ ExternalProject_Add(
INSTALL_DIR ${EXTERNAL_LIBS} INSTALL_DIR ${EXTERNAL_LIBS}
DOWNLOAD_COMMAND "" DOWNLOAD_COMMAND ""
SOURCE_DIR ${GNUPG_PATH} SOURCE_DIR ${GNUPG_PATH}
CONFIGURE_COMMAND <SOURCE_DIR>/autogen.sh && <SOURCE_DIR>/configure --prefix=${EXTERNAL_LIBS} --enable-maintainer-mode --host ${ARCH_TRIPLET} --disable-doc CONFIGURE_COMMAND <SOURCE_DIR>/autogen.sh && <SOURCE_DIR>/configure --prefix=${EXTERNAL_LIBS} --enable-maintainer-mode --host ${ARCH_TRIPLET}
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
BUILD_COMMAND make BUILD_COMMAND make
INSTALL_COMMAND make install INSTALL_COMMAND make install