File: RunCMakeTest.cmake

package info (click to toggle)
cmake 4.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 152,336 kB
  • sloc: ansic: 403,896; cpp: 303,920; sh: 4,105; python: 3,583; yacc: 3,106; lex: 1,279; f90: 538; asm: 471; lisp: 375; cs: 270; java: 266; fortran: 239; objc: 215; perl: 213; xml: 198; makefile: 111; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22
file content (173 lines) | stat: -rw-r--r-- 5,639 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
include(RunCMake)

run_cmake(CMP0074-WARN)
run_cmake(CMP0074-OLD)
run_cmake(ComponentRecursion)
run_cmake(ComponentRequiredAndOptional)
run_cmake(ConfigureLog)
# Two tests because the stderr regex otherwise takes way too long to load.
run_cmake(ConfigureLogParameters1)
run_cmake(ConfigureLogParameters2)
run_cmake(ConfigureLogTransitionsConfig) # with `CONFIG`
run_cmake(ConfigureLogTransitionsConfigSuppressed)
run_cmake(ConfigureLogTransitionsConfig2) # without `CONFIG`, finding config
run_cmake(ConfigureLogTransitionsConfig2Suppressed)
run_cmake(ConfigureLogTransitionsModule) # with `MODULE`
run_cmake(ConfigureLogTransitionsModule2) # without `MODULE`, finding module
run_cmake(ConfigureLogTransitionsModule2Suppressed)
run_cmake(EmptyRoots)
run_cmake(FromPATHEnv)
run_cmake_with_options(FromPATHEnvDebugPkg --debug-find-pkg=Resolved)
run_cmake(FromPrefixPath)
run_cmake(GlobalImportTarget)
run_cmake(MissingNormal)
run_cmake(MissingNormalForceRequired)
run_cmake(MissingNormalRequired)
run_cmake(MissingNormalVersion)
run_cmake(MissingNormalWarnNoModuleOld)
run_cmake(MissingNormalWarnNoModuleNew)
run_cmake(MissingModule)
run_cmake(MissingModuleRequired)
run_cmake(MissingConfig)
run_cmake(MissingConfigDebug)
run_cmake_with_options(MissingConfigDebugPkg --debug-find-pkg=NotHere)
run_cmake(MissingConfigOneName)
run_cmake(MissingConfigRequired)
run_cmake(MissingConfigVersion)
run_cmake(MixedModeOptions)
run_cmake_with_options(ModuleModeDebugPkg --debug-find-pkg=Foo,Zot)
run_cmake(PackageRoot)
run_cmake(PackageRootNestedConfig)
run_cmake(PackageRootNestedModule)
run_cmake(PackageRootRelative)
run_cmake(PackageVarOverridesOptional)
run_cmake(PolicyPush)
run_cmake(PolicyPop)
run_cmake(RequiredOptionValuesClash)
run_cmake(RequiredOptionalKeywordsClash)
run_cmake(RequiredVarOptional)
run_cmake(RequiredVarNested)
run_cmake(FindRootPathAndPrefixPathAreEqual)
run_cmake(SetFoundFALSE)
run_cmake(UnwindIncludeBlock)
run_cmake(UnwindIncludeFunction)
run_cmake(UnwindIncludeInvalidContext)
run_cmake(UnwindIncludeInvalidFindPackage)
run_cmake(UnwindIncludeInvalidInclude)
run_cmake(UnwindIncludeNoUnwind)
run_cmake(UnwindIncludeOnly)
run_cmake(UnwindIncludeSecondary)
run_cmake(WrongVersion)
run_cmake(WrongVersionConfig)
run_cmake(CMP0084-OLD)
run_cmake(CMP0084-WARN)
run_cmake(CMP0084-NEW)
run_cmake(CMP0145-OLD)
run_cmake(CMP0145-WARN)
run_cmake(CMP0145-NEW)
run_cmake(CMP0146-OLD)
run_cmake(CMP0146-WARN)
run_cmake(CMP0146-NEW)
if(RunCMake_GENERATOR MATCHES "Visual Studio")
  run_cmake(CMP0147-OLD)
  run_cmake(CMP0147-WARN)
  run_cmake(CMP0147-NEW)
