summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/manual/cmake-variables.7.rst1
-rw-r--r--Help/manual/ctest.1.rst25
-rw-r--r--Help/release/dev/ctest-memcheck-sanitizers.rst8
-rw-r--r--Help/release/dev/thread-sanitizer.rst5
-rw-r--r--Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst5
-rw-r--r--Help/variable/CTEST_MEMORYCHECK_TYPE.rst5
-rw-r--r--Modules/CPackIFW.cmake158
-rw-r--r--Modules/DartConfiguration.tcl.in1
-rw-r--r--Modules/FindBoost.cmake8
-rw-r--r--Modules/FindLATEX.cmake2
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake43
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.cxx55
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.h2
-rw-r--r--Source/CPack/IFW/cmCPackIFWInstaller.cxx124
-rw-r--r--Source/CPack/IFW/cmCPackIFWInstaller.h11
-rw-r--r--Source/CTest/cmCTestBatchTestHandler.cxx8
-rw-r--r--Source/CTest/cmCTestBatchTestHandler.h5
-rw-r--r--Source/CTest/cmCTestMemCheckCommand.cxx2
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx85
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.h6
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx8
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx24
-rw-r--r--Source/cmQtAutoGenerators.cxx8
-rw-r--r--Tests/CTestTestMemcheck/CMakeLists.txt46
-rw-r--r--Tests/CTestTestMemcheck/testAddressSanitizer.cmake5
-rw-r--r--Tests/CTestTestMemcheck/testMemorySanitizer.cmake27
-rw-r--r--Tests/CTestTestMemcheck/testUndefinedBehaviorSanitizer.cmake21
-rw-r--r--Tests/RunCMake/FPHSA/FindPseudo.cmake6
-rw-r--r--Tests/RunCMake/FPHSA/RunCMakeTest.cmake25
-rw-r--r--Tests/RunCMake/FPHSA/any_version.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/exact_0-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/exact_0.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/exact_0_matching.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1.1-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1.1.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1.2.2-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1.2.2.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1.2.3.3-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1.2.3.3.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1.2.3.4.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1.2.3.5-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1.2.3.5.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1.2.3.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1.2.4-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1.2.4.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1.2.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1.3-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1.3.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/exact_2-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/exact_2.cmake1
52 files changed, 596 insertions, 157 deletions
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 3f92ec5..864ea6e 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -351,6 +351,7 @@ Variables for CTest
/variable/CTEST_HG_UPDATE_OPTIONS
/variable/CTEST_MEMORYCHECK_COMMAND
/variable/CTEST_MEMORYCHECK_COMMAND_OPTIONS
+ /variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS
/variable/CTEST_MEMORYCHECK_SUPPRESSIONS_FILE
/variable/CTEST_MEMORYCHECK_TYPE
/variable/CTEST_NIGHTLY_START_TIME
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index a3210a9..03e86af 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -111,7 +111,7 @@ Options
``-D <dashboard>, --dashboard <dashboard>``
Execute dashboard test
- This option tells ctest to act as a Dart client and perform a
+ This option tells ctest to act as a CDash client and perform a
dashboard test. All tests are <Mode><Test>, where Mode can be
Experimental, Nightly, and Continuous, and Test can be Start,
Update, Configure, Build, Test, Coverage, and Submit.
@@ -127,14 +127,14 @@ Options
``-M <model>, --test-model <model>``
Sets the model for a dashboard
- This option tells ctest to act as a Dart client where the TestModel
+ This option tells ctest to act as a CDash client where the TestModel
can be Experimental, Nightly, and Continuous. Combining -M and -T
is similar to -D
``-T <action>, --test-action <action>``
Sets the dashboard action to perform
- This option tells ctest to act as a Dart client and perform some
+ This option tells ctest to act as a CDash client and perform some
action such as start, build, test etc. Combining -M and -T is
similar to -D
@@ -328,11 +328,8 @@ Options
used to detect implicit dependencies in a test suite.
``--submit-index``
- Submit individual dashboard tests with specific index
-
- This option allows performing the same CTest action (such as test)
- multiple times and submit all stages to the same dashboard (Dart2
- required). Each execution requires different index.
+ Legacy option for old Dart2 dashboard server feature.
+ Do not use.
``--timeout <seconds>``
Set a global timeout on all tests.
@@ -824,6 +821,18 @@ Configuration settings include:
* `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_COMMAND_OPTIONS`
* :module:`CTest` module variable: ``MEMORYCHECK_COMMAND_OPTIONS``
+``MemoryCheckType``
+ Specify the type of memory checking to perform.
+
+ * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_TYPE`
+ * :module:`CTest` module variable: ``MEMORYCHECK_TYPE``
+
+``MemoryCheckSanitizerOptions``
+ Specify options to sanitizers when running with a sanitize-enabled build.
+
+ * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_SANITIZER_OPTIONS`
+ * :module:`CTest` module variable: ``MEMORYCHECK_SANITIZER_OPTIONS``
+
``MemoryCheckSuppressionFile``
Specify a file containing suppression rules for the
``MemoryCheckCommand`` tool. It will be passed with options
diff --git a/Help/release/dev/ctest-memcheck-sanitizers.rst b/Help/release/dev/ctest-memcheck-sanitizers.rst
new file mode 100644
index 0000000..fa8fb81
--- /dev/null
+++ b/Help/release/dev/ctest-memcheck-sanitizers.rst
@@ -0,0 +1,8 @@
+ctest-memcheck-sanitizers
+-------------------------
+
+* The :command:`ctest_memcheck` command learned to support sanitizer
+ modes, including ``AddressSanitizer``, ``MemorySanitizer``,
+ ``ThreadSanitizer``, and ``UndefinedBehaviorSanitizer``.
+ Options may be set using the new
+ :variable:`CTEST_MEMORYCHECK_SANITIZER_OPTIONS` variable.
diff --git a/Help/release/dev/thread-sanitizer.rst b/Help/release/dev/thread-sanitizer.rst
deleted file mode 100644
index f38e8e1..0000000
--- a/Help/release/dev/thread-sanitizer.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-thread-sanitizer
-----------------
-
-* The :command:`ctest_memcheck` command learned to support
- ``ThreadSanitizer``.
diff --git a/Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst b/Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst
new file mode 100644
index 0000000..2de5fb6
--- /dev/null
+++ b/Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst
@@ -0,0 +1,5 @@
+CTEST_MEMORYCHECK_SANITIZER_OPTIONS
+-----------------------------------
+
+Specify the CTest ``MemoryCheckSanitizerOptions`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_MEMORYCHECK_TYPE.rst b/Help/variable/CTEST_MEMORYCHECK_TYPE.rst
index f7875da..f1087c0 100644
--- a/Help/variable/CTEST_MEMORYCHECK_TYPE.rst
+++ b/Help/variable/CTEST_MEMORYCHECK_TYPE.rst
@@ -1,6 +1,7 @@
CTEST_MEMORYCHECK_TYPE
--------------------------
+----------------------
Specify the CTest ``MemoryCheckType`` setting
in a :manual:`ctest(1)` dashboard client script.
-Valid values are Valgrind, Purify, BoundsChecker, and ThreadSanitizer.
+Valid values are Valgrind, Purify, BoundsChecker, and ThreadSanitizer,
+AddressSanitizer, MemorySanitizer, and UndefinedBehaviorSanitizer.
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake
index 8463b5d..4b8dc1e 100644
--- a/Modules/CPackIFW.cmake
+++ b/Modules/CPackIFW.cmake
@@ -25,6 +25,8 @@
# and Mac OS X.
#
# To use CPack ``IFW`` generator you must also install QtIFW_.
+# If you are not using the default path for the installation, please set
+# the path to the variable ``QTIFWDIR``.
#
# Variables
# ^^^^^^^^^
@@ -83,6 +85,19 @@
# The root package name, which will be used if configuration group is not
# specified
#
+# .. variable:: CPACK_IFW_REPOSITORIES_ALL
+#
+# The list of remote repositories.
+#
+# The default value of this variable is computed by CPack and contains
+# all repositories added with command :command:`cpack_ifw_add_repository`
+#
+# .. variable:: CPACK_IFW_DOWNLOAD_ALL
+#
+# If this is ``ON`` all components will be downloaded.
+# By default is ``OFF`` or used value
+# from :variable:`CPACK_DOWNLOAD_ALL` if set
+#
# Components
# """"""""""
#
@@ -95,7 +110,7 @@
# Additional prepared packages dirs that will be used to resolve
# dependent components.
#
-# Advanced
+# Tools
# """"""""
#
# .. variable:: CPACK_IFW_BINARYCREATOR_EXECUTABLE
@@ -104,20 +119,12 @@
#
# This variable is cached and can be configured user if need.
#
-# .. variable:: CPACK_IFW_BINARYCREATOR_EXECUTABLE_FOUND
-#
-# True if the "binarycreator" command line client was found.
-#
# .. variable:: CPACK_IFW_REPOGEN_EXECUTABLE
#
# The path to "repogen" command line client.
#
# This variable is cached and can be configured user if need.
#
-# .. variable:: CPACK_IFW_REPOGEN_EXECUTABLE_FOUND
-#
-# True if the "repogen" command line client was found.
-#
# Commands
# ^^^^^^^^^
#
@@ -191,6 +198,33 @@
# ``LICENSES`` pair of <display_name> and <file_path> of license text for this
# component group. You can specify more then one license.
#
+# --------------------------------------------------------------------------
+#
+# .. command:: cpack_ifw_add_repository
+#
+# Add QtIFW_ specific remote repository.
+#
+# ::
+#
+# cpack_ifw_add_repository(<reponame> [DISABLED]
+# URL <url>
+# [USERNAME <username>]
+# [PASSWORD <password>]
+# [DISPLAY_NAME <display_name>])
+#
+# This macro will also add the <reponame> repository
+# to a variable :variable:`CPACK_IFW_REPOSITORIES_ALL`
+#
+# ``DISABLED`` if set, then the repository will be disabled by default.
+#
+# ``URL`` is points to a list of available components.
+#
+# ``USERNAME`` is used as user on a protected repository.
+#
+# ``PASSWORD`` is password to use on a protected repository.
+#
+# ``DISPLAY_NAME`` is string to display instead of the URL.
+#
# Example usage
# ^^^^^^^^^^^^^
#
@@ -198,7 +232,7 @@
#
# set(CPACK_PACKAGE_NAME "MyPackage")
# set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MyPackage Installation Example")
-# set(CPACK_PACKAGE_VERSION "1.0.0")
+# set(CPACK_PACKAGE_VERSION "1.0.0") # Version of installer
#
# include(CPack)
# include(CPackIFW)
@@ -207,8 +241,15 @@
# DISPLAY_NAME "MyApp"
# DESCRIPTION "My Application")
# cpack_ifw_configure_component(myapp
-# VERSION "1.2.3"
+# VERSION "1.2.3" # Version of component
# SCRIPT "operations.qs")
+# cpack_add_component(mybigplugin
+# DISPLAY_NAME "MyBigPlugin"
+# DESCRIPTION "My Big Downloadable Plugin"
+# DOWNLOADED)
+# cpack_ifw_add_repository(myrepo
+# URL "http://example.com/ifw/repo/myapp"
+# DISPLAY_NAME "My Application Repository")
#
#
# Online installer
@@ -223,8 +264,11 @@
# Then you would use the command :command:`cpack_configure_downloads`.
# If you set ``ALL`` option all components will be downloaded.
#
+# You also can use command :command:`cpack_ifw_add_repository` and
+# variable :variable:`CPACK_IFW_DOWNLOAD_ALL` for more specific configuration.
+#
# CPack IFW generator create "repository" dir in current binary dir. You
-# would copy content of this dir to specified ``site``.
+# would copy content of this dir to specified ``site`` (``url``).
#
# See Also
# ^^^^^^^^
@@ -264,48 +308,41 @@
# Default path
+set(_CPACK_IFW_PATHS
+ "${QTIFWDIR}"
+ "$ENV{QTIFWDIR}"
+ "${QTDIR}"
+ "$ENV{QTIFWDIR}")
if(WIN32)
- set(_CPACK_IFW_PATHS
- "$ENV{HOMEDRIVE}/Qt"
- "C:/Qt"
- )
+ list(APPEND _CPACK_IFW_PATHS
+ "$ENV{HOMEDRIVE}/Qt"
+ "C:/Qt")
else()
- set(_CPACK_IFW_PATHS
- "$ENV{HOME}/Qt"
- "/opt/Qt"
- )
+ list(APPEND _CPACK_IFW_PATHS
+ "$ENV{HOME}/Qt"
+ "/opt/Qt")
endif()
set(_CPACK_IFW_SUFFIXES
- "QtIFW-1.7.0/bin"
- "QtIFW-1.6.0/bin"
- "QtIFW-1.5.0/bin"
- "QtIFW-1.4.0/bin"
- "QtIFW-1.3.0/bin"
-)
+ "bin"
+ "QtIFW-1.7.0/bin"
+ "QtIFW-1.6.0/bin"
+ "QtIFW-1.5.0/bin"
+ "QtIFW-1.4.0/bin"
+ "QtIFW-1.3.0/bin")
# Look for 'binarycreator'
-if(NOT CPACK_IFW_BINARYCREATOR_EXECUTABLE_FOUND)
-
find_program(CPACK_IFW_BINARYCREATOR_EXECUTABLE
NAMES binarycreator
PATHS ${_CPACK_IFW_PATHS}
PATH_SUFFIXES ${_CPACK_IFW_SUFFIXES}
- DOC "QtIFW binarycreator command line client"
- )
-mark_as_advanced(CPACK_IFW_BINARYCREATOR_EXECUTABLE)
-
-if(EXISTS ${CPACK_IFW_BINARYCREATOR_EXECUTABLE})
- set(CPACK_IFW_BINARYCREATOR_EXECUTABLE_FOUND 1)
-endif()
+ DOC "QtIFW binarycreator command line client")
-endif() # NOT CPACK_IFW_BINARYCREATOR_EXECUTABLE_FOUND
+mark_as_advanced(CPACK_IFW_BINARYCREATOR_EXECUTABLE)
# Look for 'repogen'
-if(NOT CPACK_IFW_REPOGEN_EXECUTABLE_FOUND)
-
find_program(CPACK_IFW_REPOGEN_EXECUTABLE
NAMES repogen
PATHS ${_CPACK_IFW_PATHS}
@@ -314,12 +351,6 @@ find_program(CPACK_IFW_REPOGEN_EXECUTABLE
)
mark_as_advanced(CPACK_IFW_REPOGEN_EXECUTABLE)
-if(EXISTS ${CPACK_IFW_REPOGEN_EXECUTABLE})
- set(CPACK_IFW_REPOGEN_EXECUTABLE_FOUND 1)
-endif()
-
-endif() # NOT CPACK_IFW_REPOGEN_EXECUTABLE_FOUND
-
#
## Next code is included only once
#
@@ -444,4 +475,43 @@ macro(cpack_ifw_configure_component_group grpname)
endif()
endmacro()
+# Macro for adding repository
+macro(cpack_ifw_add_repository reponame)
+
+ string(TOUPPER ${reponame} _CPACK_IFWREPO_UNAME)
+
+ set(_IFW_OPT DISABLED)
+ set(_IFW_ARGS URL USERNAME PASSWORD DISPLAY_NAME)
+ set(_IFW_MULTI_ARGS)
+ cmake_parse_arguments(CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN})
+
+ set(_CPACK_IFWREPO_STR "\n# Configuration for IFW repository \"${reponame}\"\n")
+
+ foreach(_IFW_ARG_NAME ${_IFW_OPT})
+ cpack_append_option_set_command(
+ CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_${_IFW_ARG_NAME}
+ _CPACK_IFWREPO_STR)
+ endforeach()
+
+ foreach(_IFW_ARG_NAME ${_IFW_ARGS})
+ cpack_append_string_variable_set_command(
+ CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_${_IFW_ARG_NAME}
+ _CPACK_IFWREPO_STR)
+ endforeach()
+
+ foreach(_IFW_ARG_NAME ${_IFW_MULTI_ARGS})
+ cpack_append_variable_set_command(
+ CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_${_IFW_ARG_NAME}
+ _CPACK_IFWREPO_STR)
+ endforeach()
+
+ list(APPEND CPACK_IFW_REPOSITORIES_ALL ${reponame})
+ set(_CPACK_IFWREPO_STR "${_CPACK_IFWREPO_STR}list(APPEND CPACK_IFW_REPOSITORIES_ALL ${reponame})\n")
+
+ if(CPack_CMake_INCLUDED)
+ file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${_CPACK_IFWREPO_STR}")
+ endif()
+
+endmacro()
+
endif() # NOT CPackIFW_CMake_INCLUDED
diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in
index 86049d0..37a0a40 100644
--- a/Modules/DartConfiguration.tcl.in
+++ b/Modules/DartConfiguration.tcl.in
@@ -75,6 +75,7 @@ PurifyCommand: @PURIFYCOMMAND@
ValgrindCommand: @VALGRIND_COMMAND@
ValgrindCommandOptions: @VALGRIND_COMMAND_OPTIONS@
MemoryCheckType: @MEMORYCHECK_TYPE@
+MemoryCheckSanitizerOptions: @MEMORYCHECK_SANITIZER_OPTIONS@
MemoryCheckCommand: @MEMORYCHECK_COMMAND@
MemoryCheckCommandOptions: @MEMORYCHECK_COMMAND_OPTIONS@
MemoryCheckSuppressionFile: @MEMORYCHECK_SUPPRESSIONS_FILE@
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 0eec4ad..3642b3e 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -375,9 +375,9 @@ endfunction()
# Guesses Boost's compiler prefix used in built library names
# Returns the guess by setting the variable pointed to by _ret
function(_Boost_GUESS_COMPILER_PREFIX _ret)
- if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"
- OR "${CMAKE_CXX_COMPILER}" MATCHES "icl"
- OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc")
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel"
+ OR CMAKE_CXX_COMPILER MATCHES "icl"
+ OR CMAKE_CXX_COMPILER MATCHES "icpc")
if(WIN32)
set (_boost_COMPILER "-iw")
else()
@@ -403,7 +403,7 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
set(_boost_COMPILER "-vc6") # yes, this is correct
elseif (BORLAND)
set(_boost_COMPILER "-bcb")
- elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "SunPro")
+ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
set(_boost_COMPILER "-sw")
elseif (MINGW)
if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34)
diff --git a/Modules/FindLATEX.cmake b/Modules/FindLATEX.cmake
index 62eedd6..e353d38 100644
--- a/Modules/FindLATEX.cmake
+++ b/Modules/FindLATEX.cmake
@@ -104,7 +104,7 @@ find_program(DVIPDF_CONVERTER
if (WIN32)
find_program(PS2PDF_CONVERTER
- NAMES ps2pdf14.bat ps2pdf
+ NAMES ps2pdf14.bat ps2pdf14 ps2pdf
PATHS ${GHOSTSCRIPT_LIBRARY_PATH}
${MIKTEX_BINARY_PATH}
)
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index e8d1dfb..23f3f05 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -284,18 +284,47 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
# version handling:
set(VERSION_MSG "")
set(VERSION_OK TRUE)
- set(VERSION ${${FPHSA_VERSION_VAR}} )
- if (${_NAME}_FIND_VERSION)
+ set(VERSION ${${FPHSA_VERSION_VAR}})
- if(VERSION)
+ # check with DEFINED here as the requested or found version may be "0"
+ if (DEFINED ${_NAME}_FIND_VERSION)
+ if(DEFINED ${FPHSA_VERSION_VAR})
if(${_NAME}_FIND_VERSION_EXACT) # exact version required
- if (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
- set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
- set(VERSION_OK FALSE)
+ # count the dots in the version string
+ string(REGEX REPLACE "[^.]" "" _VERSION_DOTS "${VERSION}")
+ # add one dot because there is one dot more than there are components
+ string(LENGTH "${_VERSION_DOTS}." _VERSION_DOTS)
+ if (_VERSION_DOTS GREATER ${_NAME}_FIND_VERSION_COUNT)
+ # Because of the C++ implementation of find_package() ${_NAME}_FIND_VERSION_COUNT
+ # is at most 4 here. Therefore a simple lookup table is used.
+ if (${_NAME}_FIND_VERSION_COUNT EQUAL 1)
+ set(_VERSION_REGEX "[^.]*")
+ elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 2)
+ set(_VERSION_REGEX "[^.]*\\.[^.]*")
+ elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 3)
+ set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*")
+ else ()
+ set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*\\.[^.]*")
+ endif ()
+ string(REGEX REPLACE "^(${_VERSION_REGEX})\\..*" "\\1" _VERSION_HEAD "${VERSION}")
+ unset(_VERSION_REGEX)
+ if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL _VERSION_HEAD)
+ set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
+ set(VERSION_OK FALSE)
+ else ()
+ set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
+ endif ()
+ unset(_VERSION_HEAD)
else ()
- set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
+ if (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+ set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
+ set(VERSION_OK FALSE)
+ else ()
+ set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
+ endif ()
endif ()
+ unset(_VERSION_DOTS)
else() # minimum version specified:
if ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 253beba..84769c5 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 0)
-set(CMake_VERSION_PATCH 20141006)
+set(CMake_VERSION_PATCH 20141009)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
index 732938b..7f06e2d 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
@@ -56,7 +56,7 @@ int cmCPackIFWGenerator::PackageFiles()
ifwTmpFile += "/IFWOutput.log";
// Run repogen
- if (!DownloadSite.empty())
+ if (!Installer.Repositories.empty())
{
std::string ifwCmd = RepoGen;
ifwCmd += " -c " + this->toplevel + "/config/config.xml";
@@ -128,7 +128,7 @@ int cmCPackIFWGenerator::PackageFiles()
{
ifwCmd += " --online-only";
}
- else if (!DownloadedPackages.empty() && !DownloadSite.empty())
+ else if (!DownloadedPackages.empty() && !Installer.Repositories.empty())
{
ifwCmd += " -e ";
std::set<cmCPackIFWPackage*>::iterator it
@@ -223,23 +223,25 @@ int cmCPackIFWGenerator::InitializeInternal()
{
// Search Qt Installer Framework tools
- if(!this->IsOn("CPACK_IFW_BINARYCREATOR_EXECUTABLE_FOUND") ||
- !this->IsOn("CPACK_IFW_REPOGEN_EXECUTABLE_FOUND"))
+ const std::string BinCreatorOpt = "CPACK_IFW_BINARYCREATOR_EXECUTABLE";
+ const std::string RepoGenOpt = "CPACK_IFW_REPOGEN_EXECUTABLE";
+
+ if(!this->IsSet(BinCreatorOpt) ||
+ !this->IsSet(RepoGenOpt))
{
this->ReadListFile("CPackIFW.cmake");
}
// Look 'binarycreator' executable (needs)
- if(this->IsOn("CPACK_IFW_BINARYCREATOR_EXECUTABLE_FOUND"))
+ const char *BinCreatorStr = this->GetOption(BinCreatorOpt);
+ if(!BinCreatorStr || cmSystemTools::IsNOTFOUND(BinCreatorStr))
{
- const char *ifwBinCreatorStr =
- this->GetOption("CPACK_IFW_BINARYCREATOR_EXECUTABLE");
- BinCreator = ifwBinCreatorStr ? ifwBinCreatorStr : "";
+ BinCreator = "";
}
else
{
- BinCreator = "";
+ BinCreator = BinCreatorStr;
}
if (BinCreator.empty())
@@ -253,15 +255,14 @@ int cmCPackIFWGenerator::InitializeInternal()
// Look 'repogen' executable (optional)
- if(this->IsOn("CPACK_IFW_REPOGEN_EXECUTABLE_FOUND"))
+ const char *RepoGenStr = this->GetOption(RepoGenOpt);
+ if(!RepoGenStr || cmSystemTools::IsNOTFOUND(RepoGenStr))
{
- const char *ifwRepoGenStr =
- this->GetOption("CPACK_IFW_REPOGEN_EXECUTABLE");
- RepoGen = ifwRepoGenStr ? ifwRepoGenStr : "";
+ RepoGen = "";
}
else
{
- RepoGen = "";
+ RepoGen = RepoGenStr;
}
// Variables that Change Behavior
@@ -277,16 +278,26 @@ int cmCPackIFWGenerator::InitializeInternal()
PkgsDirsVector);
}
- // Remote repository
+ // Installer
+ Installer.Generator = this;
+ Installer.ConfigureFromOptions();
- if (const char *site = this->GetOption("CPACK_DOWNLOAD_SITE"))
+ if (const char* ifwDownloadAll =
+ this->GetOption("CPACK_IFW_DOWNLOAD_ALL"))
{
- DownloadSite = site;
+ OnlineOnly = cmSystemTools::IsOn(ifwDownloadAll);
+ }
+ else if (const char* cpackDownloadAll =
+ this->GetOption("CPACK_DOWNLOAD_ALL"))
+ {
+ OnlineOnly = cmSystemTools::IsOn(cpackDownloadAll);
+ }
+ else
+ {
+ OnlineOnly = false;
}
- OnlineOnly = this->IsOn("CPACK_DOWNLOAD_ALL") ? true : false;
-
- if (!DownloadSite.empty() && RepoGen.empty()) {
+ if (!Installer.Repositories.empty() && RepoGen.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot find QtIFW repository generator \"repogen\": "
"likely it is not installed, or not in your PATH"
@@ -294,10 +305,6 @@ int cmCPackIFWGenerator::InitializeInternal()
return 0;
}
- // Installer
- Installer.Generator = this;
- Installer.ConfigureFromOptions();
-
return this->Superclass::InitializeInternal();
}
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.h b/Source/CPack/IFW/cmCPackIFWGenerator.h
index 7211e04..1d4d67b 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.h
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.h
@@ -127,8 +127,6 @@ private:
std::string RepoGen;
std::string BinCreator;
- std::string DownloadSite;
-
bool OnlineOnly;
bool ResolveDuplicateNames;
std::vector<std::string> PkgsDirsVector;
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
index fcb07e6..0644ecb 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
@@ -45,6 +45,12 @@ const char *cmCPackIFWInstaller::GetOption(const std::string &op) const
}
//----------------------------------------------------------------------------
+bool cmCPackIFWInstaller::IsOn(const std::string &op) const
+{
+ return Generator ? Generator->IsOn(op) : false;
+}
+
+//----------------------------------------------------------------------------
void cmCPackIFWInstaller::ConfigureFromOptions()
{
// Name;
@@ -167,6 +173,78 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
{
AdminTargetDir = option;
}
+
+ // Repositories
+ Repositories.clear();
+ RepositoryStruct Repo;
+ if (const char *site = this->GetOption("CPACK_DOWNLOAD_SITE"))
+ {
+ Repo.Url = site;
+ Repositories.push_back(Repo);
+ }
+ if(const char *RepoAllStr = this->GetOption("CPACK_IFW_REPOSITORIES_ALL"))
+ {
+ std::vector<std::string> RepoAllVector;
+ cmSystemTools::ExpandListArgument(RepoAllStr,
+ RepoAllVector);
+ for(std::vector<std::string>::iterator
+ rit = RepoAllVector.begin(); rit != RepoAllVector.end(); ++rit)
+ {
+ std::string prefix = "CPACK_IFW_REPOSITORY_"
+ + cmsys::SystemTools::UpperCase(*rit)
+ + "_";
+ // Url
+ if (const char* url = GetOption(prefix + "URL"))
+ {
+ Repo.Url = url;
+ }
+ else
+ {
+ Repo.Url = "";
+ }
+ // Enabled
+ if (IsOn(prefix + "DISABLED"))
+ {
+ Repo.Enabled = "0";
+ }
+ else
+ {
+ Repo.Enabled = "";
+ }
+ // Username
+ if (const char* username = GetOption(prefix + "USERNAME"))
+ {
+ Repo.Username = username;
+ }
+ else
+ {
+ Repo.Username = "";
+ }
+ // Password
+ if (const char* password = GetOption(prefix + "PASSWORD"))
+ {
+ Repo.Password = password;
+ }
+ else
+ {
+ Repo.Password = "";
+ }
+ // DisplayName
+ if (const char* displayName = GetOption(prefix + "DISPLAY_NAME"))
+ {
+ Repo.DisplayName = displayName;
+ }
+ else
+ {
+ Repo.DisplayName = "";
+ }
+
+ if(!Repo.Url.empty())
+ {
+ Repositories.push_back(Repo);
+ }
+ }
+ }
}
//----------------------------------------------------------------------------
@@ -246,19 +324,43 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
<< "</AdminTargetDir>" << std::endl;
}
- // Site
- if (!Generator->DownloadSite.empty())
+ // Remote repositories
+ if (!Repositories.empty())
{
xout << " <RemoteRepositories>" << std::endl;
- xout << " <Repository>" << std::endl;
- xout << " <Url>" << Generator->DownloadSite
- << "</Url>" << std::endl;
- // These properties can not be set from "cpack_configure_downloads"
- // <Enabled>1</Enabled>
- // <Username>user</Username>
- // <Password>password</Password>
- // <DisplayName>Example repository</DisplayName>
- xout << " </Repository>" << std::endl;
+ for(std::vector<RepositoryStruct>::iterator
+ rit = Repositories.begin(); rit != Repositories.end(); ++rit)
+ {
+ xout << " <Repository>" << std::endl;
+ // Url
+ xout << " <Url>" << rit->Url
+ << "</Url>" << std::endl;
+ // Enabled
+ if(!rit->Enabled.empty())
+ {
+ xout << " <Enabled>" << rit->Enabled
+ << "</Enabled>" << std::endl;
+ }
+ // Username
+ if(!rit->Username.empty())
+ {
+ xout << " <Username>" << rit->Username
+ << "</Username>" << std::endl;
+ }
+ // Password
+ if(!rit->Password.empty())
+ {
+ xout << " <Password>" << rit->Password
+ << "</Password>" << std::endl;
+ }
+ // DisplayName
+ if(!rit->DisplayName.empty())
+ {
+ xout << " <DisplayName>" << rit->DisplayName
+ << "</DisplayName>" << std::endl;
+ }
+ xout << " </Repository>" << std::endl;
+ }
xout << " </RemoteRepositories>" << std::endl;
}
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.h b/Source/CPack/IFW/cmCPackIFWInstaller.h
index 1630a94..5824d33 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.h
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.h
@@ -27,6 +27,15 @@ public: // Types
typedef std::map<std::string, cmCPackIFWPackage*> PackagesMap;
+ struct RepositoryStruct
+ {
+ std::string Url;
+ std::string Enabled;
+ std::string Username;
+ std::string Password;
+ std::string DisplayName;
+ };
+
public: // Constructor
/**
@@ -69,6 +78,7 @@ public: // Configuration
public: // Internal implementation
const char* GetOption(const std::string& op) const;
+ bool IsOn(const std::string& op) const;
void ConfigureFromOptions();
@@ -78,6 +88,7 @@ public: // Internal implementation
cmCPackIFWGenerator* Generator;
PackagesMap Packages;
+ std::vector<RepositoryStruct> Repositories;
std::string Directory;
};
diff --git a/Source/CTest/cmCTestBatchTestHandler.cxx b/Source/CTest/cmCTestBatchTestHandler.cxx
index 934481b..7f966aa 100644
--- a/Source/CTest/cmCTestBatchTestHandler.cxx
+++ b/Source/CTest/cmCTestBatchTestHandler.cxx
@@ -33,8 +33,8 @@ void cmCTestBatchTestHandler::WriteBatchScript()
{
this->Script = this->CTest->GetBinaryDir()
+ "/Testing/CTestBatch.txt";
- std::fstream fout;
- fout.open(this->Script.c_str(), std::ios::out);
+ cmsys::ofstream fout;
+ fout.open(this->Script.c_str());
fout << "#!/bin/sh\n";
for(TestMap::iterator i = this->Tests.begin(); i != this->Tests.end(); ++i)
@@ -48,7 +48,7 @@ void cmCTestBatchTestHandler::WriteBatchScript()
}
//---------------------------------------------------------
-void cmCTestBatchTestHandler::WriteSrunArgs(int test, std::fstream& fout)
+void cmCTestBatchTestHandler::WriteSrunArgs(int test, cmsys::ofstream& fout)
{
cmCTestTestHandler::cmCTestTestProperties* properties =
this->Properties[test];
@@ -79,7 +79,7 @@ void cmCTestBatchTestHandler::WriteSrunArgs(int test, std::fstream& fout)
}
//---------------------------------------------------------
-void cmCTestBatchTestHandler::WriteTestCommand(int test, std::fstream& fout)
+void cmCTestBatchTestHandler::WriteTestCommand(int test, cmsys::ofstream& fout)
{
std::vector<std::string> args = this->Properties[test]->Args;
std::vector<std::string> processArgs;
diff --git a/Source/CTest/cmCTestBatchTestHandler.h b/Source/CTest/cmCTestBatchTestHandler.h
index ab0d081..e0c6e48 100644
--- a/Source/CTest/cmCTestBatchTestHandler.h
+++ b/Source/CTest/cmCTestBatchTestHandler.h
@@ -17,6 +17,7 @@
#include <cmCTestTestHandler.h>
#include <cmCTestMultiProcessHandler.h>
#include <cmCTestRunTest.h>
+#include <cmsys/FStream.hxx>
/** \class cmCTestBatchTestHandler
* \brief run parallel ctest
@@ -30,8 +31,8 @@ public:
virtual void RunTests();
protected:
void WriteBatchScript();
- void WriteSrunArgs(int test, std::fstream& fout);
- void WriteTestCommand(int test, std::fstream& fout);
+ void WriteSrunArgs(int test, cmsys::ofstream& fout);
+ void WriteTestCommand(int test, cmsys::ofstream& fout);
void SubmitBatchScript();
diff --git a/Source/CTest/cmCTestMemCheckCommand.cxx b/Source/CTest/cmCTestMemCheckCommand.cxx
index 939b4dc..f144066 100644
--- a/Source/CTest/cmCTestMemCheckCommand.cxx
+++ b/Source/CTest/cmCTestMemCheckCommand.cxx
@@ -23,6 +23,8 @@ cmCTestGenericHandler* cmCTestMemCheckCommand::InitializeActualHandler()
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"MemoryCheckType", "CTEST_MEMORYCHECK_TYPE");
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
+ "MemoryCheckSanitizerOptions", "CTEST_MEMORYCHECK_SANITIZER_OPTIONS");
+ this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"MemoryCheckCommand", "CTEST_MEMORYCHECK_COMMAND");
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"MemoryCheckCommandOptions", "CTEST_MEMORYCHECK_COMMAND_OPTIONS");
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index a7ab077..4835010 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -370,11 +370,17 @@ void cmCTestMemCheckHandler::GenerateDartOutput(std::ostream& os)
case cmCTestMemCheckHandler::BOUNDS_CHECKER:
os << "BoundsChecker";
break;
+ case cmCTestMemCheckHandler::ADDRESS_SANITIZER:
+ os << "AddressSanitizer";
+ break;
case cmCTestMemCheckHandler::THREAD_SANITIZER:
os << "ThreadSanitizer";
break;
- case cmCTestMemCheckHandler::ADDRESS_SANITIZER:
- os << "AddressSanitizer";
+ case cmCTestMemCheckHandler::MEMORY_SANITIZER:
+ os << "MemorySanitizer";
+ break;
+ case cmCTestMemCheckHandler::UB_SANITIZER:
+ os << "UndefinedBehaviorSanitizer";
break;
default:
os << "Unknown";
@@ -537,6 +543,14 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
}
if ( this->CTest->GetCTestConfiguration("MemoryCheckType")
+ == "AddressSanitizer")
+ {
+ this->MemoryTester
+ = this->CTest->GetCTestConfiguration("CMakeCommand").c_str();
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::ADDRESS_SANITIZER;
+ this->LogWithPID = true; // even if we give the log file the pid is added
+ }
+ if ( this->CTest->GetCTestConfiguration("MemoryCheckType")
== "ThreadSanitizer")
{
this->MemoryTester
@@ -545,11 +559,19 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
this->LogWithPID = true; // even if we give the log file the pid is added
}
if ( this->CTest->GetCTestConfiguration("MemoryCheckType")
- == "AddressSanitizer")
+ == "MemorySanitizer")
{
this->MemoryTester
= this->CTest->GetCTestConfiguration("CMakeCommand").c_str();
- this->MemoryTesterStyle = cmCTestMemCheckHandler::ADDRESS_SANITIZER;
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::MEMORY_SANITIZER;
+ this->LogWithPID = true; // even if we give the log file the pid is added
+ }
+ if ( this->CTest->GetCTestConfiguration("MemoryCheckType")
+ == "UndefinedBehaviorSanitizer")
+ {
+ this->MemoryTester
+ = this->CTest->GetCTestConfiguration("CMakeCommand").c_str();
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::UB_SANITIZER;
this->LogWithPID = true; // even if we give the log file the pid is added
}
// Check the MemoryCheckType
@@ -674,10 +696,11 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
this->MemoryTesterOptions.push_back("/M");
break;
}
- // these two are almost the same but the env var used
- // is different
+ // these are almost the same but the env var used is different
case cmCTestMemCheckHandler::ADDRESS_SANITIZER:
case cmCTestMemCheckHandler::THREAD_SANITIZER:
+ case cmCTestMemCheckHandler::MEMORY_SANITIZER:
+ case cmCTestMemCheckHandler::UB_SANITIZER:
{
// To pass arguments to ThreadSanitizer the environment variable
// TSAN_OPTIONS is used. This is done with the cmake -E env command.
@@ -686,15 +709,30 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
// TSAN_OPTIONS string with the log_path in it.
this->MemoryTesterDynamicOptions.push_back("-E");
this->MemoryTesterDynamicOptions.push_back("env");
- std::string envVar = "TSAN_OPTIONS";
- std::string extraOptions;
+ std::string envVar;
+ std::string extraOptions =
+ this->CTest->GetCTestConfiguration("MemoryCheckSanitizerOptions");
if(this->MemoryTesterStyle == cmCTestMemCheckHandler::ADDRESS_SANITIZER)
{
envVar = "ASAN_OPTIONS";
- extraOptions = " detect_leaks=1";
+ extraOptions += " detect_leaks=1";
+ }
+ else if(this->MemoryTesterStyle ==
+ cmCTestMemCheckHandler::THREAD_SANITIZER)
+ {
+ envVar = "TSAN_OPTIONS";
+ }
+ else if(this->MemoryTesterStyle ==
+ cmCTestMemCheckHandler::MEMORY_SANITIZER)
+ {
+ envVar = "MSAN_OPTIONS";
+ }
+ else if(this->MemoryTesterStyle == cmCTestMemCheckHandler::UB_SANITIZER)
+ {
+ envVar = "UBSAN_OPTIONS";
}
std::string outputFile = envVar + "=log_path=\""
- + this->MemoryTesterOutputFile + "\"";
+ + this->MemoryTesterOutputFile + "\" ";
this->MemoryTesterEnvironmentVariable = outputFile + extraOptions;
break;
}
@@ -728,9 +766,13 @@ ProcessMemCheckOutput(const std::string& str,
return this->ProcessMemCheckPurifyOutput(str, log, results);
}
else if ( this->MemoryTesterStyle ==
+ cmCTestMemCheckHandler::ADDRESS_SANITIZER ||
+ this->MemoryTesterStyle ==
cmCTestMemCheckHandler::THREAD_SANITIZER ||
this->MemoryTesterStyle ==
- cmCTestMemCheckHandler::ADDRESS_SANITIZER)
+ cmCTestMemCheckHandler::MEMORY_SANITIZER ||
+ this->MemoryTesterStyle ==
+ cmCTestMemCheckHandler::UB_SANITIZER)
{
return this->ProcessMemCheckSanitizerOutput(str, log, results);
}
@@ -770,13 +812,22 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput(
std::vector<int>& result)
{
std::string regex;
- if(this->MemoryTesterStyle == cmCTestMemCheckHandler::THREAD_SANITIZER)
- {
- regex = "WARNING: ThreadSanitizer: (.*) \\(pid=.*\\)";
- }
- else
+ switch ( this->MemoryTesterStyle )
{
- regex = "ERROR: AddressSanitizer: (.*) on.*";
+ case cmCTestMemCheckHandler::ADDRESS_SANITIZER:
+ regex = "ERROR: AddressSanitizer: (.*) on.*";
+ break;
+ case cmCTestMemCheckHandler::THREAD_SANITIZER:
+ regex = "WARNING: ThreadSanitizer: (.*) \\(pid=.*\\)";
+ break;
+ case cmCTestMemCheckHandler::MEMORY_SANITIZER:
+ regex = "WARNING: MemorySanitizer: (.*)";
+ break;
+ case cmCTestMemCheckHandler::UB_SANITIZER:
+ regex = "runtime error: (.*)";
+ break;
+ default:
+ break;
}
cmsys::RegularExpression sanitizerWarning(regex);
cmsys::RegularExpression leakWarning("(Direct|Indirect) leak of .*");
diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h
index 2195dab..69fdd9f 100644
--- a/Source/CTest/cmCTestMemCheckHandler.h
+++ b/Source/CTest/cmCTestMemCheckHandler.h
@@ -49,9 +49,11 @@ private:
VALGRIND,
PURIFY,
BOUNDS_CHECKER,
- // checkers after hear do not use the standard error list
+ // checkers after here do not use the standard error list
+ ADDRESS_SANITIZER,
THREAD_SANITIZER,
- ADDRESS_SANITIZER
+ MEMORY_SANITIZER,
+ UB_SANITIZER
};
public:
enum { // Memory faults
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index b9e6721..7ba434c 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -319,8 +319,8 @@ void cmCTestMultiProcessHandler::UpdateCostData()
{
std::string fname = this->CTest->GetCostDataFile();
std::string tmpout = fname + ".tmp";
- std::fstream fout;
- fout.open(tmpout.c_str(), std::ios::out);
+ cmsys::ofstream fout;
+ fout.open(tmpout.c_str());
PropertiesMap temp = this->Properties;
@@ -610,8 +610,8 @@ void cmCTestMultiProcessHandler::WriteCheckpoint(int index)
{
std::string fname = this->CTest->GetBinaryDir()
+ "/Testing/Temporary/CTestCheckpoint.txt";
- std::fstream fout;
- fout.open(fname.c_str(), std::ios::app | std::ios::out);
+ cmsys::ofstream fout;
+ fout.open(fname.c_str(), std::ios::app);
fout << index << "\n";
fout.close();
}
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 543ecdb..6e7b06b 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -205,7 +205,7 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
&& args.size() + buildstr.size() + assignments.size()
> (size_t) cmdLineLimit) {
buildstr += "_RSP_FILE";
- variable_assignments.clear();
+ variable_assignments.str(std::string());
cmGlobalNinjaGenerator::WriteVariable(variable_assignments,
"RSP_FILE", rspfile, "", 1);
assignments += variable_assignments.str();
@@ -1042,17 +1042,27 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
std::back_inserter(unkownExplicitDepends));
+ std::string const rootBuildDirectory =
+ this->GetCMakeInstance()->GetHomeOutputDirectory();
for (std::vector<std::string>::const_iterator
i = unkownExplicitDepends.begin();
i != unkownExplicitDepends.end();
++i)
{
- cmNinjaDeps deps(1,*i);
- this->WritePhonyBuild(os,
- "",
- deps,
- deps);
- }
+ //verify the file is in the build directory
+ std::string const absDepPath = cmSystemTools::CollapseFullPath(
+ i->c_str(), rootBuildDirectory.c_str());
+ bool const inBuildDir = cmSystemTools::IsSubDirectory(absDepPath.c_str(),
+ rootBuildDirectory.c_str());
+ if(inBuildDir)
+ {
+ cmNinjaDeps deps(1,*i);
+ this->WritePhonyBuild(os,
+ "",
+ deps,
+ deps);
+ }
+ }
}
void cmGlobalNinjaGenerator::WriteBuiltinTargets(std::ostream& os)
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index cb070cc..93ebde6 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1180,9 +1180,9 @@ cmQtAutoGenerators::WriteOldMocDefinitionsFile(
cmSystemTools::ConvertToUnixSlashes(filename);
filename += "/AutomocOldMocDefinitions.cmake";
- std::fstream outfile;
+ cmsys::ofstream outfile;
outfile.open(filename.c_str(),
- std::ios::out | std::ios::trunc);
+ std::ios::trunc);
outfile << "set(AM_OLD_COMPILE_SETTINGS "
<< cmLocalGenerator::EscapeForCMake(
this->CurrentCompileSettingsStr) << ")\n";
@@ -1451,9 +1451,9 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
}
// source file that includes all remaining moc files (_automoc.cpp file)
- std::fstream outfile;
+ cmsys::ofstream outfile;
outfile.open(this->OutMocCppFilename.c_str(),
- std::ios::out | std::ios::trunc);
+ std::ios::trunc);
outfile << automocSource;
outfile.close();
diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt
index 3ad0b26..2023e74 100644
--- a/Tests/CTestTestMemcheck/CMakeLists.txt
+++ b/Tests/CTestTestMemcheck/CMakeLists.txt
@@ -103,11 +103,11 @@ unset(CTEST_EXTRA_CONFIG)
unset(CTEST_EXTRA_CODE)
unset(CMAKELISTS_EXTRA_CODE)
+#-----------------------------------------------------------------------------
# add ThreadSanitizer test
set(CTEST_EXTRA_CODE
"set(CTEST_MEMORYCHECK_COMMAND_OPTIONS \"report_bugs=1 history_size=5 exitcode=55\")
")
-
set(CMAKELISTS_EXTRA_CODE
"add_test(NAME TestSan COMMAND \"${CMAKE_COMMAND}\"
-P \"${CMAKE_CURRENT_SOURCE_DIR}/testThreadSanitizer.cmake\")
@@ -119,11 +119,11 @@ set_tests_properties(CTestTestMemcheckDummyThreadSanitizer PROPERTIES
set(CMAKELISTS_EXTRA_CODE )
set(CTEST_EXTRA_CODE)
+#-----------------------------------------------------------------------------
# add LeakSanitizer test
set(CTEST_EXTRA_CODE
-"set(CTEST_MEMORYCHECK_COMMAND_OPTIONS \"simulate_sanitizer=1 report_bugs=1 history_size=5 exitcode=55\")
+"set(CTEST_MEMORYCHECK_SANITIZER_OPTIONS \"simulate_sanitizer=1 report_bugs=1 history_size=5 exitcode=55\")
")
-
set(CMAKELISTS_EXTRA_CODE
"add_test(NAME TestSan COMMAND \"${CMAKE_COMMAND}\"
-P \"${CMAKE_CURRENT_SOURCE_DIR}/testLeakSanitizer.cmake\")
@@ -134,11 +134,12 @@ set(CTEST_EXTRA_CODE)
set_tests_properties(CTestTestMemcheckDummyLeakSanitizer PROPERTIES
PASS_REGULAR_EXPRESSION
".*Memory checking results:.*Direct leak - 2.*Indirect leak - 1.*")
+
+#-----------------------------------------------------------------------------
# add AddressSanitizer test
set(CTEST_EXTRA_CODE
-"set(CTEST_MEMORYCHECK_COMMAND_OPTIONS \"simulate_sanitizer=1 report_bugs=1 history_size=5 exitcode=55\")
+"set(CTEST_MEMORYCHECK_SANITIZER_OPTIONS \"simulate_sanitizer=1 report_bugs=1 history_size=5 exitcode=55\")
")
-
set(CMAKELISTS_EXTRA_CODE
"add_test(NAME TestSan COMMAND \"${CMAKE_COMMAND}\"
-P \"${CMAKE_CURRENT_SOURCE_DIR}/testAddressSanitizer.cmake\")
@@ -150,6 +151,41 @@ set_tests_properties(CTestTestMemcheckDummyAddressSanitizer PROPERTIES
PASS_REGULAR_EXPRESSION
".*Memory checking results:.*heap-buffer-overflow - 1.*")
+#-----------------------------------------------------------------------------
+# add MemorySanitizer test
+set(CTEST_EXTRA_CODE
+"set(CTEST_MEMORYCHECK_COMMAND_OPTIONS \"simulate_sanitizer=1 report_bugs=1 history_size=5 exitcode=55\")
+")
+
+set(CMAKELISTS_EXTRA_CODE
+"add_test(NAME TestSan COMMAND \"${CMAKE_COMMAND}\"
+-P \"${CMAKE_CURRENT_SOURCE_DIR}/testMemorySanitizer.cmake\")
+")
+gen_mc_test_internal(DummyMemorySanitizer "" -DMEMCHECK_TYPE=MemorySanitizer)
+set(CMAKELISTS_EXTRA_CODE )
+set(CTEST_EXTRA_CODE)
+set_tests_properties(CTestTestMemcheckDummyMemorySanitizer PROPERTIES
+ PASS_REGULAR_EXPRESSION
+ ".*Memory checking results:.*use-of-uninitialized-value - 1.*")
+
+#-----------------------------------------------------------------------------
+# add UndefinedBehaviorSanitizer test
+set(CTEST_EXTRA_CODE
+"set(CTEST_MEMORYCHECK_SANITIZER_OPTIONS \"simulate_sanitizer=1\")
+")
+
+set(CMAKELISTS_EXTRA_CODE
+"add_test(NAME TestSan COMMAND \"${CMAKE_COMMAND}\"
+-P \"${CMAKE_CURRENT_SOURCE_DIR}/testUndefinedBehaviorSanitizer.cmake\")
+")
+gen_mc_test_internal(DummyUndefinedBehaviorSanitizer "" -DMEMCHECK_TYPE=UndefinedBehaviorSanitizer)
+set(CMAKELISTS_EXTRA_CODE )
+set(CTEST_EXTRA_CODE)
+set_tests_properties(CTestTestMemcheckDummyUndefinedBehaviorSanitizer PROPERTIES
+ PASS_REGULAR_EXPRESSION
+ ".*Memory checking results:.*left shift of negative value -256 - 1.*")
+
+#-----------------------------------------------------------------------------
gen_mc_test(DummyPurify "\${PSEUDO_PURIFY}")
gen_mc_test(DummyValgrind "\${PSEUDO_VALGRIND}")
diff --git a/Tests/CTestTestMemcheck/testAddressSanitizer.cmake b/Tests/CTestTestMemcheck/testAddressSanitizer.cmake
index a073151..3082e4b 100644
--- a/Tests/CTestTestMemcheck/testAddressSanitizer.cmake
+++ b/Tests/CTestTestMemcheck/testAddressSanitizer.cmake
@@ -1,4 +1,4 @@
-# this file simulates a program that has been built with thread sanitizer
+# this file simulates a program that has been built with address sanitizer
# options
message("ASAN_OPTIONS = [$ENV{ASAN_OPTIONS}]")
@@ -12,8 +12,7 @@ endif()
# clear the log file
file(REMOVE "${LOG_FILE}.2343")
-# create an error of each type of thread santizer
-# these names come from tsan_report.cc in llvm
+# create an example error from address santizer
file(APPEND "${LOG_FILE}.2343"
"=================================================================
diff --git a/Tests/CTestTestMemcheck/testMemorySanitizer.cmake b/Tests/CTestTestMemcheck/testMemorySanitizer.cmake
new file mode 100644
index 0000000..c87af9a
--- /dev/null
+++ b/Tests/CTestTestMemcheck/testMemorySanitizer.cmake
@@ -0,0 +1,27 @@
+# this file simulates a program that has been built with thread sanitizer
+# options
+
+message("MSAN_OPTIONS = [$ENV{MSAN_OPTIONS}]")
+string(REGEX REPLACE ".*log_path=\"([^\"]*)\".*" "\\1" LOG_FILE "$ENV{MSAN_OPTIONS}")
+message("LOG_FILE=[${LOG_FILE}]")
+
+# if we are not asked to simulate address sanitizer don't do it
+if(NOT "$ENV{MSAN_OPTIONS}]" MATCHES "simulate_sanitizer.1")
+ return()
+endif()
+# clear the log file
+file(REMOVE "${LOG_FILE}.2343")
+
+# create an error of each type of thread santizer
+# these names come from tsan_report.cc in llvm
+
+file(APPEND "${LOG_FILE}.2343"
+"=================================================================
+==28423== WARNING: MemorySanitizer: use-of-uninitialized-value
+ #0 0x7f4364210dd9 in main (/home/kitware/msan/msan-bin/umr+0x7bdd9)
+ #1 0x7f4362d9376c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226
+ #2 0x7f4364210b0c in _start (/home/kitware/msan/msan-bin/umr+0x7bb0c)
+
+SUMMARY: MemorySanitizer: use-of-uninitialized-value ??:0 main
+Exiting
+")
diff --git a/Tests/CTestTestMemcheck/testUndefinedBehaviorSanitizer.cmake b/Tests/CTestTestMemcheck/testUndefinedBehaviorSanitizer.cmake
new file mode 100644
index 0000000..8ef3c0a
--- /dev/null
+++ b/Tests/CTestTestMemcheck/testUndefinedBehaviorSanitizer.cmake
@@ -0,0 +1,21 @@
+# this file simulates a program that has been built with undefined behavior
+# sanitizer options
+
+message("UBSAN_OPTIONS = [$ENV{UBSAN_OPTIONS}]")
+string(REGEX REPLACE ".*log_path=\"([^\"]*)\".*" "\\1" LOG_FILE "$ENV{UBSAN_OPTIONS}")
+message("LOG_FILE=[${LOG_FILE}]")
+
+# if we are not asked to simulate address sanitizer don't do it
+if(NOT "$ENV{UBSAN_OPTIONS}]" MATCHES "simulate_sanitizer.1")
+ return()
+endif()
+# clear the log file
+file(REMOVE "${LOG_FILE}.2343")
+
+# create an error like undefined behavior santizer creates;
+# these names come from ubsan_diag.cc and ubsan_handlers.cc
+# in llvm
+
+file(APPEND "${LOG_FILE}.2343"
+"<unknown>: runtime error: left shift of negative value -256
+")
diff --git a/Tests/RunCMake/FPHSA/FindPseudo.cmake b/Tests/RunCMake/FPHSA/FindPseudo.cmake
new file mode 100644
index 0000000..dc3558b
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/FindPseudo.cmake
@@ -0,0 +1,6 @@
+# pseudo find_module
+
+set(FOOBAR TRUE)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Pseudo REQUIRED_VARS FOOBAR VERSION_VAR Pseudo_VERSION)
diff --git a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
index 0d48fa9..bb7743c 100644
--- a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
@@ -1,3 +1,28 @@
include(RunCMake)
run_cmake(BadFoundVar)
+
+# The pseudo module will "find" a package with the given version. Check if the
+# version selection code in FPHSA works correctly.
+set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudo_VERSION=1.2.3.4.5")
+run_cmake(any_version)
+
+# test EXACT mode with every subcomponent
+run_cmake(exact_1)
+run_cmake(exact_1.2)
+run_cmake(exact_1.2.3)
+run_cmake(exact_1.2.3.4)
+
+# now test every component with an invalid version
+run_cmake(exact_0)
+run_cmake(exact_2)
+run_cmake(exact_1.1)
+run_cmake(exact_1.3)
+run_cmake(exact_1.2.2)
+run_cmake(exact_1.2.4)
+run_cmake(exact_1.2.3.3)
+run_cmake(exact_1.2.3.5)
+
+# check if searching for a version 0 works
+list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudo_VERSION=0")
+run_cmake(exact_0_matching)
diff --git a/Tests/RunCMake/FPHSA/any_version.cmake b/Tests/RunCMake/FPHSA/any_version.cmake
new file mode 100644
index 0000000..b34a540
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/any_version.cmake
@@ -0,0 +1 @@
+find_package(Pseudo REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/exact_0-result.txt b/Tests/RunCMake/FPHSA/exact_0-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_0-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FPHSA/exact_0.cmake b/Tests/RunCMake/FPHSA/exact_0.cmake
new file mode 100644
index 0000000..432887b
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_0.cmake
@@ -0,0 +1 @@
+find_package(Pseudo 0 EXACT REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/exact_0_matching.cmake b/Tests/RunCMake/FPHSA/exact_0_matching.cmake
new file mode 100644
index 0000000..432887b
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_0_matching.cmake
@@ -0,0 +1 @@
+find_package(Pseudo 0 EXACT REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/exact_1.1-result.txt b/Tests/RunCMake/FPHSA/exact_1.1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_1.1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FPHSA/exact_1.1.cmake b/Tests/RunCMake/FPHSA/exact_1.1.cmake
new file mode 100644
index 0000000..d967da9
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_1.1.cmake
@@ -0,0 +1 @@
+find_package(Pseudo 1.1 EXACT REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/exact_1.2.2-result.txt b/Tests/RunCMake/FPHSA/exact_1.2.2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_1.2.2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FPHSA/exact_1.2.2.cmake b/Tests/RunCMake/FPHSA/exact_1.2.2.cmake
new file mode 100644
index 0000000..e959f61
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_1.2.2.cmake
@@ -0,0 +1 @@
+find_package(Pseudo 1.2.2 EXACT REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/exact_1.2.3.3-result.txt b/Tests/RunCMake/FPHSA/exact_1.2.3.3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_1.2.3.3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FPHSA/exact_1.2.3.3.cmake b/Tests/RunCMake/FPHSA/exact_1.2.3.3.cmake
new file mode 100644
index 0000000..af53cc8
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_1.2.3.3.cmake
@@ -0,0 +1 @@
+find_package(Pseudo 1.2.3.3 EXACT REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/exact_1.2.3.4.cmake b/Tests/RunCMake/FPHSA/exact_1.2.3.4.cmake
new file mode 100644
index 0000000..1e2baa6
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_1.2.3.4.cmake
@@ -0,0 +1 @@
+find_package(Pseudo 1.2.3.4 EXACT REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/exact_1.2.3.5-result.txt b/Tests/RunCMake/FPHSA/exact_1.2.3.5-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_1.2.3.5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FPHSA/exact_1.2.3.5.cmake b/Tests/RunCMake/FPHSA/exact_1.2.3.5.cmake
new file mode 100644
index 0000000..ddb0d13
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_1.2.3.5.cmake
@@ -0,0 +1 @@
+find_package(Pseudo 1.2.3.5 EXACT REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/exact_1.2.3.cmake b/Tests/RunCMake/FPHSA/exact_1.2.3.cmake
new file mode 100644
index 0000000..bf9b2a3
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_1.2.3.cmake
@@ -0,0 +1 @@
+find_package(Pseudo 1.2.3 EXACT REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/exact_1.2.4-result.txt b/Tests/RunCMake/FPHSA/exact_1.2.4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_1.2.4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FPHSA/exact_1.2.4.cmake b/Tests/RunCMake/FPHSA/exact_1.2.4.cmake
new file mode 100644
index 0000000..548a079
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_1.2.4.cmake
@@ -0,0 +1 @@
+find_package(Pseudo 1.2.4 EXACT REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/exact_1.2.cmake b/Tests/RunCMake/FPHSA/exact_1.2.cmake
new file mode 100644
index 0000000..080d961
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_1.2.cmake
@@ -0,0 +1 @@
+find_package(Pseudo 1.2 EXACT REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/exact_1.3-result.txt b/Tests/RunCMake/FPHSA/exact_1.3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_1.3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FPHSA/exact_1.3.cmake b/Tests/RunCMake/FPHSA/exact_1.3.cmake
new file mode 100644
index 0000000..e36b0c5
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_1.3.cmake
@@ -0,0 +1 @@
+find_package(Pseudo 1.3 EXACT REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/exact_1.cmake b/Tests/RunCMake/FPHSA/exact_1.cmake
new file mode 100644
index 0000000..adadbc4
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_1.cmake
@@ -0,0 +1 @@
+find_package(Pseudo 1 EXACT REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/exact_2-result.txt b/Tests/RunCMake/FPHSA/exact_2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FPHSA/exact_2.cmake b/Tests/RunCMake/FPHSA/exact_2.cmake
new file mode 100644
index 0000000..55353a8
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/exact_2.cmake
@@ -0,0 +1 @@
+find_package(Pseudo 2 EXACT REQUIRED)