Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
c730ec352This file is pinned to the selected release. Download the original to open it in your design tool.
# Enable Qt MOC/UIC/RCC
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC OFF)
set(CMAKE_AUTORCC OFF)
# Path to test data
add_definitions(-DTEST_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/../data")
# Tests require libpthread
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
# Main executable
add_executable(
librepcb_unittests
core/3d/occmodeltest.cpp
core/algorithm/airwiresbuildertest.cpp
core/algorithm/netsegmentsimplifiertest.cpp
core/applicationtest.cpp
core/attribute/attributekeytest.cpp
core/attribute/attributesubstitutortest.cpp
core/attribute/attributetest.cpp
core/attribute/attributetypetest.cpp
core/attribute/attributeunittest.cpp
core/export/d356netlistgeneratortest.cpp
core/export/excellongeneratortest.cpp
core/export/gerberaperturelisttest.cpp
core/export/gerberattributetest.cpp
core/export/gerberattributewritertest.cpp
core/export/gerbergeneratortest.cpp
core/export/graphicsexporttest.cpp
core/export/graphicsexporttest.h
core/export/interactivehtmlbomtest.cpp
core/export/pickplacecsvwritertest.cpp
core/fileio/asynccopyoperationtest.cpp
core/fileio/csvfiletest.cpp
core/fileio/directorylocktest.cpp
core/fileio/filepathtest.cpp
core/fileio/fileutilstest.cpp
core/fileio/transactionaldirectorytest.cpp
core/fileio/transactionalfilesystemtest.cpp
core/fileio/versionfiletest.cpp
core/fileio/zipwriterziparchivetest.cpp
core/geometry/holetest.cpp
core/geometry/imagetest.cpp
core/geometry/pathtest.cpp
core/geometry/polygontest.cpp
core/geometry/stroketexttest.cpp
core/geometry/texttest.cpp
core/geometry/tracetest.cpp
core/geometry/vertextest.cpp
core/geometry/viatest.cpp
core/import/dxfreadertest.cpp
core/library/cmp/componentprefixtest.cpp
core/library/cmp/componentsymbolvariantitemsuffixtest.cpp
core/library/cmp/componentsymbolvariantitemtest.cpp
core/library/cmp/componenttest.cpp
core/library/cmpcat/componentcategorytest.cpp
core/library/dev/devicetest.cpp
core/library/librarybaseelementtest.cpp
core/library/librarytest.cpp
core/library/pkg/footprintpadtest.cpp
core/library/pkg/packagetest.cpp
core/library/pkgcat/packagecategorytest.cpp
core/library/sym/symbolpintest.cpp
core/library/sym/symboltest.cpp
core/network/filedownloadtest.cpp
core/network/networkrequestbasesignalreceiver.h
core/network/networkrequesttest.cpp
core/project/board/boardd356netlistexporttest.cpp
core/project/board/boarddesignrulechecktest.cpp
core/project/board/boarddesignrulestest.cpp
core/project/board/boardfabricationoutputsettingstest.cpp
core/project/board/boardgerberexporttest.cpp
core/project/board/boardinteractivehtmlbomgeneratortest.cpp
core/project/board/boardpickplacegeneratortest.cpp
core/project/board/boardplanefragmentsbuildertest.cpp
core/project/board/boardspecctraexporttest.cpp
core/project/outputjobrunnertest.cpp
core/project/projectjsonexporttest.cpp
core/project/projectlibrarytest.cpp
core/project/projecttest.cpp
core/serialization/serializableobjectlisttest.cpp
core/serialization/serializableobjectmock.h
core/serialization/sexpressiontest.cpp
core/sqlitedatabasetest.cpp
core/systeminfotest.cpp
core/types/alignmenttest.cpp
core/types/angletest.cpp
core/types/busnametest.cpp
core/types/circuitidentifiertest.cpp
core/types/fileproofnametest.cpp
core/types/lengthtest.cpp
core/types/pointtest.cpp
core/types/ratiotest.cpp
core/types/signalroletest.cpp
core/types/simplestringtest.cpp
core/types/tagtest.cpp
core/types/uuidtest.cpp
core/types/versiontest.cpp
core/utils/clipperhelperstest.cpp
core/utils/mathparsertest.cpp
core/utils/overlinemarkupparsertest.cpp
core/utils/scopeguardtest.cpp
core/utils/signalslottest.cpp
core/utils/tangentpathjoinertest.cpp
core/utils/toolboxtest.cpp
core/utils/transformtest.cpp
core/workspace/workspacelibrarydbtest.cpp
core/workspace/workspacesettingstest.cpp
core/workspace/workspacetest.cpp
eagleimport/eaglelibraryimporttest.cpp
eagleimport/eagleprojectimporttest.cpp
eagleimport/eagletypeconvertertest.cpp
editor/dialogs/dxfimportdialogtest.cpp
editor/dialogs/graphicsexportdialogtest.cpp
editor/library/cat/categorytreebuildertest.cpp
editor/library/cmd/cmdpackagereloadtest.cpp
editor/library/cmd/cmdsymbolreloadtest.cpp
editor/library/librarydownloadtest.cpp
editor/library/pkg/footprintclipboarddatatest.cpp
editor/library/sym/symbolclipboarddatatest.cpp
editor/modelview/pathmodeltest.cpp
editor/project/addcomponentdialogtest.cpp
editor/project/board/boardclipboarddatatest.cpp
editor/project/board/cmdboardspecctraimporttest.cpp
editor/project/schematic/schematicclipboarddatatest.cpp
editor/utils/shortcutsreferencegeneratortest.cpp
editor/utils/slinthelperstest.cpp
editor/widgets/editabletablewidgetreceiver.h
editor/widgets/editabletablewidgettest.cpp
editor/widgets/lengthedittest.cpp
editor/widgets/positivelengthedittest.cpp
editor/widgets/unsignedlengthedittest.cpp
editor/workspace/categorytreemodellegacytest.cpp
editor/workspace/categorytreemodeltest.cpp
kicadimport/kicadlibraryimporttest.cpp
main.cpp
testhelpers.cpp
testhelpers.h
)
target_include_directories(
librepcb_unittests
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../libs"
)
target_link_libraries(
librepcb_unittests
PRIVATE common
# LibrePCB
LibrePCB::Editor
LibrePCB::Core
# Third party
OpenCascade::OpenCascade
GTest::GTest
GTest::GMock
ParsEagle::ParsEagle
# Qt
${QT}::Concurrent
${QT}::Core
${QT}::Gui
${QT}::Test
${QT}::Widgets
# System
Threads::Threads
)
set_target_properties(
librepcb_unittests PROPERTIES OUTPUT_NAME librepcb-unittests
)
# Additional executable that's used for process tests
add_executable(
librepcb_unittests_dummy_binary
dummy.cpp
)
set_target_properties(
librepcb_unittests_dummy_binary PROPERTIES OUTPUT_NAME dummy-binary
)
# Generate translation file target
set(UNITTESTS_I18N_FILES_DIR "${CMAKE_SOURCE_DIR}/tests/data/i18n")
file(GLOB UNITTESTS_TS_FILES ${UNITTESTS_I18N_FILES_DIR}/unittests_*.ts)
set_source_files_properties(
${UNITTESTS_TS_FILES} PROPERTIES OUTPUT_LOCATION
"${UNITTESTS_I18N_FILES_DIR}"
)
qt6_add_translation(UNITTESTS_QM_FILES ${UNITTESTS_TS_FILES} OPTIONS -silent)
add_custom_target(librepcb_unittests_translations DEPENDS ${UNITTESTS_QM_FILES})
add_dependencies(librepcb_unittests librepcb_unittests_translations)