endif()
run_cmake(CMP0148-Interp-OLD)
run_cmake(CMP0148-Interp-WARN)
run_cmake(CMP0148-Interp-NEW)
run_cmake(CMP0148-Libs-OLD)
run_cmake(CMP0148-Libs-WARN)
run_cmake(CMP0148-Libs-NEW)
run_cmake(CMP0167-OLD)
run_cmake(CMP0167-WARN)
run_cmake(CMP0167-NEW)
run_cmake(CMP0188-OLD)
run_cmake(CMP0188-WARN)
run_cmake(CMP0188-NEW)
run_cmake(CMP0191-OLD)
run_cmake(CMP0191-WARN)
run_cmake(CMP0191-NEW)
run_cmake(WrongVersionRange)
run_cmake(EmptyVersionRange)
run_cmake(VersionRangeWithEXACT)
run_cmake(VersionRange)
run_cmake(VersionRange2)
run_cmake(VersionRange3)
run_cmake(VersionRange4)
run_cmake(VersionRangeConfig)
run_cmake(VersionRangeConfig2)
run_cmake(VersionRangeConfig02)
run_cmake(VersionRangeConfigStd)
run_cmake(VersionRangeConfigStd2)
run_cmake_with_options(IgnoreInstallPrefix  "-DCMAKE_INSTALL_PREFIX=${RunCMake_SOURCE_DIR}/PackageRoot/foo/cmake_root")
run_cmake(IgnorePath)
run_cmake(IgnorePrefixPath)
run_cmake(REGISTRY_VIEW-no-view)
run_cmake(REGISTRY_VIEW-wrong-view)
run_cmake(REGISTRY_VIEW-propagated)
run_cmake(DebugRoot)
run_cmake(ParentVariable)

if(CMAKE_HOST_WIN32 AND MINGW)
  run_cmake(MSYSTEM_PREFIX)
endif()

if(CMAKE_HOST_WIN32)
  run_cmake(CMP0144-WARN-CaseInsensitive)
  run_cmake(CMP0144-OLD-CaseInsensitive)
  run_cmake(CMP0144-NEW-CaseInsensitive)
else()
  run_cmake(CMP0144-WARN-CaseSensitive)
  run_cmake(CMP0144-WARN-CaseSensitive-Mixed)
  run_cmake(CMP0144-OLD-CaseSensitive)
  run_cmake(CMP0144-NEW-CaseSensitive)
endif()

file(
    GLOB SearchPaths_TEST_CASE_LIST
    LIST_DIRECTORIES TRUE
    "${RunCMake_SOURCE_DIR}/SearchPaths/*"
  )
foreach(TestCasePrefix IN LISTS SearchPaths_TEST_CASE_LIST)
  if(IS_DIRECTORY "${TestCasePrefix}")
    cmake_path(GET TestCasePrefix FILENAME TestSuffix)
    run_cmake_with_options(
      SearchPaths_${TestSuffix}
        "-DSearchPaths_ROOT=${TestCasePrefix}"
        "--debug-find-pkg=SearchPaths"
      )
  endif()
endforeach()

if(UNIX
    AND NOT MSYS # FIXME: This works on CYGWIN but not on MSYS
    )
  run_cmake(SetFoundResolved)
endif()

if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
  # Tests using the Windows registry
  find_program(REG NAMES "reg.exe" NO_CACHE)
  if (REG)
    ## check host architecture
    cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "HKCU" SUBKEYS VIEW 64 ERROR_VARIABLE status)
    if (status STREQUAL "")
      set(ARCH "64bit")
    else()
      set(ARCH "32bit")
    endif()

    # crete some entries in the registry
    cmake_path(CONVERT "${RunCMake_SOURCE_DIR}/registry_host${ARCH}.reg" TO_NATIVE_PATH_LIST registry_data)
    execute_process(COMMAND "${REG}" import "${registry_data}" OUTPUT_QUIET ERROR_QUIET)

    run_cmake_with_options(Registry-query -DARCH=${ARCH})

    # clean-up registry
    execute_process(COMMAND "${REG}" delete "HKCU\\SOFTWARE\\Classes\\CLSID\\CMake-Tests\\find_package" /f OUTPUT_QUIET ERROR_QUIET)
    if (ARCH STREQUAL "64bit")
      execute_process(COMMAND "${REG}" delete "HKCU\\SOFTWARE\\Classes\\WOW6432Node\\CLSID\\CMake-Tests\\find_package" /f OUTPUT_QUIET ERROR_QUIET)
    endif()
  endif()
endif()