diff options
-rw-r--r-- | Modules/ExternalProject.cmake | 465 | ||||
-rw-r--r-- | Modules/FindCurses.cmake | 3 | ||||
-rw-r--r-- | Source/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 40 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.h | 3 | ||||
-rw-r--r-- | Source/CTest/cmParseBlanketJSCoverage.cxx | 166 | ||||
-rw-r--r-- | Source/CTest/cmParseBlanketJSCoverage.h | 48 | ||||
-rw-r--r-- | Source/cmCacheManager.cxx | 2 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 19 | ||||
-rw-r--r-- | Tests/JavascriptCoverage/DartConfiguration.tcl.in | 8 | ||||
-rw-r--r-- | Tests/JavascriptCoverage/output.json.in | 448 | ||||
-rw-r--r-- | Tests/JavascriptCoverage/test.js | 53 | ||||
-rw-r--r-- | Tests/JavascriptCoverage/test3.js | 37 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/D_nested_cache-stderr.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/D_nested_cache.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/D_typed_nested_cache-stderr.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/D_typed_nested_cache.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 8 |
20 files changed, 1119 insertions, 191 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index d6a6b72..a92f20c 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1,187 +1,276 @@ -#.rst: -# ExternalProject -# --------------- -# -# Create custom targets to build projects in external trees -# -# The ``ExternalProject_Add`` function creates a custom target to drive -# download, update/patch, configure, build, install and test steps of an -# external project: -# -# .. code-block:: cmake -# -# ExternalProject_Add(<name> # Name for custom target -# [DEPENDS projects...] # Targets on which the project depends -# [PREFIX dir] # Root dir for entire project -# [LIST_SEPARATOR sep] # Sep to be replaced by ; in cmd lines -# [TMP_DIR dir] # Directory to store temporary files -# [STAMP_DIR dir] # Directory to store step timestamps -# [EXCLUDE_FROM_ALL 1] # The "all" target does not depend on this -# #--Download step-------------- -# [DOWNLOAD_NAME fname] # File name to store (if not end of URL) -# [DOWNLOAD_DIR dir] # Directory to store downloaded files -# [DOWNLOAD_COMMAND cmd...] # Command to download source tree -# [DOWNLOAD_NO_PROGRESS 1] # Disable download progress reports -# [CVS_REPOSITORY cvsroot] # CVSROOT of CVS repository -# [CVS_MODULE mod] # Module to checkout from CVS repo -# [CVS_TAG tag] # Tag to checkout from CVS repo -# [SVN_REPOSITORY url] # URL of Subversion repo -# [SVN_REVISION -r<rev>] # Revision to checkout from Subversion repo -# [SVN_USERNAME john ] # Username for Subversion checkout and update -# [SVN_PASSWORD doe ] # Password for Subversion checkout and update -# [SVN_TRUST_CERT 1 ] # Trust the Subversion server site certificate -# [GIT_REPOSITORY url] # URL of git repo -# [GIT_TAG tag] # Git branch name, commit id or tag -# [GIT_SUBMODULES modules...] # Git submodules that shall be updated, all if empty -# [HG_REPOSITORY url] # URL of mercurial repo -# [HG_TAG tag] # Mercurial branch name, commit id or tag -# [URL /.../src.tgz] # Full path or URL of source -# [URL_HASH ALGO=value] # Hash of file at URL -# [URL_MD5 md5] # Equivalent to URL_HASH MD5=md5 -# [TLS_VERIFY bool] # Should certificate for https be checked -# [TLS_CAINFO file] # Path to a certificate authority file -# [TIMEOUT seconds] # Time allowed for file download operations -# #--Update/Patch step---------- -# [UPDATE_COMMAND cmd...] # Source work-tree update command -# [PATCH_COMMAND cmd...] # Command to patch downloaded source -# #--Configure step------------- -# [SOURCE_DIR dir] # Source dir to be used for build -# [CONFIGURE_COMMAND cmd...] # Build tree configuration command -# [CMAKE_COMMAND /.../cmake] # Specify alternative cmake executable -# [CMAKE_GENERATOR gen] # Specify generator for native build -# [CMAKE_GENERATOR_PLATFORM p] # Generator-specific platform name -# [CMAKE_GENERATOR_TOOLSET t] # Generator-specific toolset name -# [CMAKE_ARGS args...] # Arguments to CMake command line -# [CMAKE_CACHE_ARGS args...] # Initial cache arguments, of the form -Dvar:string=on -# #--Build step----------------- -# [BINARY_DIR dir] # Specify build dir location -# [BUILD_COMMAND cmd...] # Command to drive the native build -# [BUILD_IN_SOURCE 1] # Use source dir for build dir -# [BUILD_ALWAYS 1] # No stamp file, build step always runs -# #--Install step--------------- -# [INSTALL_DIR dir] # Installation prefix -# [INSTALL_COMMAND cmd...] # Command to drive install after build -# #--Test step------------------ -# [TEST_BEFORE_INSTALL 1] # Add test step executed before install step -# [TEST_AFTER_INSTALL 1] # Add test step executed after install step -# [TEST_COMMAND cmd...] # Command to drive test -# #--Output logging------------- -# [LOG_DOWNLOAD 1] # Wrap download in script to log output -# [LOG_UPDATE 1] # Wrap update in script to log output -# [LOG_CONFIGURE 1] # Wrap configure in script to log output -# [LOG_BUILD 1] # Wrap build in script to log output -# [LOG_TEST 1] # Wrap test in script to log output -# [LOG_INSTALL 1] # Wrap install in script to log output -# #--Custom targets------------- -# [STEP_TARGETS st1 st2 ...] # Generate custom targets for these steps -# ) -# -# The ``*_DIR`` options specify directories for the project, with default -# directories computed as follows. If the ``PREFIX`` option is given to -# ``ExternalProject_Add()`` or the ``EP_PREFIX`` directory property is set, -# then an external project is built and installed under the specified prefix:: -# -# TMP_DIR = <prefix>/tmp -# STAMP_DIR = <prefix>/src/<name>-stamp -# DOWNLOAD_DIR = <prefix>/src -# SOURCE_DIR = <prefix>/src/<name> -# BINARY_DIR = <prefix>/src/<name>-build -# INSTALL_DIR = <prefix> -# -# Otherwise, if the ``EP_BASE`` directory property is set then components -# of an external project are stored under the specified base:: -# -# TMP_DIR = <base>/tmp/<name> -# STAMP_DIR = <base>/Stamp/<name> -# DOWNLOAD_DIR = <base>/Download/<name> -# SOURCE_DIR = <base>/Source/<name> -# BINARY_DIR = <base>/Build/<name> -# INSTALL_DIR = <base>/Install/<name> -# -# If no ``PREFIX``, ``EP_PREFIX``, or ``EP_BASE`` is specified then the -# default is to set ``PREFIX`` to ``<name>-prefix``. Relative paths are -# interpreted with respect to the build directory corresponding to the -# source directory in which ``ExternalProject_Add`` is invoked. -# -# If ``SOURCE_DIR`` is explicitly set to an existing directory the project -# will be built from it. Otherwise a download step must be specified -# using one of the ``DOWNLOAD_COMMAND``, ``CVS_*``, ``SVN_*``, or ``URL`` -# options. The ``URL`` option may refer locally to a directory or source -# tarball, or refer to a remote tarball (e.g. ``http://.../src.tgz``). -# -# The ``ExternalProject_Add_Step`` function adds a custom step to an -# external project: -# -# .. code-block:: cmake -# -# ExternalProject_Add_Step(<name> <step> # Names of project and custom step -# [COMMAND cmd...] # Command line invoked by this step -# [COMMENT "text..."] # Text printed when step executes -# [DEPENDEES steps...] # Steps on which this step depends -# [DEPENDERS steps...] # Steps that depend on this step -# [DEPENDS files...] # Files on which this step depends -# [ALWAYS 1] # No stamp file, step always runs -# [EXCLUDE_FROM_MAIN 1] # Main target does not depend on this step -# [WORKING_DIRECTORY dir] # Working directory for command -# [LOG 1] # Wrap step in script to log output -# ) -# -# The command line, comment, and working directory of every standard and -# custom step is processed to replace tokens ``<SOURCE_DIR>``, -# ``<BINARY_DIR>``, ``<INSTALL_DIR>``, and ``<TMP_DIR>`` with -# corresponding property values. -# -# Any builtin step that specifies a ``<step>_COMMAND cmd...`` or custom -# step that specifies a ``COMMAND cmd...`` may specify additional command -# lines using the form ``COMMAND cmd...``. At build time the commands -# will be executed in order and aborted if any one fails. For example:: -# -# ... BUILD_COMMAND make COMMAND echo done ... -# -# specifies to run ``make`` and then ``echo done`` during the build step. -# Whether the current working directory is preserved between commands is -# not defined. Behavior of shell operators like ``&&`` is not defined. -# -# The ``ExternalProject_Get_Property`` function retrieves external project -# target properties:: -# -# ExternalProject_Get_Property(<name> [prop1 [prop2 [...]]]) -# -# It stores property values in variables of the same name. Property -# names correspond to the keyword argument names of -# ``ExternalProject_Add``. -# -# The ``ExternalProject_Add_StepTargets`` function generates custom -# targets for the steps listed:: -# -# ExternalProject_Add_StepTargets(<name> [step1 [step2 [...]]]) -# -# If ``STEP_TARGETS`` is set then ``ExternalProject_Add_StepTargets`` is -# automatically called at the end of matching calls to -# ``ExternalProject_Add_Step``. Pass ``STEP_TARGETS`` explicitly to -# individual ``ExternalProject_Add`` calls, or implicitly to all -# ``ExternalProject_Add`` calls by setting the directory property -# ``EP_STEP_TARGETS``. -# -# If ``STEP_TARGETS`` is not set, clients may still manually call -# ``ExternalProject_Add_StepTargets`` after calling -# ``ExternalProject_Add`` or ``ExternalProject_Add_Step``. -# -# This functionality is provided to make it easy to drive the steps -# independently of each other by specifying targets on build command -# lines. For example, you may be submitting to a sub-project based -# dashboard, where you want to drive the configure portion of the build, -# then submit to the dashboard, followed by the build portion, followed -# by tests. If you invoke a custom target that depends on a step -# halfway through the step dependency chain, then all the previous steps -# will also run to ensure everything is up to date. -# -# For example, to drive configure, build and test steps independently -# for each ``ExternalProject_Add`` call in your project, write the following -# line prior to any ``ExternalProject_Add`` calls in your ``CMakeLists.txt`` -# file:: -# -# set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test) +#[=======================================================================[.rst: +ExternalProject +--------------- + +Create custom targets to build projects in external trees + +.. command:: ExternalProject_Add + + The ``ExternalProject_Add`` function creates a custom target to drive + download, update/patch, configure, build, install and test steps of an + external project:: + + ExternalProject_Add(<name> [<option>...]) + + General options are: + + ``DEPENDS <projects>...`` + Targets on which the project depends + ``PREFIX <dir>`` + Root dir for entire project + ``LIST_SEPARATOR <sep>`` + Sep to be replaced by ; in cmd lines + ``TMP_DIR <dir>`` + Directory to store temporary files + ``STAMP_DIR <dir>`` + Directory to store step timestamps + ``EXCLUDE_FROM_ALL 1`` + The "all" target does not depend on this + + Download step options are: + + ``DOWNLOAD_NAME <fname>`` + File name to store (if not end of URL) + ``DOWNLOAD_DIR <dir>`` + Directory to store downloaded files + ``DOWNLOAD_COMMAND <cmd>...`` + Command to download source tree + ``DOWNLOAD_NO_PROGRESS 1`` + Disable download progress reports + ``CVS_REPOSITORY <cvsroot>`` + CVSROOT of CVS repository + ``CVS_MODULE <mod>`` + Module to checkout from CVS repo + ``CVS_TAG <tag>`` + Tag to checkout from CVS repo + ``SVN_REPOSITORY <url>`` + URL of Subversion repo + ``SVN_REVISION -r<rev>`` + Revision to checkout from Subversion repo + ``SVN_USERNAME <username>`` + Username for Subversion checkout and update + ``SVN_PASSWORD <password>`` + Password for Subversion checkout and update + ``SVN_TRUST_CERT 1`` + Trust the Subversion server site certificate + ``GIT_REPOSITORY <url>`` + URL of git repo + ``GIT_TAG <tag>`` + Git branch name, commit id or tag + ``GIT_SUBMODULES <module>...`` + Git submodules that shall be updated, all if empty + ``HG_REPOSITORY <url>`` + URL of mercurial repo + ``HG_TAG <tag>`` + Mercurial branch name, commit id or tag + ``URL /.../src.tgz`` + Full path or URL of source + ``URL_HASH ALGO=value`` + Hash of file at URL + ``URL_MD5 md5`` + Equivalent to URL_HASH MD5=md5 + ``TLS_VERIFY <bool>`` + Should certificate for https be checked + ``TLS_CAINFO <file>`` + Path to a certificate authority file + ``TIMEOUT <seconds>`` + Time allowed for file download operations + + Update/Patch step options are: + + ``UPDATE_COMMAND <cmd>...`` + Source work-tree update command + ``PATCH_COMMAND <cmd>...`` + Command to patch downloaded source + + Configure step options are: + + ``SOURCE_DIR <dir>`` + Source dir to be used for build + ``CONFIGURE_COMMAND <cmd>...`` + Build tree configuration command + ``CMAKE_COMMAND /.../cmake`` + Specify alternative cmake executable + ``CMAKE_GENERATOR <gen>`` + Specify generator for native build + ``CMAKE_GENERATOR_PLATFORM <platform>`` + Generator-specific platform name + ``CMAKE_GENERATOR_TOOLSET <toolset>`` + Generator-specific toolset name + ``CMAKE_ARGS <arg>...`` + Arguments to CMake command line + ``CMAKE_CACHE_ARGS <arg>...`` + Initial cache arguments, of the form ``-Dvar:string=on`` + + Build step options are: + + ``BINARY_DIR <dir>`` + Specify build dir location + ``BUILD_COMMAND <cmd>...`` + Command to drive the native build + ``BUILD_IN_SOURCE 1`` + Use source dir for build dir + ``BUILD_ALWAYS 1`` + No stamp file, build step always runs + + Install step options are: + + ``INSTALL_DIR <dir>`` + Installation prefix + ``INSTALL_COMMAND <cmd>...`` + Command to drive install after build + + Test step options are: + + ``TEST_BEFORE_INSTALL 1`` + Add test step executed before install step + ``TEST_AFTER_INSTALL 1`` + Add test step executed after install step + ``TEST_COMMAND <cmd>...`` + Command to drive test + + Output logging options are: + + ``LOG_DOWNLOAD 1`` + Wrap download in script to log output + ``LOG_UPDATE 1`` + Wrap update in script to log output + ``LOG_CONFIGURE 1`` + Wrap configure in script to log output + ``LOG_BUILD 1`` + Wrap build in script to log output + ``LOG_TEST 1`` + Wrap test in script to log output + ``LOG_INSTALL 1`` + Wrap install in script to log output + + Other options are: + + ``STEP_TARGETS <step-target>...`` + Generate custom targets for these steps + + The ``*_DIR`` options specify directories for the project, with default + directories computed as follows. If the ``PREFIX`` option is given to + ``ExternalProject_Add()`` or the ``EP_PREFIX`` directory property is set, + then an external project is built and installed under the specified prefix:: + + TMP_DIR = <prefix>/tmp + STAMP_DIR = <prefix>/src/<name>-stamp + DOWNLOAD_DIR = <prefix>/src + SOURCE_DIR = <prefix>/src/<name> + BINARY_DIR = <prefix>/src/<name>-build + INSTALL_DIR = <prefix> + + Otherwise, if the ``EP_BASE`` directory property is set then components + of an external project are stored under the specified base:: + + TMP_DIR = <base>/tmp/<name> + STAMP_DIR = <base>/Stamp/<name> + DOWNLOAD_DIR = <base>/Download/<name> + SOURCE_DIR = <base>/Source/<name> + BINARY_DIR = <base>/Build/<name> + INSTALL_DIR = <base>/Install/<name> + + If no ``PREFIX``, ``EP_PREFIX``, or ``EP_BASE`` is specified then the + default is to set ``PREFIX`` to ``<name>-prefix``. Relative paths are + interpreted with respect to the build directory corresponding to the + source directory in which ``ExternalProject_Add`` is invoked. + + If ``SOURCE_DIR`` is explicitly set to an existing directory the project + will be built from it. Otherwise a download step must be specified + using one of the ``DOWNLOAD_COMMAND``, ``CVS_*``, ``SVN_*``, or ``URL`` + options. The ``URL`` option may refer locally to a directory or source + tarball, or refer to a remote tarball (e.g. ``http://.../src.tgz``). + +.. command:: ExternalProject_Add_Step + + The ``ExternalProject_Add_Step`` function adds a custom step to an + external project:: + + ExternalProject_Add_Step(<name> <step> [<option>...]) + + Options are: + + ``COMMAND <cmd>...`` + Command line invoked by this step + ``COMMENT "<text>..."`` + Text printed when step executes + ``DEPENDEES <step>...`` + Steps on which this step depends + ``DEPENDERS <step>...`` + Steps that depend on this step + ``DEPENDS <file>...`` + Files on which this step depends + ``ALWAYS 1`` + No stamp file, step always runs + ``EXCLUDE_FROM_MAIN 1`` + Main target does not depend on this step + ``WORKING_DIRECTORY <dir>`` + Working directory for command + ``LOG 1`` + Wrap step in script to log output + + The command line, comment, and working directory of every standard and + custom step is processed to replace tokens ``<SOURCE_DIR>``, + ``<BINARY_DIR>``, ``<INSTALL_DIR>``, and ``<TMP_DIR>`` with + corresponding property values. + +Any builtin step that specifies a ``<step>_COMMAND cmd...`` or custom +step that specifies a ``COMMAND cmd...`` may specify additional command +lines using the form ``COMMAND cmd...``. At build time the commands +will be executed in order and aborted if any one fails. For example:: + + ... BUILD_COMMAND make COMMAND echo done ... + +specifies to run ``make`` and then ``echo done`` during the build step. +Whether the current working directory is preserved between commands is +not defined. Behavior of shell operators like ``&&`` is not defined. + +.. command:: ExternalProject_Get_Property + + The ``ExternalProject_Get_Property`` function retrieves external project + target properties:: + + ExternalProject_Get_Property(<name> [prop1 [prop2 [...]]]) + + It stores property values in variables of the same name. Property + names correspond to the keyword argument names of + ``ExternalProject_Add``. + +.. command:: ExternalProject_Add_StepTargets + + The ``ExternalProject_Add_StepTargets`` function generates custom + targets for the steps listed:: + + ExternalProject_Add_StepTargets(<name> [step1 [step2 [...]]]) + +If ``STEP_TARGETS`` is set then ``ExternalProject_Add_StepTargets`` is +automatically called at the end of matching calls to +``ExternalProject_Add_Step``. Pass ``STEP_TARGETS`` explicitly to +individual ``ExternalProject_Add`` calls, or implicitly to all +``ExternalProject_Add`` calls by setting the directory property +``EP_STEP_TARGETS``. + +If ``STEP_TARGETS`` is not set, clients may still manually call +``ExternalProject_Add_StepTargets`` after calling +``ExternalProject_Add`` or ``ExternalProject_Add_Step``. + +This functionality is provided to make it easy to drive the steps +independently of each other by specifying targets on build command +lines. For example, you may be submitting to a sub-project based +dashboard, where you want to drive the configure portion of the build, +then submit to the dashboard, followed by the build portion, followed +by tests. If you invoke a custom target that depends on a step +halfway through the step dependency chain, then all the previous steps +will also run to ensure everything is up to date. + +For example, to drive configure, build and test steps independently +for each ``ExternalProject_Add`` call in your project, write the following +line prior to any ``ExternalProject_Add`` calls in your ``CMakeLists.txt`` +file:: + + set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test) +#]=======================================================================] #============================================================================= # Copyright 2008-2013 Kitware, Inc. @@ -200,9 +289,9 @@ math(EXPR _ep_documentation_line_count "${CMAKE_CURRENT_LIST_LINE} - 16") file(STRINGS "${CMAKE_CURRENT_LIST_FILE}" lines LIMIT_COUNT ${_ep_documentation_line_count} - REGEX "^# ( \\[[A-Z0-9_]+ [^]]*\\] +#.*$|[A-Za-z0-9_]+\\()") + REGEX "^\\.\\. command:: [A-Za-z0-9_]+|^ ``[A-Z0-9_]+ .*``$") foreach(line IN LISTS lines) - if("${line}" MATCHES "^# ([A-Za-z0-9_]+)\\(") + if("${line}" MATCHES "^\\.\\. command:: ([A-Za-z0-9_]+)") if(_ep_func) set(_ep_keywords_${_ep_func} "${_ep_keywords_${_ep_func}})$") endif() @@ -210,8 +299,8 @@ foreach(line IN LISTS lines) #message("function [${_ep_func}]") set(_ep_keywords_${_ep_func} "^(") set(_ep_keyword_sep) - else() - string(REGEX REPLACE "^# \\[([A-Z0-9_]+) .*" "\\1" _ep_key "${line}") + elseif("${line}" MATCHES "^ ``([A-Z0-9_]+) .*``$") + set(_ep_key "${CMAKE_MATCH_1}") #message(" keyword [${_ep_key}]") set(_ep_keywords_${_ep_func} "${_ep_keywords_${_ep_func}}${_ep_keyword_sep}${_ep_key}") diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake index 0184c39..a21ca89 100644 --- a/Modules/FindCurses.cmake +++ b/Modules/FindCurses.cmake @@ -50,6 +50,8 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake) + find_library(CURSES_CURSES_LIBRARY NAMES curses ) find_library(CURSES_NCURSES_LIBRARY NAMES ncurses ) @@ -81,7 +83,6 @@ endif() # prefix as the library was found, if still not found, try curses.h with the # default search paths. if(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES) - include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake) cmake_push_check_state() set(CMAKE_REQUIRED_QUIET ${Curses_FIND_QUIETLY}) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 97f4a89..7705683 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -522,6 +522,7 @@ set(CTEST_SRCS cmCTest.cxx CTest/cmParseCacheCoverage.cxx CTest/cmParseGTMCoverage.cxx CTest/cmParseJacocoCoverage.cxx + CTest/cmParseBlanketJSCoverage.cxx CTest/cmParsePHPCoverage.cxx CTest/cmParseCoberturaCoverage.cxx CTest/cmParseDelphiCoverage.cxx diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index dddacab..fc5353f 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 1) -set(CMake_VERSION_PATCH 20141028) +set(CMake_VERSION_PATCH 20141030) #set(CMake_VERSION_RC 1) diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 7d3c6bc..8dc22a8 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -16,6 +16,7 @@ #include "cmParseCacheCoverage.h" #include "cmParseJacocoCoverage.h" #include "cmParseDelphiCoverage.h" +#include "cmParseBlanketJSCoverage.h" #include "cmCTest.h" #include "cmake.h" #include "cmMakefile.h" @@ -424,6 +425,13 @@ int cmCTestCoverageHandler::ProcessHandler() return error; } + file_count += this->HandleBlanketJSCoverage(&cont); + error = cont.Error; + if ( file_count < 0 ) + { + return error; + } + file_count += this->HandleDelphiCoverage(&cont); error = cont.Error; if ( file_count < 0 ) @@ -927,10 +935,12 @@ int cmCTestCoverageHandler::HandleDelphiCoverage( std::vector<std::string> files; g.SetRecurse(true); + std::string BinDir = this->CTest->GetBinaryDir(); std::string coverageFile = BinDir+ "/*.html"; + g.FindFiles(coverageFile); files=g.GetFiles(); if (files.size() > 0) @@ -947,6 +957,36 @@ int cmCTestCoverageHandler::HandleDelphiCoverage( } return static_cast<int>(cont->TotalCoverage.size()); } + +//---------------------------------------------------------------------- +int cmCTestCoverageHandler::HandleBlanketJSCoverage( + cmCTestCoverageHandlerContainer* cont) + { + cmParseBlanketJSCoverage cov = + cmParseBlanketJSCoverage(*cont, this->CTest); + std::string SourceDir + = this->CTest->GetCTestConfiguration("SourceDirectory"); + + //Look for something other than output.json, still JSON extension. + std::string coverageFile = SourceDir+ "/*.json"; + cmsys::Glob g; + std::vector<std::string> files; + g.FindFiles(coverageFile); + files=g.GetFiles(); + if (files.size() > 0) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Found BlanketJS output JSON, Performing Coverage" << std::endl); + cov.LoadCoverageData(files); + } + else + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + " Cannot find BlanketJS coverage files: " << coverageFile + << std::endl); + } + return static_cast<int>(cont->TotalCoverage.size()); + } //---------------------------------------------------------------------- int cmCTestCoverageHandler::HandleGCovCoverage( cmCTestCoverageHandlerContainer* cont) diff --git a/Source/CTest/cmCTestCoverageHandler.h b/Source/CTest/cmCTestCoverageHandler.h index 01c5d7f..4aec795 100644 --- a/Source/CTest/cmCTestCoverageHandler.h +++ b/Source/CTest/cmCTestCoverageHandler.h @@ -87,6 +87,9 @@ private: //! Handle coverage for Delphi (Pascal) int HandleDelphiCoverage(cmCTestCoverageHandlerContainer* cont); + //! Handle coverage for Jacoco + int HandleBlanketJSCoverage(cmCTestCoverageHandlerContainer* cont); + //! Handle coverage using Bullseye int HandleBullseyeCoverage(cmCTestCoverageHandlerContainer* cont); int RunBullseyeSourceSummary(cmCTestCoverageHandlerContainer* cont); diff --git a/Source/CTest/cmParseBlanketJSCoverage.cxx b/Source/CTest/cmParseBlanketJSCoverage.cxx new file mode 100644 index 0000000..5f4a708 --- /dev/null +++ b/Source/CTest/cmParseBlanketJSCoverage.cxx @@ -0,0 +1,166 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 Kitware, Inc. + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#include "cmStandardIncludes.h" +#include <stdio.h> +#include <stdlib.h> +#include "cmSystemTools.h" +#include "cmParseBlanketJSCoverage.h" +#include <cmsys/Directory.hxx> +#include <cmsys/Glob.hxx> +#include <cmsys/FStream.hxx> + + +class cmParseBlanketJSCoverage::JSONParser + { +public: + typedef cmCTestCoverageHandlerContainer:: + SingleFileCoverageVector FileLinesType; + JSONParser(cmCTestCoverageHandlerContainer& cont) + : Coverage(cont) + { + } + + virtual ~JSONParser() + { + } + + std::string getValue(std::string line, int type) + { + size_t begIndex; + size_t endIndex; + endIndex = line.rfind(','); + begIndex = line.find_first_of(':'); + if(type == 0) + { + // A unique substring to remove the extra characters + // around the files name in the JSON (extra " and ,) + std::string foundFileName = + line.substr(begIndex+3,endIndex-(begIndex+4)); + return foundFileName; + } + else + { + return line.substr(begIndex,line.npos); + } + } + bool ParseFile(std::string file) + { + FileLinesType localCoverageVector; + std::string filename; + bool foundFile = false; + bool inSource = false; + std::string covResult; + std::string line; + + cmsys::ifstream in(file.c_str()); + if(!in) + { + return false; + } + while( cmSystemTools::GetLineFromStream(in, line)) + { + if(line.find("filename") != line.npos) + { + if(foundFile) + { + /* + * Upon finding a second file name, generate a + * vector within the total coverage to capture the + * information in the local vector + */ + FileLinesType& CoverageVector = + this->Coverage.TotalCoverage[filename.c_str()]; + CoverageVector = localCoverageVector; + localCoverageVector.clear(); + foundFile=false; + } + foundFile= true; + inSource = false; + filename = getValue(line,0).c_str(); + } + else if((line.find("coverage") != line.npos) && foundFile && inSource ) + { + /* + * two types of "coverage" in the JSON structure + * + * The coverage result over the file or set of files + * and the coverage for each individual line + * + * FoundFile and foundSource ensure that + * only the value of the line coverage is captured + */ + std::string result = getValue(line,1).c_str(); + result = result.substr(2,result.npos); + if(result == "\"\"") + { + // Empty quotation marks indicate that the + // line is not executable + localCoverageVector.push_back(-1); + } + else + { + // Else, it contains the number of time executed + localCoverageVector.push_back(atoi(result.c_str())); + } + } + else if(line.find("source") != line.npos) + { + inSource=true; + } + } + + // On exit, capture end of last file covered. + FileLinesType& CoverageVector = + this->Coverage.TotalCoverage[filename.c_str()]; + CoverageVector = localCoverageVector; + foundFile=false; + localCoverageVector.clear(); + return true; + } +private: + cmCTestCoverageHandlerContainer& Coverage; +}; + +cmParseBlanketJSCoverage::cmParseBlanketJSCoverage( + cmCTestCoverageHandlerContainer& cont, cmCTest* ctest) + :Coverage(cont), CTest(ctest) + { + } + +bool cmParseBlanketJSCoverage::LoadCoverageData(std::vector<std::string> files) + { + size_t i=0; + std::string path; + cmCTestLog(this->CTest,HANDLER_VERBOSE_OUTPUT, + "Found " << files.size() <<" Files" << std::endl); + for(i=0;i<files.size();i++) + { + cmCTestLog(this->CTest,HANDLER_VERBOSE_OUTPUT, + "Reading JSON File " << files[i] << std::endl); + + if(!this->ReadJSONFile(files[i])) + { + return false; + } + } + return true; + } + +bool cmParseBlanketJSCoverage::ReadJSONFile(std::string file) + { + cmParseBlanketJSCoverage::JSONParser parser + (this->Coverage); + cmCTestLog(this->CTest,HANDLER_VERBOSE_OUTPUT, + "Parsing " << file << std::endl); + parser.ParseFile(file); + return true; + } diff --git a/Source/CTest/cmParseBlanketJSCoverage.h b/Source/CTest/cmParseBlanketJSCoverage.h new file mode 100644 index 0000000..fc1d477 --- /dev/null +++ b/Source/CTest/cmParseBlanketJSCoverage.h @@ -0,0 +1,48 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 Kitware, Inc. + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ + +#ifndef cmParseBlanketJSCoverage_h +#define cmParseBlanketJSCoverage_h + +#include "cmStandardIncludes.h" +#include "cmCTestCoverageHandler.h" + + +/** \class cmParseBlanketJSCoverage + * \brief Parse BlanketJS coverage information + * + * This class is used to parse BlanketJS(Pascal) coverage information + * generated by the Blanket.js library when used in conjunction with the + * test runner mocha.js, which is used to write out the JSON format. + * + * Blanket.js: + * http://blanketjs.org/ + * + * Mocha.js + * http://visionmedia.github.io/mocha/ + */ +class cmParseBlanketJSCoverage +{ +public: + cmParseBlanketJSCoverage(cmCTestCoverageHandlerContainer& cont, + cmCTest* ctest); + bool LoadCoverageData(std::vector<std::string> files); + // Read the JSON output + bool ReadJSONFile(std::string file); + +protected: + + class JSONParser; + cmCTestCoverageHandlerContainer& Coverage; + cmCTest* CTest; +}; +#endif diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 9fc1a5a..6a47ea7 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -139,7 +139,7 @@ bool cmCacheManager::ParseEntry(const std::string& entry, { // input line is: key:type=value static cmsys::RegularExpression reg( - "^([^:]*):([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); + "^([^=:]*):([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); // input line is: "key":type=value static cmsys::RegularExpression regQuoted( "^\"([^\"]*)\":([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index e1e90a1..586f983 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2339,6 +2339,25 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release "Process file.*CoverageTest.java.*Total LOC:.*17.*Percentage Coverage: 76.47*" ENVIRONMENT COVFILE=) + # Adding a test case for Javascript Coverage + configure_file( + "${CMake_SOURCE_DIR}/Tests/JavascriptCoverage/DartConfiguration.tcl.in" + "${CMake_BINARY_DIR}/Testing/JavascriptCoverage/DartConfiguration.tcl") + configure_file( + "${CMake_SOURCE_DIR}/Tests/JavascriptCoverage/output.json.in" + "${CMake_BINARY_DIR}/Testing/JavascriptCoverage/output.json") + file(COPY "${CMake_SOURCE_DIR}/Tests/JavascriptCoverage/" + DESTINATION "${CMake_BINARY_DIR}/Testing/JavascriptCoverage" + FILES_MATCHING PATTERN "*.js") + add_test(NAME CTestJavascriptCoverage + COMMAND cmake -E chdir + ${CMake_BINARY_DIR}/Testing/JavascriptCoverage + $<TARGET_FILE:ctest> -T Coverage --debug) + set_tests_properties(CTestJavascriptCoverage PROPERTIES + PASS_REGULAR_EXPRESSION + "Process file.*test3.js.*Total LOC:.*49.*Percentage Coverage: 79.59*" + ENVIRONMENT COVFILE=) + # test coverage for Delphi-code-Coverage configure_file( "${CMake_SOURCE_DIR}/Tests/DelphiCoverage/DartConfiguration.tcl.in" diff --git a/Tests/JavascriptCoverage/DartConfiguration.tcl.in b/Tests/JavascriptCoverage/DartConfiguration.tcl.in new file mode 100644 index 0000000..f94d988 --- /dev/null +++ b/Tests/JavascriptCoverage/DartConfiguration.tcl.in @@ -0,0 +1,8 @@ +# This file is configured by CMake automatically as DartConfiguration.tcl +# If you choose not to use CMake, this file may be hand configured, by +# filling in the required variables. + + +# Configuration directories and files +SourceDirectory: ${CMake_BINARY_DIR}/Testing/JavascriptCoverage +BuildDirectory: ${CMake_BINARY_DIR}/Testing/JavascriptCoverage diff --git a/Tests/JavascriptCoverage/output.json.in b/Tests/JavascriptCoverage/output.json.in new file mode 100644 index 0000000..717cffe --- /dev/null +++ b/Tests/JavascriptCoverage/output.json.in @@ -0,0 +1,448 @@ +{ + "instrumentation": "node-jscoverage", + "sloc": 29, + "hits": 28, + "misses": 1, + "coverage": 96.55172413793103, + "files": [ + { + "filename": "${CMake_BINARY_DIR}/Testing/JavascriptCoverage/test.js", + "coverage": 96.55172413793103, + "hits": 28, + "misses": 1, + "sloc": 29, + "source": { + "1": { + "source": "var assert = require(\"assert\")", + "coverage": 1 + }, + "2": { + "source": "var test = {", + "coverage": 1 + }, + "3": { + "source": " version: \"1.0.0\"", + "coverage": "" + }, + "4": { + "source": "}", + "coverage": "" + }, + "5": { + "source": "function covTest(p1,p2) {", + "coverage": 1 + }, + "6": { + "source": " if (p1 > 3) {", + "coverage": 2 + }, + "7": { + "source": " return 1;", + "coverage": 1 + }, + "8": { + "source": " }", + "coverage": "" + }, + "9": { + "source": " else {", + "coverage": "" + }, + "10": { + "source": " return p1 + p2;", + "coverage": 1 + }, + "11": { + "source": " }", + "coverage": "" + }, + "12": { + "source": "}", + "coverage": "" + }, + "13": { + "source": "", + "coverage": "" + }, + "14": { + "source": "function covTest2(p1,p2) {", + "coverage": 1 + }, + "15": { + "source": " return 0;", + "coverage": 0 + }, + "16": { + "source": "}", + "coverage": "" + }, + "17": { + "source": "", + "coverage": "" + }, + "18": { + "source": "function covTest3(p1) {", + "coverage": 1 + }, + "19": { + "source": " for(i=0;i < p1;i++){", + "coverage": 1 + }, + "20": { + "source": " }", + "coverage": "" + }, + "21": { + "source": " return i;", + "coverage": 1 + }, + "22": { + "source": "}", + "coverage": "" + }, + "23": { + "source": "function covTest4(p1) {", + "coverage": 1 + }, + "24": { + "source": " i=0;", + "coverage": 1 + }, + "25": { + "source": " while(i < p1){", + "coverage": 1 + }, + "26": { + "source": " i++;", + "coverage": 5 + }, + "27": { + "source": " }", + "coverage": "" + }, + "28": { + "source": " return i;", + "coverage": 1 + }, + "29": { + "source": "}", + "coverage": "" + }, + "30": { + "source": "", + "coverage": "" + }, + "31": { + "source": "describe('Array', function(){", + "coverage": 1 + }, + "32": { + "source": " describe('CovTest', function(){", + "coverage": 1 + }, + "33": { + "source": " it('should return when the value is not present', function(){", + "coverage": 1 + }, + "34": { + "source": " assert.equal(4,covTest(2,2));", + "coverage": 1 + }, + "35": { + "source": " })", + "coverage": "" + }, + "36": { + "source": " })", + "coverage": "" + }, + "37": { + "source": " ", + "coverage": "" + }, + "38": { + "source": " describe('CovTest>3', function(){", + "coverage": 1 + }, + "39": { + "source": " it('should return when the value is not present', function(){", + "coverage": 1 + }, + "40": { + "source": " assert.equal(1,covTest(4,2));", + "coverage": 1 + }, + "41": { + "source": " })", + "coverage": "" + }, + "42": { + "source": " })", + "coverage": "" + }, + "43": { + "source": " describe('covTest4', function(){", + "coverage": 1 + }, + "44": { + "source": " it('should return when the value is not present', function(){", + "coverage": 1 + }, + "45": { + "source": " assert.equal(5,covTest4(5));", + "coverage": 1 + }, + "46": { + "source": " })", + "coverage": "" + }, + "47": { + "source": " })", + "coverage": "" + }, + "48": { + "source": " describe('covTest3', function(){", + "coverage": 1 + }, + "49": { + "source": " it('should return when the value is not present', function(){", + "coverage": 1 + }, + "50": { + "source": " assert.equal(5,covTest3(5));", + "coverage": 1 + }, + "51": { + "source": " })", + "coverage": "" + }, + "52": { + "source": " })", + "coverage": "" + }, + "53": { + "source": "})", + "coverage": "" + }, + "54": { + "source": "", + "coverage": "" + } + } + "filename": "${CMake_BINARY_DIR}/Testing/JavascriptCoverage/test3.js", + "coverage": 55.00000000000001, + "hits": 11, + "misses": 9, + "sloc": 20, + "source": { + "1": { + "source": "var assert = require(\"assert\")", + "coverage": 1 + }, + "2": { + "source": "var test = {", + "coverage": 1 + }, + "3": { + "source": " version: \"1.0.0\"", + "coverage": "" + }, + "4": { + "source": "}", + "coverage": "" + }, + "5": { + "source": "function covTest(p1,p2) {", + "coverage": 1 + }, + "6": { + "source": " if (p1 > 3) {", + "coverage": 0 + }, + "7": { + "source": " return 1;", + "coverage": 0 + }, + "8": { + "source": " }", + "coverage": "" + }, + "9": { + "source": " else {", + "coverage": "" + }, + "10": { + "source": " return p1 + p2;", + "coverage": 0 + }, + "11": { + "source": " }", + "coverage": "" + }, + "12": { + "source": "}", + "coverage": "" + }, + "13": { + "source": "", + "coverage": "" + }, + "14": { + "source": "function covTest2(p1,p2) {", + "coverage": 1 + }, + "15": { + "source": " return 0;", + "coverage": 1 + }, + "16": { + "source": "}", + "coverage": "" + }, + "17": { + "source": "", + "coverage": "" + }, + "18": { + "source": "function covTest3(p1) {", + "coverage": 1 + }, + "19": { + "source": " for(i=0;i < p1;i++){", + "coverage": 0 + }, + "20": { + "source": " }", + "coverage": "" + }, + "21": { + "source": " return i;", + "coverage": 0 + }, + "22": { + "source": "}", + "coverage": "" + }, + "23": { + "source": "function covTest4(p1) {", + "coverage": 1 + }, + "24": { + "source": " i=0;", + "coverage": 0 + }, + "25": { + "source": " while(i < p1){", + "coverage": 0 + }, + "26": { + "source": " i++;", + "coverage": 0 + }, + "27": { + "source": " }", + "coverage": "" + }, + "28": { + "source": " return i;", + "coverage": 0 + }, + "29": { + "source": "}", + "coverage": "" + }, + "30": { + "source": "", + "coverage": "" + }, + "31": { + "source": "describe('Array', function(){", + "coverage": 1 + }, + "32": { + "source": " describe('CovTest2', function(){", + "coverage": 1 + }, + "33": { + "source": " it('should return when the value is not present', function(){", + "coverage": 1 + }, + "34": { + "source": " assert.equal(0,covTest2(2,2));", + "coverage": 1 + }, + "35": { + "source": " })", + "coverage": "" + }, + "36": { + "source": " })", + "coverage": "" + }, + "37": { + "source": "})", + "coverage": "" + }, + "38": { + "source": "", + "coverage": "" + } + } + } + ], + "stats": { + "suites": 5, + "tests": 4, + "passes": 4, + "pending": 0, + "failures": 0, + "start": "2014-10-23T17:56:02.339Z", + "end": "2014-10-23T17:56:02.344Z", + "duration": 5 + }, + "tests": [ + { + "title": "should return when the value is not present", + "fullTitle": "Array CovTest should return when the value is not present", + "duration": 0 + }, + { + "title": "should return when the value is not present", + "fullTitle": "Array CovTest>3 should return when the value is not present", + "duration": 0 + }, + { + "title": "should return when the value is not present", + "fullTitle": "Array covTest4 should return when the value is not present", + "duration": 0 + }, + { + "title": "should return when the value is not present", + "fullTitle": "Array covTest3 should return when the value is not present", + "duration": 0 + } + ], + "failures": [], + "passes": [ + { + "title": "should return when the value is not present", + "fullTitle": "Array CovTest should return when the value is not present", + "duration": 0 + }, + { + "title": "should return when the value is not present", + "fullTitle": "Array CovTest>3 should return when the value is not present", + "duration": 0 + }, + { + "title": "should return when the value is not present", + "fullTitle": "Array covTest4 should return when the value is not present", + "duration": 0 + }, + { + "title": "should return when the value is not present", + "fullTitle": "Array covTest3 should return when the value is not present", + "duration": 0 + } + ] +}
\ No newline at end of file diff --git a/Tests/JavascriptCoverage/test.js b/Tests/JavascriptCoverage/test.js new file mode 100644 index 0000000..273e921c --- /dev/null +++ b/Tests/JavascriptCoverage/test.js @@ -0,0 +1,53 @@ +var assert = require("assert") +var test = { + version: "1.0.0" +} +function covTest(p1,p2) { + if (p1 > 3) { + return 1; + } + else { + return p1 + p2; + } +} + +function covTest2(p1,p2) { + return 0; +} + +function covTest3(p1) { + for(i=0;i < p1;i++){ + } + return i; +} +function covTest4(p1) { + i=0; + while(i < p1){ + i++; + } + return i; +} + +describe('Array', function(){ + describe('CovTest', function(){ + it('should return when the value is not present', function(){ + assert.equal(4,covTest(2,2)); + }) + }) + + describe('CovTest>3', function(){ + it('should return when the value is not present', function(){ + assert.equal(1,covTest(4,2)); + }) + }) + describe('covTest4', function(){ + it('should return when the value is not present', function(){ + assert.equal(5,covTest4(5)); + }) + }) + describe('covTest3', function(){ + it('should return when the value is not present', function(){ + assert.equal(5,covTest3(5)); + }) + }) +}) diff --git a/Tests/JavascriptCoverage/test3.js b/Tests/JavascriptCoverage/test3.js new file mode 100644 index 0000000..a1e31bc --- /dev/null +++ b/Tests/JavascriptCoverage/test3.js @@ -0,0 +1,37 @@ +var assert = require("assert") +var test = { + version: "1.0.0" +} +function covTest(p1,p2) { + if (p1 > 3) { + return 1; + } + else { + return p1 + p2; + } +} + +function covTest2(p1,p2) { + return 0; +} + +function covTest3(p1) { + for(i=0;i < p1;i++){ + } + return i; +} +function covTest4(p1) { + i=0; + while(i < p1){ + i++; + } + return i; +} + +describe('Array', function(){ + describe('CovTest2', function(){ + it('should return when the value is not present', function(){ + assert.equal(0,covTest2(2,2)); + }) + }) +}) diff --git a/Tests/RunCMake/CommandLine/CMakeLists.txt b/Tests/RunCMake/CommandLine/CMakeLists.txt new file mode 100644 index 0000000..2897109 --- /dev/null +++ b/Tests/RunCMake/CommandLine/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CommandLine/D_nested_cache-stderr.txt b/Tests/RunCMake/CommandLine/D_nested_cache-stderr.txt new file mode 100644 index 0000000..bba64bc --- /dev/null +++ b/Tests/RunCMake/CommandLine/D_nested_cache-stderr.txt @@ -0,0 +1 @@ +^-->-DBAR:BOOL=BAZ<--$ diff --git a/Tests/RunCMake/CommandLine/D_nested_cache.cmake b/Tests/RunCMake/CommandLine/D_nested_cache.cmake new file mode 100644 index 0000000..9b57284 --- /dev/null +++ b/Tests/RunCMake/CommandLine/D_nested_cache.cmake @@ -0,0 +1 @@ +message("-->${FOO}<--") diff --git a/Tests/RunCMake/CommandLine/D_typed_nested_cache-stderr.txt b/Tests/RunCMake/CommandLine/D_typed_nested_cache-stderr.txt new file mode 100644 index 0000000..bba64bc --- /dev/null +++ b/Tests/RunCMake/CommandLine/D_typed_nested_cache-stderr.txt @@ -0,0 +1 @@ +^-->-DBAR:BOOL=BAZ<--$ diff --git a/Tests/RunCMake/CommandLine/D_typed_nested_cache.cmake b/Tests/RunCMake/CommandLine/D_typed_nested_cache.cmake new file mode 100644 index 0000000..9b57284 --- /dev/null +++ b/Tests/RunCMake/CommandLine/D_typed_nested_cache.cmake @@ -0,0 +1 @@ +message("-->${FOO}<--") diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 5622a5b..84e3614 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -43,3 +43,11 @@ run_cmake_command(E_sleep-bad-arg2 ${CMAKE_COMMAND} -E sleep 1 -1) run_cmake_command(E_sleep-one-tenth ${CMAKE_COMMAND} -E sleep 0.1) run_cmake_command(P_directory ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}) + +set(RunCMake_TEST_OPTIONS + "-DFOO=-DBAR:BOOL=BAZ") +run_cmake(D_nested_cache) + +set(RunCMake_TEST_OPTIONS + "-DFOO:STRING=-DBAR:BOOL=BAZ") +run_cmake(D_typed_nested_cache) |