diff --git a/GMP.pri b/GMP.pri index b013a68..e36db85 100644 --- a/GMP.pri +++ b/GMP.pri @@ -5,17 +5,4 @@ # of this license document, but changing it is not allowed. # -!isEmpty(Qt_GMP_LIB):error("GMP.pri already included") -Qt_GMP_LIB = 1 - -#DEPENDS -CONFIG(release, debug|release): { - MINIGMP_LIBRARY_OUTPUT_DIR="$$PWD/build/release" -} else { - MINIGMP_LIBRARY_OUTPUT_DIR="$$PWD/build/debug" -} -unix:LIBS += -L$$MINIGMP_LIBRARY_OUTPUT_DIR -lminigmp - -win32:LIBS += -L$$MINIGMP_LIBRARY_OUTPUT_DIR -lminigmp - -INCLUDEPATH += "$$PWD" +include($$PWD/src/GMP.pri) diff --git a/GMP.pro b/GMP.pro index ae78d41..3afac6f 100644 --- a/GMP.pro +++ b/GMP.pro @@ -5,34 +5,15 @@ # of this license document, but changing it is not allowed. # +TEMPLATE = subdirs +CONFIG += ordered -QT -= core gui - -TARGET = MiniGMP -TEMPLATE = lib - -DEFINES += MINIGMP_LIBRARY -DEFINES += QT_DEPRECATED_WARNINGS +SUBDIRS += \ + src \ + tests +include($$PWD/tests/test.pri) VERSION = 6.1.2 -TARGET = minigmp -CONFIG += static - -CONFIG(release, debug|release): { - DESTDIR="$$PWD/build/release" -} else { - DESTDIR="$$PWD/build/debug" -} - -DISTFILES += \ - README \ - -HEADERS += \ - bigint.h \ - mini-gmp.h \ - minigmp_global.h - -SOURCES += \ - bigint.cpp \ - mini-gmp.c +src.file = src/GMP.pro +tests.file = tests/tests.pro diff --git a/src/GMP.pri b/src/GMP.pri new file mode 100644 index 0000000..b013a68 --- /dev/null +++ b/src/GMP.pri @@ -0,0 +1,21 @@ +# +# Copyright (C) 2018-2019 QuasarApp. +# Distributed under the lgplv3 software license, see the accompanying +# Everyone is permitted to copy and distribute verbatim copies +# of this license document, but changing it is not allowed. +# + +!isEmpty(Qt_GMP_LIB):error("GMP.pri already included") +Qt_GMP_LIB = 1 + +#DEPENDS +CONFIG(release, debug|release): { + MINIGMP_LIBRARY_OUTPUT_DIR="$$PWD/build/release" +} else { + MINIGMP_LIBRARY_OUTPUT_DIR="$$PWD/build/debug" +} +unix:LIBS += -L$$MINIGMP_LIBRARY_OUTPUT_DIR -lminigmp + +win32:LIBS += -L$$MINIGMP_LIBRARY_OUTPUT_DIR -lminigmp + +INCLUDEPATH += "$$PWD" diff --git a/src/GMP.pro b/src/GMP.pro new file mode 100644 index 0000000..39c661b --- /dev/null +++ b/src/GMP.pro @@ -0,0 +1,37 @@ +# +# Copyright (C) 2018-2019 QuasarApp. +# Distributed under the lgplv3 software license, see the accompanying +# Everyone is permitted to copy and distribute verbatim copies +# of this license document, but changing it is not allowed. +# + + +QT -= core gui + +TARGET = MiniGMP +TEMPLATE = lib + +DEFINES += MINIGMP_LIBRARY +DEFINES += QT_DEPRECATED_WARNINGS + +TARGET = minigmp + +CONFIG += static + +CONFIG(release, debug|release): { + DESTDIR="$$PWD/build/release" +} else { + DESTDIR="$$PWD/build/debug" +} + +DISTFILES += \ + README \ + +HEADERS += \ + bigint.h \ + mini-gmp.h \ + minigmp_global.h + +SOURCES += \ + bigint.cpp \ + mini-gmp.c diff --git a/Makefile b/src/Makefile similarity index 100% rename from Makefile rename to src/Makefile diff --git a/bigint.cpp b/src/bigint.cpp similarity index 100% rename from bigint.cpp rename to src/bigint.cpp diff --git a/bigint.h b/src/bigint.h similarity index 100% rename from bigint.h rename to src/bigint.h diff --git a/mini-gmp.c b/src/mini-gmp.c similarity index 100% rename from mini-gmp.c rename to src/mini-gmp.c diff --git a/mini-gmp.h b/src/mini-gmp.h similarity index 100% rename from mini-gmp.h rename to src/mini-gmp.h diff --git a/minigmp_global.h b/src/minigmp_global.h similarity index 100% rename from minigmp_global.h rename to src/minigmp_global.h diff --git a/tests/test.pri b/tests/test.pri new file mode 100644 index 0000000..e712cdb --- /dev/null +++ b/tests/test.pri @@ -0,0 +1,35 @@ +# +# Copyright (C) 2018-2019 QuasarApp. +# Distributed under the lgplv3 software license, see the accompanying +# Everyone is permitted to copy and distribute verbatim copies +# of this license document, but changing it is not allowed. +# + +unix:exec = $$PWD/tests/build/release/Qt-SecretTest,$$PWD/src/Qt-AES/build/release/QAESEncryption +win32:exec = $$PWD/tests/build/release/Qt-SecretTest.exe,$$PWD/src/Qt-AES/build/release/QAESEncryption.exe + + +contains(QMAKE_HOST.os, Linux):{ + DEPLOYER=cqtdeployer +} else { + DEPLOYER=%cqtdeployer% +} + +deployTest.commands = $$DEPLOYER -bin $$exec clear -qmake $$QMAKE_QMAKE -targetDir $$PWD/deployTests -libDir $$PWD -recursiveDepth 5 + +unix:test.commands = $$PWD/deployTests/miniGmpTests.sh +win32:test.commands = $$PWD/deployTests/miniGmpTests.exe + +contains(QMAKE_HOST.os, Linux):{ + DEPLOYER=cqtdeployer + win32:test.commands = wine $$PWD/deployTests/miniGmpTests.exe + +} else { + DEPLOYER=%cqtdeployer% +} + +test.depends += deployTest + +QMAKE_EXTRA_TARGETS += \ + deployTest \ + test diff --git a/tests/tests.pro b/tests/tests.pro new file mode 100644 index 0000000..7c2e51e --- /dev/null +++ b/tests/tests.pro @@ -0,0 +1,10 @@ +QT += testlib core +QT -= gui + +CONFIG += qt console warn_on depend_includepath testcase +CONFIG -= app_bundle + +TEMPLATE = app +TARGET = miniGmpTests + +SOURCES += tst_arithmetictests.cpp diff --git a/tests/tst_arithmetictests.cpp b/tests/tst_arithmetictests.cpp new file mode 100644 index 0000000..8c12f24 --- /dev/null +++ b/tests/tst_arithmetictests.cpp @@ -0,0 +1,35 @@ +#include <QtTest> + +// add necessary includes here + +class arithmetictests : public QObject +{ + Q_OBJECT + +public: + arithmetictests(); + ~arithmetictests(); + +private slots: + void test_case1(); + +}; + +arithmetictests::arithmetictests() +{ + +} + +arithmetictests::~arithmetictests() +{ + +} + +void arithmetictests::test_case1() +{ + +} + +QTEST_APPLESS_MAIN(arithmetictests) + +#include "tst_arithmetictests.moc"