diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/Assembler/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 19 | ||||
-rw-r--r-- | Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in | 9 | ||||
-rw-r--r-- | Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake | 59 | ||||
-rw-r--r-- | Tests/DelphiCoverage/DartConfiguration.tcl.in | 8 | ||||
-rw-r--r-- | Tests/DelphiCoverage/UTCovTest(UTCovTest.pas).html | 117 | ||||
-rw-r--r-- | Tests/DelphiCoverage/src/UTCovTest.pas | 75 | ||||
-rw-r--r-- | Tests/ForceInclude/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/Fortran/CMakeLists.txt | 18 | ||||
-rw-r--r-- | Tests/FortranC/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/LinkStatic/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/ModuleDefinition/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/PDBDirectoryAndName/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/PrecompiledHeader/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/Preprocess/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/TryCompile/CMakeLists.txt | 4 |
16 files changed, 304 insertions, 21 deletions
diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt index fdc5c00..fb17ebb 100644 --- a/Tests/Assembler/CMakeLists.txt +++ b/Tests/Assembler/CMakeLists.txt @@ -9,7 +9,7 @@ set(SRCS) # and also generate assembler files from C: if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode" AND NOT CMAKE_OSX_ARCHITECTURES) - if(("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU|Clang|AppleClang|HP|SunPro|XL)$") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel" AND UNIX)) + if((CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang|HP|SunPro|XL)$") OR (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND UNIX)) set(C_FLAGS "${CMAKE_C_FLAGS}") separate_arguments(C_FLAGS) if(CMAKE_OSX_SYSROOT AND CMAKE_C_SYSROOT_FLAG AND NOT ";${C_FLAGS};" MATCHES ";${CMAKE_C_SYSROOT_FLAG};") diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 25cc846..e1e90a1 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1501,7 +1501,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release set_tests_properties ( SimpleInstall-Stage2 PROPERTIES DEPENDS SimpleInstall) # Test static linking on toolchains known to support it. - if("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU)$" + if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT APPLE AND NOT WIN32 AND NOT CYGWIN AND EXISTS "/usr/lib/libm.a") add_test(LinkStatic ${CMAKE_CTEST_COMMAND} @@ -2339,6 +2339,23 @@ ${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=) + # test coverage for Delphi-code-Coverage + configure_file( + "${CMake_SOURCE_DIR}/Tests/DelphiCoverage/DartConfiguration.tcl.in" + "${CMake_BINARY_DIR}/Testing/DelphiCoverage/DartConfiguration.tcl") + file(COPY "${CMake_SOURCE_DIR}/Tests/DelphiCoverage/src" + DESTINATION "${CMake_BINARY_DIR}/Testing/DelphiCoverage") + file(COPY "${CMake_SOURCE_DIR}/Tests/DelphiCoverage/UTCovTest(UTCovTest.pas).html" + DESTINATION "${CMake_BINARY_DIR}/Testing/DelphiCoverage") + add_test(NAME CTestDelphiCoverage + COMMAND cmake -E chdir + ${CMake_BINARY_DIR}/Testing/DelphiCoverage + $<TARGET_FILE:ctest> -T Coverage --debug) + set_tests_properties(CTestDelphiCoverage PROPERTIES + PASS_REGULAR_EXPRESSION + "Process file.*UTCovTest.pas.*Total LOC:.*20.*Percentage Coverage: 95.*" + ENVIRONMENT COVFILE=) + function(add_config_tests cfg) set(base "${CMake_BINARY_DIR}/Tests/CTestConfig") diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in index 450c204..8c01b32 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in @@ -8,6 +8,13 @@ endif() if(CPACK_GENERATOR MATCHES "RPM") set(CPACK_RPM_COMPONENT_INSTALL "ON") set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") + + # test package summary override + set(CPACK_RPM_PACKAGE_SUMMARY "default summary") + set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary") + + # test package description override + set(CPACK_RPM_libraries_PACKAGE_DESCRIPTION "libraries description") endif() if(CPACK_GENERATOR MATCHES "DEB") @@ -20,4 +27,4 @@ endif() #set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE) #set(CPACK_COMPONENTS_GROUPING) set(CPACK_COMPONENTS_IGNORE_GROUPS 1) -#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
\ No newline at end of file +#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1) diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index 0b6d07d..4d56218 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -123,3 +123,62 @@ if(expected_file_mask) message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error})") endif() endif() + +# Validate content +if(CPackGen MATCHES "RPM") + find_program(RPM_EXECUTABLE rpm) + if(NOT RPM_EXECUTABLE) + message(FATAL_ERROR "error: missing rpm executable required by the test") + endif() + + set(CPACK_RPM_PACKAGE_SUMMARY "default summary") + set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary") + set(CPACK_RPM_libraries_PACKAGE_DESCRIPTION "libraries description") + set(CPACK_COMPONENT_APPLICATIONS_DESCRIPTION + "An extremely useful application that makes use of MyLib") + set(CPACK_COMPONENT_HEADERS_DESCRIPTION + "C/C\\+\\+ header files for use with MyLib") + + if(${CPackComponentWay} STREQUAL "IgnoreGroup") + foreach(check_file ${expected_file}) + string(REGEX MATCH ".*libraries.*" check_file_libraries_match ${check_file}) + string(REGEX MATCH ".*headers.*" check_file_headers_match ${check_file}) + string(REGEX MATCH ".*applications.*" check_file_applications_match ${check_file}) + string(REGEX MATCH ".*Unspecified.*" check_file_Unspecified_match ${check_file}) + + execute_process(COMMAND ${RPM_EXECUTABLE} -pqi ${check_file} + OUTPUT_VARIABLE check_file_content + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if(check_file_libraries_match) + set(check_file_match_expected_summary ".*${CPACK_RPM_libraries_PACKAGE_SUMMARY}.*") + set(check_file_match_expected_description ".*${CPACK_RPM_libraries_PACKAGE_DESCRIPTION}.*") + elseif(check_file_headers_match) + set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") + set(check_file_match_expected_description ".*${CPACK_COMPONENT_HEADERS_DESCRIPTION}.*") + elseif(check_file_applications_match) + set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") + set(check_file_match_expected_description ".*${CPACK_COMPONENT_APPLICATIONS_DESCRIPTION}.*") + elseif(check_file_Unspecified_match) + set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") + set(check_file_match_expected_description ".*DESCRIPTION.*") + else() + message(FATAL_ERROR "error: unexpected rpm package '${check_file}'") + endif() + + string(REGEX MATCH ${check_file_match_expected_summary} check_file_match_summary ${check_file_content}) + + if(NOT check_file_match_summary) + message(FATAL_ERROR "error: '${check_file}' rpm package summary does not match expected value - regex '${check_file_match_expected_summary}'") + endif() + + string(REGEX MATCH ${check_file_match_expected_description} check_file_match_description ${check_file_content}) + + if(NOT check_file_match_description) + message(FATAL_ERROR "error: '${check_file}' rpm package description does not match expected value - regex '${check_file_match_expected_description}'") + endif() + endforeach() + elseif(${CPackComponentWay} STREQUAL "IgnoreGroup") + endif() +endif() diff --git a/Tests/DelphiCoverage/DartConfiguration.tcl.in b/Tests/DelphiCoverage/DartConfiguration.tcl.in new file mode 100644 index 0000000..4edcea6 --- /dev/null +++ b/Tests/DelphiCoverage/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/DelphiCoverage +BuildDirectory: ${CMake_BINARY_DIR}/Testing/DelphiCoverage diff --git a/Tests/DelphiCoverage/UTCovTest(UTCovTest.pas).html b/Tests/DelphiCoverage/UTCovTest(UTCovTest.pas).html new file mode 100644 index 0000000..9caaea3 --- /dev/null +++ b/Tests/DelphiCoverage/UTCovTest(UTCovTest.pas).html @@ -0,0 +1,117 @@ +<!DOCTYPE html> +<html> +<head> + <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> + <title>Delphi CodeCoverage Coverage Report</title> +<style type="text/css"> +table {border-spacing:0; border-collapse:collapse;} +table, td, th {border: 1px solid black;} +td, th {background: white; margin: 0; padding: 2px 0.5em 2px 0.5em} +td {border-width: 0 1px 0 0;} +th {border-width: 1px 1px 1px 0;} +p, h1, h2, h3, th {font-family: verdana,arial,sans-serif; font-size: 10pt;} +td {font-family: courier,monospace; font-size: 10pt;} +th {background: #CCCCCC;} +table.o tr td:nth-child(1) {font-weight: bold;} +table.o tr td:nth-child(2) {text-align: right;} +table.o tr td {border-width: 1px;} +table.s {width: 100%;} +table.s tr td {padding: 0 0.25em 0 0.25em;} +table.s tr td:first-child {text-align: right; font-weight: bold;} +table.s tr.notcovered td {background: #DDDDFF;} +table.s tr.nocodegen td {background: #FFFFEE;} +table.s tr.covered td {background: #CCFFCC;} +table.s tr.covered td:first-child {color: green;} +table.s {border-width: 1px 0 1px 1px;} +table.sum tr td {border-width: 1px;} +table.sum tr th {text-align:right;} +table.sum tr th:first-child {text-align:center;} +table.sum tr td {text-align:right;} +table.sum tr td:first-child {text-align:left;} +</style> +</head> +<body> +<p>Coverage report for <strong>UTCovTest (C:\Users\joe.snyder\Work\OSEHRA\VistA\Packages\Order Entry Results Reporting\CPRS\Testing\Tests\UTCovTest.pas)</strong>.</p> +<p> Generated at 10/3/2014 12:24:11 PM by <a href="http://code.google.com/p/delphi-code-coverage/" title="Code Coverage for Delphi 5+">DelphiCodeCoverage</a> - an open source tool for Delphi Code Coverage.</p> +<p> Statistics for C:\Users\joe.snyder\Work\OSEHRA\VistA\Packages\Order Entry Results Reporting\CPRS\Testing\Tests\UTCovTest.pas </p> +<table class="o"><tr><td>Number of lines covered</td><td>19</td></tr><tr><td>Number of lines with code gen</td><td>19</td></tr><tr><td>Line coverage</td><td>100%</td></tr></table> +<br /><br /> +<table class="s"> +<tr class="nocodegen"><td>1</td><td><pre style="display:inline;">//---------------------------------------------------------------------------</pre></td></tr> +<tr class="nocodegen"><td>2</td><td><pre style="display:inline;">// Copyright 2012 The Open Source Electronic Health Record Agent</pre></td></tr> +<tr class="nocodegen"><td>3</td><td><pre style="display:inline;">//</pre></td></tr> +<tr class="nocodegen"><td>4</td><td><pre style="display:inline;">// Licensed under the Apache License, Version 2.0 (the "License");</pre></td></tr> +<tr class="nocodegen"><td>5</td><td><pre style="display:inline;">// you may not use this file except in compliance with the License.</pre></td></tr> +<tr class="nocodegen"><td>6</td><td><pre style="display:inline;">// You may obtain a copy of the License at</pre></td></tr> +<tr class="nocodegen"><td>7</td><td><pre style="display:inline;">//</pre></td></tr> +<tr class="nocodegen"><td>8</td><td><pre style="display:inline;">// http://www.apache.org/licenses/LICENSE-2.0</pre></td></tr> +<tr class="nocodegen"><td>9</td><td><pre style="display:inline;">//</pre></td></tr> +<tr class="nocodegen"><td>10</td><td><pre style="display:inline;">// Unless required by applicable law or agreed to in writing, software</pre></td></tr> +<tr class="nocodegen"><td>11</td><td><pre style="display:inline;">// distributed under the License is distributed on an "AS IS" BASIS,</pre></td></tr> +<tr class="nocodegen"><td>12</td><td><pre style="display:inline;">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</pre></td></tr> +<tr class="nocodegen"><td>13</td><td><pre style="display:inline;">// See the License for the specific language governing permissions and</pre></td></tr> +<tr class="nocodegen"><td>14</td><td><pre style="display:inline;">// limitations under the License.</pre></td></tr> +<tr class="nocodegen"><td>15</td><td><pre style="display:inline;">//---------------------------------------------------------------------------</pre></td></tr> +<tr class="nocodegen"><td>16</td><td><pre style="display:inline;">unit UTCovTest;</pre></td></tr> +<tr class="nocodegen"><td>17</td><td><pre style="display:inline;">interface</pre></td></tr> +<tr class="nocodegen"><td>18</td><td><pre style="display:inline;">uses UnitTest, TestFrameWork,SysUtils,Windows;</pre></td></tr> +<tr class="nocodegen"><td>19</td><td><pre style="display:inline;"></pre></td></tr> +<tr class="nocodegen"><td>20</td><td><pre style="display:inline;">implementation</pre></td></tr> +<tr class="nocodegen"><td>21</td><td><pre style="display:inline;">type</pre></td></tr> +<tr class="nocodegen"><td>22</td><td><pre style="display:inline;">UTCovTestTests=class(TTestCase)</pre></td></tr> +<tr class="nocodegen"><td>23</td><td><pre style="display:inline;"> public</pre></td></tr> +<tr class="nocodegen"><td>24</td><td><pre style="display:inline;"> procedure SetUp; override;</pre></td></tr> +<tr class="nocodegen"><td>25</td><td><pre style="display:inline;"> procedure TearDown; override;</pre></td></tr> +<tr class="nocodegen"><td>26</td><td><pre style="display:inline;"></pre></td></tr> +<tr class="nocodegen"><td>27</td><td><pre style="display:inline;"> published</pre></td></tr> +<tr class="nocodegen"><td>28</td><td><pre style="display:inline;"> procedure TestCov1;</pre></td></tr> +<tr class="nocodegen"><td>29</td><td><pre style="display:inline;"> procedure TestCov2;</pre></td></tr> +<tr class="nocodegen"><td>30</td><td><pre style="display:inline;"> procedure TestCov3;</pre></td></tr> +<tr class="nocodegen"><td>31</td><td><pre style="display:inline;"> end;</pre></td></tr> +<tr class="nocodegen"><td>32</td><td><pre style="display:inline;"></pre></td></tr> +<tr class="nocodegen"><td>33</td><td><pre style="display:inline;">procedure NotRun;</pre></td></tr> +<tr class="nocodegen"><td>34</td><td><pre style="display:inline;">begin</pre></td></tr> +<tr class="nocodegen"><td>35</td><td><pre style="display:inline;"> WriteLn('This line will never run');</pre></td></tr> +<tr class="nocodegen"><td>36</td><td><pre style="display:inline;">end;</pre></td></tr> +<tr class="nocodegen"><td>37</td><td><pre style="display:inline;">procedure UTCovTestTests.SetUp;</pre></td></tr> +<tr class="nocodegen"><td>38</td><td><pre style="display:inline;">begin</pre></td></tr> +<tr class="covered"><td>39</td><td><pre style="display:inline;">end;</pre></td></tr> +<tr class="nocodegen"><td>40</td><td><pre style="display:inline;"></pre></td></tr> +<tr class="nocodegen"><td>41</td><td><pre style="display:inline;">procedure UTCovTestTests.TearDown;</pre></td></tr> +<tr class="nocodegen"><td>42</td><td><pre style="display:inline;">begin</pre></td></tr> +<tr class="covered"><td>43</td><td><pre style="display:inline;">end;</pre></td></tr> +<tr class="nocodegen"><td>44</td><td><pre style="display:inline;"></pre></td></tr> +<tr class="nocodegen"><td>45</td><td><pre style="display:inline;">procedure UTCovTestTests.TestCov1;</pre></td></tr> +<tr class="covered"><td>46</td><td><pre style="display:inline;">begin</pre></td></tr> +<tr class="nocodegen"><td>47</td><td><pre style="display:inline;"> {</pre></td></tr> +<tr class="nocodegen"><td>48</td><td><pre style="display:inline;"> Block comment lines</pre></td></tr> +<tr class="nocodegen"><td>49</td><td><pre style="display:inline;"> }</pre></td></tr> +<tr class="covered"><td>50</td><td><pre style="display:inline;"> CheckEquals(1,2-1);</pre></td></tr> +<tr class="covered"><td>51</td><td><pre style="display:inline;">end;</pre></td></tr> +<tr class="nocodegen"><td>52</td><td><pre style="display:inline;"></pre></td></tr> +<tr class="nocodegen"><td>53</td><td><pre style="display:inline;">procedure UTCovTestTests.TestCov2;</pre></td></tr> +<tr class="nocodegen"><td>54</td><td><pre style="display:inline;">var</pre></td></tr> +<tr class="nocodegen"><td>55</td><td><pre style="display:inline;"> i:DWORD;</pre></td></tr> +<tr class="covered"><td>56</td><td><pre style="display:inline;">begin</pre></td></tr> +<tr class="covered"><td>57</td><td><pre style="display:inline;"> for i := 0 to 1 do</pre></td></tr> +<tr class="covered"><td>58</td><td><pre style="display:inline;"> WriteLn( IntToStr(i));</pre></td></tr> +<tr class="nocodegen"><td>59</td><td><pre style="display:inline;"> // Comment</pre></td></tr> +<tr class="covered"><td>60</td><td><pre style="display:inline;"> CheckEquals(i,2);</pre></td></tr> +<tr class="covered"><td>61</td><td><pre style="display:inline;">end;</pre></td></tr> +<tr class="nocodegen"><td>62</td><td><pre style="display:inline;"></pre></td></tr> +<tr class="nocodegen"><td>63</td><td><pre style="display:inline;">procedure UTCovTestTests.TestCov3;</pre></td></tr> +<tr class="nocodegen"><td>64</td><td><pre style="display:inline;">var</pre></td></tr> +<tr class="nocodegen"><td>65</td><td><pre style="display:inline;"> i : DWORD;</pre></td></tr> +<tr class="covered"><td>66</td><td><pre style="display:inline;">begin</pre></td></tr> +<tr class="covered"><td>67</td><td><pre style="display:inline;"> i := 0;</pre></td></tr> +<tr class="covered"><td>68</td><td><pre style="display:inline;"> while i < 5 do</pre></td></tr> +<tr class="covered"><td>69</td><td><pre style="display:inline;"> i := i+1;</pre></td></tr> +<tr class="covered"><td>70</td><td><pre style="display:inline;"> CheckEquals(i,5);</pre></td></tr> +<tr class="covered"><td>71</td><td><pre style="display:inline;">end;</pre></td></tr> +<tr class="nocodegen"><td>72</td><td><pre style="display:inline;"></pre></td></tr> +<tr class="covered"><td>73</td><td><pre style="display:inline;">begin</pre></td></tr> +<tr class="covered"><td>74</td><td><pre style="display:inline;"> UnitTest.addSuite(UTCovTestTests.Suite);</pre></td></tr> +<tr class="covered"><td>75</td><td><pre style="display:inline;">end.</pre></td></tr> +</table> +</body> +</html> diff --git a/Tests/DelphiCoverage/src/UTCovTest.pas b/Tests/DelphiCoverage/src/UTCovTest.pas new file mode 100644 index 0000000..66db3c0 --- /dev/null +++ b/Tests/DelphiCoverage/src/UTCovTest.pas @@ -0,0 +1,75 @@ +//--------------------------------------------------------------------------- +// Copyright 2012 The Open Source Electronic Health Record Agent +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//--------------------------------------------------------------------------- +unit UTCovTest; +interface +uses UnitTest, TestFrameWork,SysUtils,Windows; + +implementation +type +UTCovTestTests=class(TTestCase) + public + procedure SetUp; override; + procedure TearDown; override; + + published + procedure TestCov1; + procedure TestCov2; + procedure TestCov3; + end; + +procedure NotRun; +begin + WriteLn('This line will never run'); +end; +procedure UTCovTestTests.SetUp; +begin +end; + +procedure UTCovTestTests.TearDown; +begin +end; + +procedure UTCovTestTests.TestCov1; +begin + { + Block comment lines + } + CheckEquals(1,2-1); +end; + +procedure UTCovTestTests.TestCov2; +var + i:DWORD; +begin + for i := 0 to 1 do + WriteLn( IntToStr(i)); + // Comment + CheckEquals(i,2); +end; + +procedure UTCovTestTests.TestCov3; +var + i : DWORD; +begin + i := 0; + while i < 5 do + i := i+1; + CheckEquals(i,5); +end; + +begin + UnitTest.addSuite(UTCovTestTests.Suite); +end.
\ No newline at end of file diff --git a/Tests/ForceInclude/CMakeLists.txt b/Tests/ForceInclude/CMakeLists.txt index 5c02ebb..e231054 100644 --- a/Tests/ForceInclude/CMakeLists.txt +++ b/Tests/ForceInclude/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8.3.20110103) project(ForceInclude C) # Make sure the proper compiler is in use. -if(NOT MSVC AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") +if(NOT MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Intel") message(FATAL_ERROR "The ForceInclude test works only with MSVC or Intel") endif() diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index 1982a60..8700c94 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -13,11 +13,11 @@ message("CMAKE_Fortran_COMPILER = ${CMAKE_Fortran_COMPILER}") message("CMAKE_Fortran_FLAGS = ${CMAKE_Fortran_FLAGS}") set(_SHARED SHARED) -if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "^(XL|VisualAge)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(XL|VisualAge)$") # We do not implement SHARED Fortran libs on AIX yet! # Workaround: Set LINKER_LANGUAGE to C, which uses 'xlc' and Fortran implicits. set(_SHARED STATIC) -elseif("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU") +elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") # g77 2.96 does not support shared libs on Itanium because g2c is not -fPIC execute_process(COMMAND ${CMAKE_Fortran_COMPILER} --version OUTPUT_VARIABLE output ERROR_VARIABLE output) @@ -29,10 +29,10 @@ endif() # Pick a module .def file with the properly mangled symbol name. set(world_def "") if(WIN32 AND NOT CYGWIN) - if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") + if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") set(world_def world_gnu.def) - elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel" OR - "${CMAKE_GENERATOR}" MATCHES "Visual Studio") # Intel plugin + elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel" OR + CMAKE_GENERATOR MATCHES "Visual Studio") # Intel plugin set(world_def world_icl.def) endif() endif() @@ -119,7 +119,7 @@ endfunction() # call the test_fortran_c_interface_module function if("${CMAKE_Fortran_COMPILER_ID}:${CMAKE_C_COMPILER_ID}" MATCHES "(Intel:MSVC|Absoft:GNU)" - OR ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "${CMAKE_C_COMPILER_ID}" )) + OR (CMAKE_Fortran_COMPILER_ID MATCHES CMAKE_C_COMPILER_ID )) test_fortran_c_interface_module() else() message("Fortran does not match c compiler") @@ -128,7 +128,7 @@ else() # hack to make g77 work after CL has been enabled # as a languge, cmake needs language specific versions # of these variables.... - if(WIN32 AND "${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") + if(WIN32 AND CMAKE_Fortran_COMPILER_ID MATCHES "GNU") set(CMAKE_CREATE_CONSOLE_EXE ) set(CMAKE_LIBRARY_PATH_FLAG "-L") set(CMAKE_LINK_LIBRARY_FLAG "-l") @@ -137,8 +137,8 @@ else() # gnu and sunpro do not use the same flags here... # however if LDFLAGS is used to set -m64 it causes odd stuf # with the fortran build - if( ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") - AND ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "SunPro")) + if( (CMAKE_C_COMPILER_ID MATCHES "GNU") + AND (CMAKE_Fortran_COMPILER_ID MATCHES "SunPro")) set(CMAKE_EXE_LINKER_FLAGS "") set(CMAKE_Fortran_FLAGS "") endif() diff --git a/Tests/FortranC/CMakeLists.txt b/Tests/FortranC/CMakeLists.txt index f335583..79c670d 100644 --- a/Tests/FortranC/CMakeLists.txt +++ b/Tests/FortranC/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8) project(FortranC C Fortran) # Skip this test for compilers not known to be compatible. -if(NOT ("${CMAKE_C_COMPILER_ID}" STREQUAL "${CMAKE_Fortran_COMPILER_ID}" OR +if(NOT (CMAKE_C_COMPILER_ID STREQUAL CMAKE_Fortran_COMPILER_ID OR "${CMAKE_C_COMPILER_ID}-${CMAKE_Fortran_COMPILER_ID}" MATCHES "^(MSVC-Intel)$")) message(STATUS "${CMAKE_C_COMPILER_ID} C and ${CMAKE_Fortran_COMPILER_ID} Fortran not known to be compatible!") return() diff --git a/Tests/LinkStatic/CMakeLists.txt b/Tests/LinkStatic/CMakeLists.txt index 2062c43..200d4e5 100644 --- a/Tests/LinkStatic/CMakeLists.txt +++ b/Tests/LinkStatic/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.8.4.20110303 FATAL_ERROR) project(LinkStatic C) -if(NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU)$") +if(NOT CMAKE_C_COMPILER_ID STREQUAL "GNU") message(FATAL_ERROR "This test works only with the GNU compiler!") endif() diff --git a/Tests/ModuleDefinition/CMakeLists.txt b/Tests/ModuleDefinition/CMakeLists.txt index a30f643..bfbb343 100644 --- a/Tests/ModuleDefinition/CMakeLists.txt +++ b/Tests/ModuleDefinition/CMakeLists.txt @@ -13,7 +13,7 @@ add_custom_command(OUTPUT example_dll_gen.def add_library(example_dll_gen SHARED example_dll_gen.c example_dll_gen.def) # Test /DEF:<file> flag recognition for VS. -if(MSVC OR "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") +if(MSVC OR CMAKE_C_COMPILER_ID STREQUAL "Intel") add_library(example_dll_2 SHARED example_dll_2.c) set_property(TARGET example_dll_2 PROPERTY LINK_FLAGS /DEF:"${ModuleDefinition_SOURCE_DIR}/example_dll_2.def") diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt index 90af600..180f9fe 100644 --- a/Tests/PDBDirectoryAndName/CMakeLists.txt +++ b/Tests/PDBDirectoryAndName/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8) project(PDBDirectoryAndName C) # Make sure the proper compiler is in use. -if(NOT MSVC AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") +if(NOT MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Intel") message(FATAL_ERROR "The PDBDirectoryAndName test works only with MSVC or Intel") endif() diff --git a/Tests/PrecompiledHeader/CMakeLists.txt b/Tests/PrecompiledHeader/CMakeLists.txt index 6958131..98bdd88 100644 --- a/Tests/PrecompiledHeader/CMakeLists.txt +++ b/Tests/PrecompiledHeader/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.6) project(PrecompiledHeader C) # Make sure the proper compiler is in use. -if(NOT MSVC AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") +if(NOT MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Intel") message(FATAL_ERROR "The PrecompiledHeader test works only with MSVC or Intel") endif() diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt index cdfdcc1..8ff0cfd 100644 --- a/Tests/Preprocess/CMakeLists.txt +++ b/Tests/Preprocess/CMakeLists.txt @@ -114,7 +114,7 @@ endif() set(EXPR_OP1 "/") if((NOT MSVC OR PP_NMAKE) AND - NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") + NOT CMAKE_C_COMPILER_ID STREQUAL "Intel") # MSVC cl, Intel icl: % # When the cl compiler is invoked from the command line then % must # be written %% (to distinguish from %ENV% syntax). However cl does diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt index a4d9490..e497503 100644 --- a/Tests/TryCompile/CMakeLists.txt +++ b/Tests/TryCompile/CMakeLists.txt @@ -265,7 +265,7 @@ TEST_FAIL(CXX_RUN_SHOULD_FAIL "CHECK_CXX_SOURCE_RUNS() succeeded, but should hav TEST_ASSERT(CXX_RUN_SHOULD_WORK "CHECK_CXX_SOURCE_RUNS() failed") foreach(lang C CXX) - if(NOT "${CMAKE_${lang}_COMPILER_ID}" MATCHES "^(PathScale)$") + if(NOT CMAKE_${lang}_COMPILER_ID STREQUAL "PathScale") set(${lang}_DD --) endif() endforeach() @@ -280,7 +280,7 @@ include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG(${CXX_DD}-_this_is_not_a_flag_ CXX_BOGUS_FLAG) TEST_FAIL(CXX_BOGUS_FLAG "CHECK_CXX_COMPILER_FLAG() succeeded, but should have failed") -if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") +if(CMAKE_C_COMPILER_ID STREQUAL "GNU") unset(C_STRICT_PROTOTYPES CACHE) CHECK_C_COMPILER_FLAG("-Werror;-Wstrict-prototypes" C_STRICT_PROTOTYPES) TEST_ASSERT(C_STRICT_PROTOTYPES "CHECK_C_COMPILER_FLAG failed -Werror -Wstrict-prototypes") |