diff --git a/.gitmodules b/.gitmodules index 79bb2b1..a0b54f8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,3 +19,6 @@ [submodule "zip"] path = zip url = https://github.com/QuasarApp/zip.git +[submodule "UnitTests/backward-cpp"] + path = UnitTests/backward-cpp + url = https://github.com/QuasarApp/backward-cpp.git diff --git a/Deploy/Deploy.pro b/Deploy/Deploy.pro index 1376957..12ef184 100644 --- a/Deploy/Deploy.pro +++ b/Deploy/Deploy.pro @@ -56,6 +56,7 @@ SOURCES += \ configparser.cpp \ deploy.cpp \ deploycore.cpp \ + elf_type.cpp \ envirement.cpp \ extra.cpp \ extracter.cpp \ @@ -66,11 +67,10 @@ SOURCES += \ packagecontrol.cpp \ packing.cpp \ pathutils.cpp \ - pe.cpp \ igetlibinfo.cpp \ dependenciesscanner.cpp \ ../qtTools/src/shared/winutils/elfreader.cpp \ - elf.cpp \ + pe_type.cpp \ pluginsparser.cpp \ Distributions/qif.cpp \ qml.cpp \ @@ -92,6 +92,7 @@ HEADERS += \ deploy.h \ deploy_global.h \ deploycore.h \ + elf_type.h \ envirement.h \ extra.h \ extracter.h \ @@ -102,11 +103,10 @@ HEADERS += \ packagecontrol.h \ packing.h \ pathutils.h \ - pe.h \ igetlibinfo.h \ dependenciesscanner.h \ ../qtTools/src/shared/winutils/elfreader.h \ - elf.h \ + pe_type.h \ pluginsparser.h \ Distributions/qif.h \ qml.h \ diff --git a/Deploy/dependenciesscanner.h b/Deploy/dependenciesscanner.h index 03cfb04..2c56fd7 100644 --- a/Deploy/dependenciesscanner.h +++ b/Deploy/dependenciesscanner.h @@ -11,8 +11,8 @@ #include <QMultiMap> #include <QStringList> #include "deploy_global.h" -#include "pe.h" -#include "elf.h" +#include "pe_type.h" +#include "elf_type.h" #include "libinfo.h" diff --git a/Deploy/elf.cpp b/Deploy/elf_type.cpp similarity index 99% rename from Deploy/elf.cpp rename to Deploy/elf_type.cpp index 6384821..e881333 100644 --- a/Deploy/elf.cpp +++ b/Deploy/elf_type.cpp @@ -5,7 +5,7 @@ //# of this license document, but changing it is not allowed. //# -#include "elf.h" +#include "elf_type.h" #include <cmath> #include <QFileInfo> #include <quasarapp.h> diff --git a/Deploy/elf.h b/Deploy/elf_type.h similarity index 100% rename from Deploy/elf.h rename to Deploy/elf_type.h diff --git a/Deploy/pe.cpp b/Deploy/pe_type.cpp similarity index 99% rename from Deploy/pe.cpp rename to Deploy/pe_type.cpp index 0d43166..eef3f82 100644 --- a/Deploy/pe.cpp +++ b/Deploy/pe_type.cpp @@ -5,7 +5,7 @@ * of this license document, but changing it is not allowed. */ -#include "pe.h" +#include "pe_type.h" #include <QFile> #include <QFileInfo> diff --git a/Deploy/pe.h b/Deploy/pe_type.h similarity index 100% rename from Deploy/pe.h rename to Deploy/pe_type.h diff --git a/UnitTests/UnitTests.pro b/UnitTests/UnitTests.pro index dccebbb..c026b76 100644 --- a/UnitTests/UnitTests.pro +++ b/UnitTests/UnitTests.pro @@ -45,6 +45,7 @@ RESOURCES += \ res.qrc HEADERS += \ + backward-cpp/backward.hpp \ libcreator.h \ modules.h \ modulesqt513.h \ diff --git a/UnitTests/backward-cpp b/UnitTests/backward-cpp new file mode 160000 index 0000000..4715c7a --- /dev/null +++ b/UnitTests/backward-cpp @@ -0,0 +1 @@ +Subproject commit 4715c7a2b4dec61dee310221f5df3768213a3a24 diff --git a/UnitTests/tst_deploytest.cpp b/UnitTests/tst_deploytest.cpp index b6b7af8..7024491 100644 --- a/UnitTests/tst_deploytest.cpp +++ b/UnitTests/tst_deploytest.cpp @@ -29,23 +29,9 @@ #include "modules.h" #include "qmlcreator.h" #include "testutils.h" + +#include "backward-cpp/backward.hpp" // add necessary includes here -#include <signal.h> -#include <unistd.h> -#include <execinfo.h> - -void handler(int sig) { - void *array[10]; - size_t size; - - // get void*'s for all entries on the stack - size = backtrace(array, 10); - - // print out all the frames to stderr - fprintf(stderr, "Error: signal %d:\n", sig); - backtrace_symbols_fd(array, size, STDERR_FILENO); - exit(1); -} const QString TestBinDir = TEST_BIN_DIR; @@ -57,7 +43,7 @@ class deploytest : public QObject private: QHash<QString, QSet<QString>> filesTree; - + backward::SignalHandling bt; bool runProcess(const QString& DistroPath, const QString& filename, @@ -264,8 +250,7 @@ QSet<QString> deploytest::getFilesTree(const QStringList &keys) { } deploytest::deploytest() { - signal(SIGSEGV, handler); // install our handler - signal(SIGABRT, handler); // install our handler + QVERIFY(bt.loaded()); TestUtils utils;