Compare commits

...

6 commits

Author SHA1 Message Date
Roman Telezhynskyi 31f63f8a32 Fix building with < Qt 5.13. 2023-02-16 20:09:26 +02:00
Roman Telezhynskyi 5c2eb064bf Set working directory for autotest. 2023-02-16 20:09:26 +02:00
Roman Telezhynskyi 69a75decac Reuse build folder when run unit tests. 2023-02-16 20:09:26 +02:00
Roman Telezhynskyi 22972b8830 Setup LD_LIBRARY_PATH variable for autotest runner. 2023-02-16 20:09:26 +02:00
Roman Telezhynskyi 325d74bee4 Always treat -Wstrict-overflow as a warning with Clang. 2023-02-16 20:09:26 +02:00
Roman Telezhynskyi cb4083fa17 Trying to fix internal compiler error in GCC. 2023-02-16 20:09:26 +02:00
9 changed files with 60 additions and 18 deletions

View file

@ -73,7 +73,7 @@ linux_qt5_qbs_task_template: &LINUX_QT5_QBS_TASK_TEMPLATE
- qbs-config defaultProfile qt5
- qbs config profiles.qt5.baseProfile ${COMPILER}
- qbs build -f valentina.qbs -d build --command-echo-mode command-line profile:qt5 config:release
- xvfb-run -a qbs -p autotest-runner
- xvfb-run -a qbs -p autotest-runner -d build profile:qt5 config:release
#macos_task_template: &MACOS_TASK_TEMPLATE
# << : *REGULER_TASK_TEMPLATE

View file

@ -86,4 +86,17 @@ CppApplication {
qbs.install: true
qbs.installDir: buildconfig.installBinaryPath
}
Group {
name: "Precompiled headers"
condition: buildconfig.enablePCH
prefix: product.sourceDirectory + "/"
files: {
var files = ["stable.h"];
if (qbs.toolchain.contains("msvc"))
files.push("stable.cpp")
return files;
}
fileTags: ["cpp_pch_src"]
}
}

View file

@ -31,4 +31,17 @@ Library {
cpp.minimumMacosVersion: buildconfig.minimumMacosVersion
bundle.isBundle: buildconfig.frameworksBuild
}
Group {
name: "Precompiled headers"
condition: buildconfig.enablePCH
prefix: product.sourceDirectory + "/"
files: {
var files = ["stable.h"];
if (qbs.toolchain.contains("msvc"))
files.push("stable.cpp")
return files;
}
fileTags: ["cpp_pch_src"]
}
}

View file

@ -501,6 +501,7 @@ Module {
"-Wstrict-overflow=3",
"-Wstrict-overflow=4",
"-Wstrict-overflow=5",
"-Wno-error=strict-overflow",
"-Wstrict-prototypes",
"-Wstrict-selector-match",
"-Wstring-compare",
@ -705,8 +706,14 @@ Module {
if (Utilities.versionCompare(cpp.compilerVersion, "11") >= 0) {
debugFlags.push(
"-Wctad-maybe-unsupported",
"-Wmismatched-tags" // bugged in gcc 10
"-Wctad-maybe-unsupported"
)
}
if (qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos") &&
Utilities.versionCompare(cpp.compilerVersion, "10") >= 0) {
debugFlags.push(
"-Wno-mismatched-tags" // bugged in gcc
)
}
@ -858,17 +865,4 @@ Module {
}
vcs2.headerFileName: "vcsRepoState.h"
Group {
name: "Precompiled headers"
condition: buildconfig.enablePCH
prefix: product.sourceDirectory + "/"
files: {
var files = ["stable.h"];
if (qbs.toolchain.contains("msvc"))
files.push("stable.cpp")
return files;
}
fileTags: ["cpp_pch_src"]
}
}

View file

@ -6,11 +6,13 @@ VTestApp {
Depends { name: "Qt"; submodules: ["testlib", "gui", "printsupport"] }
Depends { name: "VTestLib" }
Depends { name: "conan.XercesC"; condition: buildconfig.useConanPackages }
Depends { name: "autotest" }
name: "CollectionTest"
buildconfig.appTarget: qbs.targetOS.contains("macos") ? "CollectionTest" : "collectionTest"
targetName: buildconfig.appTarget
type: base.concat("tst_files")
autotest.workingDir: product.buildDirectory
files: [
"qttestmainlambda.cpp",

View file

@ -5,10 +5,12 @@ VTestApp {
Depends { name: "VTestLib" }
Depends { name: "Qt"; submodules: ["testlib", "xml", "gui", "printsupport"] }
Depends { name: "conan.XercesC"; condition: buildconfig.useConanPackages }
Depends { name: "autotest" }
name: "TranslationsTest"
buildconfig.appTarget: qbs.targetOS.contains("macos") ? "TranslationsTest" : "translationsTest"
targetName: buildconfig.appTarget
autotest.workingDir: product.buildDirectory
files: [
"qttestmainlambda.cpp",

View file

@ -10,6 +10,7 @@ VTestApp {
Depends { name: "VDXFLib" }
Depends { name: "VFormatLib" }
Depends { name: "ebr" }
Depends { name: "autotest" }
Depends {
name: "Qt.xmlpatterns"
@ -20,6 +21,8 @@ VTestApp {
buildconfig.appTarget: qbs.targetOS.contains("macos") ? "ValentinaTest" : "valentinaTest"
targetName: buildconfig.appTarget
autotest.workingDir: product.buildDirectory
files: [
"qttestmainlambda.cpp",
"tst_dxf.cpp",

View file

@ -30,12 +30,16 @@
#include <QObject>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class TST_DXF :public QObject
{
Q_OBJECT // NOLINT
public:
explicit TST_DXF(QObject *parent = nullptr);
~TST_DXF() = default;
~TST_DXF() override = default;
private slots:
void initTestCase();

View file

@ -25,5 +25,16 @@ Project {
]
qbsSearchPaths: "qbs"
AutotestRunner {}
AutotestRunner {
Depends { name: "buildconfig" }
environment: {
var env = base;
if (qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos")) {
env.push("LD_LIBRARY_PATH=" + qbs.installRoot + qbs.installPrefix + "/" + buildconfig.libDirName + "/valentina");
}
return env;
}
}
}