Warning, /kdevelop/kdev-krazy2/tests/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # Used by kde4_add_unit_test to set the full path to test executables
0002 set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
0003
0004 macro(UNIT_TESTS)
0005 foreach(_className ${ARGN})
0006 set(_testName ${_className}test)
0007 ecm_add_test(${_testName} LINK_LIBRARIES kdevkrazy2_library KDev::Tests Qt5::Test)
0008 endforeach(_className)
0009 endmacro(UNIT_TESTS)
0010
0011 set(EXAMPLETESTDATA_PATH "${CMAKE_CURRENT_BINARY_DIR}/examples")
0012 add_definitions(-DEXAMPLETESTDATA_PATH=\"${EXAMPLETESTDATA_PATH}/\")
0013
0014 unit_tests(
0015 analysisjob
0016 analysisparameters
0017 analysisprogressparser
0018 analysisresults
0019 analysisresultsparser
0020 checker
0021 checkerlistjob
0022 checkerlistparser
0023 checkermodel
0024 issue
0025 selectcheckerswidget
0026 selectpathswidget
0027 )
0028
0029 # Copy example files for real Krazy2 tests to binary directory. The source files
0030 # contain a "//krazy:skip" line to prevent the errors from being shown when
0031 # analyzing the project itself. That line is removed from the examples in the
0032 # binary directory for the errors to be shown in the tests.
0033 set(examples
0034 singleIssue.cpp
0035 singleExtraIssue.cpp
0036 singleIssueNonAsciiFileNameḶḷambión.cpp
0037 .singleIssueHiddenUnixFileName.cpp
0038 severalIssuesSingleChecker.cpp
0039 severalIssuesSeveralCheckers.cpp
0040 severalIssuesSeveralCheckersUnknownFileType.dqq
0041 subdirectory/singleIssue.desktop.example.do-not-translate
0042 subdirectory/severalIssuesSeveralCheckers.qml
0043 )
0044
0045 foreach(example ${examples})
0046 file(READ examples/${example} exampleContents)
0047 string(REPLACE "//krazy:skip\n" "" exampleContents "${exampleContents}")
0048 string(REPLACE "#krazy:skip\n" "" exampleContents "${exampleContents}")
0049 file(WRITE "${EXAMPLETESTDATA_PATH}/${example}" "${exampleContents}")
0050 endforeach(example)
0051
0052 # Translatable string extraction from desktop files is not handled by
0053 # Messages.sh; it is done automatically instead. So, as far as I know, there is
0054 # no way to prevent the extraction from a specific .desktop file. However,
0055 # singleIssue.desktop is just an example file used for the tests, and it should
0056 # not be translated, as it would be a waste of the translators' time. Thus, the
0057 # file in the source directory has an extension that will not be used for the
0058 # automatic string extraction, and it is renamed to the .desktop extension in
0059 # the build directory, where the tests are run.
0060 file(RENAME "${EXAMPLETESTDATA_PATH}/subdirectory/singleIssue.desktop.example.do-not-translate"
0061 "${EXAMPLETESTDATA_PATH}/subdirectory/singleIssue.desktop")