From 2788e0a13646eef09842caef3798b6a3daf8a8d6 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 4 Jan 2023 21:00:11 +0200 Subject: [PATCH] Successful build of test binaries. --- src/app/puzzle/puzzle.qbs | 10 ++- src/app/tape/tape.qbs | 7 +- src/app/valentina/valentina.qbs | 7 +- src/libs/fervor/fervor.qbs | 2 +- src/libs/ifc/ifc.qbs | 2 +- src/libs/qmuparser/qmuparser.qbs | 2 +- src/libs/vdxf/vdxf.qbs | 2 +- src/libs/vformat/vformat.qbs | 2 +- src/libs/vgeometry/vgeometry.qbs | 2 +- src/libs/vlayout/vlayout.qbs | 2 +- src/libs/vmisc/vmisc.qbs | 2 +- src/libs/vobj/vobj.qbs | 2 +- src/libs/vpatterndb/vpatterndb.qbs | 2 +- .../vpropertyexplorer/vpropertyexplorer.qbs | 2 +- src/libs/vtest/vtest.qbs | 2 +- src/libs/vtools/vtools.qbs | 2 +- src/libs/vwidgets/vwidgets.qbs | 2 +- src/src.qbs | 2 +- src/test/CollectionTest/CollectionTest.qbs | 31 ++++++++ src/test/ParserTest/ParserTest.qbs | 27 +++++++ .../TranslationsTest/TranslationsTest.qbs | 45 +++++++++++ src/test/ValentinaTest/ValentinaTest.qbs | 77 +++++++++++++++++++ src/test/test.qbs | 8 ++ 23 files changed, 221 insertions(+), 21 deletions(-) create mode 100644 src/test/CollectionTest/CollectionTest.qbs create mode 100644 src/test/ParserTest/ParserTest.qbs create mode 100644 src/test/TranslationsTest/TranslationsTest.qbs create mode 100644 src/test/ValentinaTest/ValentinaTest.qbs create mode 100644 src/test/test.qbs diff --git a/src/app/puzzle/puzzle.qbs b/src/app/puzzle/puzzle.qbs index 1d3df245e..b3c74c347 100644 --- a/src/app/puzzle/puzzle.qbs +++ b/src/app/puzzle/puzzle.qbs @@ -10,6 +10,11 @@ VApp { Depends { name: "VWidgetsLib" } Depends { name: "FervorLib" } + Properties { + condition: cpp.defines.contains("APPIMAGE") + cpp.dynamicLibraries: ["icudata", "icui18n", "icuuc"] + } + name: "Puzzle" buildconfig.appTarget: qbs.targetOS.contains("macos") ? "Puzzle" : "puzzle" targetName: buildconfig.appTarget @@ -163,8 +168,5 @@ VApp { fileTags: ["cpp_pch_src"] } - cpp.includePaths: { - console.info(product.sourceDirectory) - return product.sourceDirectory - } + cpp.includePaths: [product.sourceDirectory] } diff --git a/src/app/tape/tape.qbs b/src/app/tape/tape.qbs index fb95b26e7..a06b58e07 100644 --- a/src/app/tape/tape.qbs +++ b/src/app/tape/tape.qbs @@ -12,6 +12,11 @@ VApp { Depends { name: "VWidgetsLib"; } Depends { name: "VToolsLib"; } + Properties { + condition: cpp.defines.contains("APPIMAGE") + cpp.dynamicLibraries: ["icudata", "icui18n", "icuuc"] + } + name: "Tape" buildconfig.appTarget: qbs.targetOS.contains("macos") ? "Tape" : "tape" targetName: buildconfig.appTarget @@ -81,7 +86,7 @@ VApp { name: "Precompiled headers" files: { var files = ["stable.h"]; - if (qbs.targetOS.contains("windows")) + if (qbs.toolchain.contains("msvc")) files.push("stable.cpp") return files; } diff --git a/src/app/valentina/valentina.qbs b/src/app/valentina/valentina.qbs index 21a92aad5..adcfed65e 100644 --- a/src/app/valentina/valentina.qbs +++ b/src/app/valentina/valentina.qbs @@ -19,6 +19,11 @@ VApp { required: false } + Properties { + condition: cpp.defines.contains("APPIMAGE") + cpp.dynamicLibraries: ["icudata", "icui18n", "icuuc"] + } + name: "Valentina" buildconfig.appTarget: qbs.targetOS.contains("macos") ? "Valentina" : "valentina" targetName: buildconfig.appTarget @@ -160,7 +165,7 @@ VApp { name: "Precompiled headers" files: { var files = ["stable.h"]; - if (qbs.targetOS.contains("windows")) + if (qbs.toolchain.contains("msvc")) files.push("stable.cpp") return files; } diff --git a/src/libs/fervor/fervor.qbs b/src/libs/fervor/fervor.qbs index 295550022..a7286b759 100644 --- a/src/libs/fervor/fervor.qbs +++ b/src/libs/fervor/fervor.qbs @@ -17,7 +17,7 @@ VLib { name: "Precompiled headers" files: { var files = ["stable.h"]; - if (qbs.targetOS.contains("windows")) + if (qbs.toolchain.contains("msvc")) files.push("stable.cpp") return files; } diff --git a/src/libs/ifc/ifc.qbs b/src/libs/ifc/ifc.qbs index 021d5e2d1..80a6245a4 100644 --- a/src/libs/ifc/ifc.qbs +++ b/src/libs/ifc/ifc.qbs @@ -74,7 +74,7 @@ VLib { name: "Precompiled headers" files: { var files = ["stable.h"]; - if (qbs.targetOS.contains("windows")) + if (qbs.toolchain.contains("msvc")) files.push("stable.cpp") return files; } diff --git a/src/libs/qmuparser/qmuparser.qbs b/src/libs/qmuparser/qmuparser.qbs index 3e3d92bea..cca2b39a0 100644 --- a/src/libs/qmuparser/qmuparser.qbs +++ b/src/libs/qmuparser/qmuparser.qbs @@ -37,7 +37,7 @@ VLib { name: "Precompiled headers" files: { var files = ["stable.h"]; - if (qbs.targetOS.contains("windows")) + if (qbs.toolchain.contains("msvc")) files.push("stable.cpp") return files; } diff --git a/src/libs/vdxf/vdxf.qbs b/src/libs/vdxf/vdxf.qbs index 9a4963066..bcf62f9c7 100644 --- a/src/libs/vdxf/vdxf.qbs +++ b/src/libs/vdxf/vdxf.qbs @@ -49,7 +49,7 @@ VLib { name: "Precompiled headers" files: { var files = ["stable.h"]; - if (qbs.targetOS.contains("windows")) + if (qbs.toolchain.contains("msvc")) files.push("stable.cpp") return files; } diff --git a/src/libs/vformat/vformat.qbs b/src/libs/vformat/vformat.qbs index 6ce6f2e60..d5ce5941d 100644 --- a/src/libs/vformat/vformat.qbs +++ b/src/libs/vformat/vformat.qbs @@ -20,7 +20,7 @@ VLib { name: "Precompiled headers" files: { var files = ["stable.h"]; - if (qbs.targetOS.contains("windows")) + if (qbs.toolchain.contains("msvc")) files.push("stable.cpp") return files; } diff --git a/src/libs/vgeometry/vgeometry.qbs b/src/libs/vgeometry/vgeometry.qbs index 2043be043..f6ebe7f90 100644 --- a/src/libs/vgeometry/vgeometry.qbs +++ b/src/libs/vgeometry/vgeometry.qbs @@ -56,7 +56,7 @@ VLib { name: "Precompiled headers" files: { var files = ["stable.h"]; - if (qbs.targetOS.contains("windows")) + if (qbs.toolchain.contains("msvc")) files.push("stable.cpp") return files; } diff --git a/src/libs/vlayout/vlayout.qbs b/src/libs/vlayout/vlayout.qbs index 7c40ffa27..2c1bc116c 100644 --- a/src/libs/vlayout/vlayout.qbs +++ b/src/libs/vlayout/vlayout.qbs @@ -76,7 +76,7 @@ VLib { name: "Precompiled headers" files: { var files = ["stable.h"]; - if (qbs.targetOS.contains("windows")) + if (qbs.toolchain.contains("msvc")) files.push("stable.cpp") return files; } diff --git a/src/libs/vmisc/vmisc.qbs b/src/libs/vmisc/vmisc.qbs index fcf8fd428..c1554c243 100644 --- a/src/libs/vmisc/vmisc.qbs +++ b/src/libs/vmisc/vmisc.qbs @@ -123,7 +123,7 @@ VLib { name: "Precompiled headers" files: { var files = ["stable.h"]; - if (qbs.targetOS.contains("windows")) + if (qbs.toolchain.contains("msvc")) files.push("stable.cpp") return files; } diff --git a/src/libs/vobj/vobj.qbs b/src/libs/vobj/vobj.qbs index 72e0a3cf3..17d33768c 100644 --- a/src/libs/vobj/vobj.qbs +++ b/src/libs/vobj/vobj.qbs @@ -16,7 +16,7 @@ VLib { name: "Precompiled headers" files: { var files = ["stable.h"]; - if (qbs.targetOS.contains("windows")) + if (qbs.toolchain.contains("msvc")) files.push("stable.cpp") return files; } diff --git a/src/libs/vpatterndb/vpatterndb.qbs b/src/libs/vpatterndb/vpatterndb.qbs index 4bb227e9b..91d436ec2 100644 --- a/src/libs/vpatterndb/vpatterndb.qbs +++ b/src/libs/vpatterndb/vpatterndb.qbs @@ -103,7 +103,7 @@ VLib { name: "Precompiled headers" files: { var files = ["stable.h"]; - if (qbs.targetOS.contains("windows")) + if (qbs.toolchain.contains("msvc")) files.push("stable.cpp") return files; } diff --git a/src/libs/vpropertyexplorer/vpropertyexplorer.qbs b/src/libs/vpropertyexplorer/vpropertyexplorer.qbs index 09ec1cfeb..2d4241eaf 100644 --- a/src/libs/vpropertyexplorer/vpropertyexplorer.qbs +++ b/src/libs/vpropertyexplorer/vpropertyexplorer.qbs @@ -91,7 +91,7 @@ VLib { name: "Precompiled headers" files: { var files = ["stable.h"]; - if (qbs.targetOS.contains("windows")) + if (qbs.toolchain.contains("msvc")) files.push("stable.cpp") return files; } diff --git a/src/libs/vtest/vtest.qbs b/src/libs/vtest/vtest.qbs index 6e9a8a68f..0861d643d 100644 --- a/src/libs/vtest/vtest.qbs +++ b/src/libs/vtest/vtest.qbs @@ -14,7 +14,7 @@ VLib { name: "Precompiled headers" files: { var files = ["stable.h"]; - if (qbs.targetOS.contains("windows")) + if (qbs.toolchain.contains("msvc")) files.push("stable.cpp") return files; } diff --git a/src/libs/vtools/vtools.qbs b/src/libs/vtools/vtools.qbs index a4421c161..95a0c1b7d 100644 --- a/src/libs/vtools/vtools.qbs +++ b/src/libs/vtools/vtools.qbs @@ -471,7 +471,7 @@ VLib { name: "Precompiled headers" files: { var files = ["stable.h"]; - if (qbs.targetOS.contains("windows")) + if (qbs.toolchain.contains("msvc")) files.push("stable.cpp") return files; } diff --git a/src/libs/vwidgets/vwidgets.qbs b/src/libs/vwidgets/vwidgets.qbs index 34ea849d1..9a707e4b9 100644 --- a/src/libs/vwidgets/vwidgets.qbs +++ b/src/libs/vwidgets/vwidgets.qbs @@ -65,7 +65,7 @@ VLib { name: "Precompiled headers" files: { var files = ["stable.h"]; - if (qbs.targetOS.contains("windows")) + if (qbs.toolchain.contains("msvc")) files.push("stable.cpp") return files; } diff --git a/src/src.qbs b/src/src.qbs index 704b7a2a4..ca15a733e 100644 --- a/src/src.qbs +++ b/src/src.qbs @@ -2,6 +2,6 @@ Project { references: [ "app/app.qbs", "libs/libs.qbs", - //"test/test.qbs", + "test/test.qbs", ] } diff --git a/src/test/CollectionTest/CollectionTest.qbs b/src/test/CollectionTest/CollectionTest.qbs new file mode 100644 index 000000000..79b4f70f7 --- /dev/null +++ b/src/test/CollectionTest/CollectionTest.qbs @@ -0,0 +1,31 @@ +VApp { + Depends { name: "buildconfig" } + Depends { name: "Qt"; submodules: ["testlib", "gui", "printsupport"] } + Depends { name: "VTestLib" } + + name: "CollectionTest" + buildconfig.appTarget: qbs.targetOS.contains("macos") ? "CollectionTest" : "collectionTest" + targetName: buildconfig.appTarget + type: base.concat("autotest") + bundle.isBundle: false + install: false + + files: [ + "qttestmainlambda.cpp", + "tst_tapecommandline.cpp", + "tst_valentinacommandline.cpp", + "tst_tapecommandline.h", + "tst_valentinacommandline.h", + ] + + Group { + name: "Precompiled headers" + files: { + var files = ["stable.h"]; + if (qbs.toolchain.contains("msvc")) + files.push("stable.cpp") + return files; + } + fileTags: ["cpp_pch_src"] + } +} diff --git a/src/test/ParserTest/ParserTest.qbs b/src/test/ParserTest/ParserTest.qbs new file mode 100644 index 000000000..3f8000912 --- /dev/null +++ b/src/test/ParserTest/ParserTest.qbs @@ -0,0 +1,27 @@ +VApp { + Depends { name: "buildconfig" } + Depends { name: "QMUParserLib" } + + name: "ParserTest" + buildconfig.appTarget: qbs.targetOS.contains("macos") ? "ParserTest" : "parserTest" + targetName: buildconfig.appTarget + type: base.concat("autotest") + consoleApplication: true + bundle.isBundle: false + install: false + + files: [ + "main.cpp" + ] + + Group { + name: "Precompiled headers" + files: { + var files = ["stable.h"]; + if (qbs.toolchain.contains("msvc")) + files.push("stable.cpp") + return files; + } + fileTags: ["cpp_pch_src"] + } +} diff --git a/src/test/TranslationsTest/TranslationsTest.qbs b/src/test/TranslationsTest/TranslationsTest.qbs new file mode 100644 index 000000000..8d9a51d3b --- /dev/null +++ b/src/test/TranslationsTest/TranslationsTest.qbs @@ -0,0 +1,45 @@ +import qbs.FileInfo + +VApp { + Depends { name: "buildconfig" } + Depends { name: "VTestLib" } + Depends { name: "Qt"; submodules: ["testlib", "xml", "gui", "printsupport"] } + + name: "TranslationsTest" + buildconfig.appTarget: qbs.targetOS.contains("macos") ? "TranslationsTest" : "translationsTest" + targetName: buildconfig.appTarget + type: base.concat("autotest") + bundle.isBundle: false + install: false + + files: [ + "qttestmainlambda.cpp", + "tst_measurementregexp.cpp", + "tst_qmuparsererrormsg.cpp", + "tst_tstranslation.cpp", + "tst_buitinregexp.cpp", + "tst_abstractregexp.cpp", + "tst_tslocaletranslation.cpp", + "tst_abstracttranslation.cpp", + "tst_measurementregexp.h", + "tst_qmuparsererrormsg.h", + "tst_tstranslation.h", + "tst_buitinregexp.h", + "tst_abstractregexp.h", + "tst_tslocaletranslation.h", + "tst_abstracttranslation.h", + ] + + Group { + name: "Precompiled headers" + files: { + var files = ["stable.h"]; + if (qbs.toolchain.contains("msvc")) + files.push("stable.cpp") + return files; + } + fileTags: ["cpp_pch_src"] + } + + cpp.defines: 'TS_DIR="' + FileInfo.joinPaths(project.sourceDirectory, "share", "translations") + '"' +} diff --git a/src/test/ValentinaTest/ValentinaTest.qbs b/src/test/ValentinaTest/ValentinaTest.qbs new file mode 100644 index 000000000..17fe0e91c --- /dev/null +++ b/src/test/ValentinaTest/ValentinaTest.qbs @@ -0,0 +1,77 @@ +VApp { + Depends { name: "buildconfig" } + Depends { name: "VTestLib" } + Depends { name: "Qt"; submodules: ["testlib", "xml", "gui", "printsupport"] } + Depends { name: "VMiscLib" } + Depends { name: "VToolsLib" } + + name: "ValentinaTest" + buildconfig.appTarget: qbs.targetOS.contains("macos") ? "ValentinaTest" : "valentinaTest" + targetName: buildconfig.appTarget + type: base.concat("autotest") + bundle.isBundle: false + install: false + + files: [ + "qttestmainlambda.cpp", + "tst_dxf.cpp", + "tst_vdomdocument.cpp", + "tst_vposter.cpp", + "tst_vspline.cpp", + "tst_nameregexp.cpp", + "tst_vlayoutdetail.cpp", + "tst_varc.cpp", + "tst_qmutokenparser.cpp", + "tst_vmeasurements.cpp", + "tst_vlockguard.cpp", + "tst_misc.cpp", + "tst_vcommandline.cpp", + "tst_vpiece.cpp", + "tst_vabstractcurve.cpp", + "tst_findpoint.cpp", + "tst_vellipticalarc.cpp", + "tst_vcubicbezierpath.cpp", + "tst_vgobject.cpp", + "tst_vsplinepath.cpp", + "tst_vpointf.cpp", + "tst_readval.cpp", + "tst_vtranslatevars.cpp", + "tst_vabstractpiece.cpp", + "tst_vtooluniondetails.cpp", + "tst_dxf.h", + "tst_vdomdocument.h", + "tst_vposter.h", + "tst_vspline.h", + "tst_nameregexp.h", + "tst_vlayoutdetail.h", + "tst_varc.h", + "tst_qmutokenparser.h", + "tst_vmeasurements.h", + "tst_vlockguard.h", + "tst_misc.h", + "tst_vcommandline.h", + "tst_vpiece.h", + "tst_vabstractcurve.h", + "tst_findpoint.h", + "tst_vellipticalarc.h", + "tst_vcubicbezierpath.h", + "tst_vgobject.h", + "tst_vsplinepath.h", + "tst_vpointf.h", + "tst_readval.h", + "tst_vtranslatevars.h", + "tst_vabstractpiece.h", + "tst_vtooluniondetails.h", + ] + + Group { + name: "Precompiled headers" + files: { + var files = ["stable.h"]; + if (qbs.toolchain.contains("msvc")) + files.push("stable.cpp") + return files; + } + fileTags: ["cpp_pch_src"] + } +} diff --git a/src/test/test.qbs b/src/test/test.qbs new file mode 100644 index 000000000..437daf349 --- /dev/null +++ b/src/test/test.qbs @@ -0,0 +1,8 @@ +Project { + references: [ + "ParserTest/ParserTest.qbs", + "ValentinaTest/ValentinaTest.qbs", + "TranslationsTest/TranslationsTest.qbs", + "CollectionTest/CollectionTest.qbs" + ] +}