Bläddra i källkod

Add CMAKE_MAXIMUM_RECURSION_DEPTH environment variable

Extend the recursion limit controls added by commit a6982cff0d
(cmMakefile: Impose maximum recursion limit, 2018-12-14,
v3.14.0-rc1~82^2) with an environment variable that is used if the
CMake variable of the same name is not set.
Brad King 2 år sedan
förälder
incheckning
89b69bf1ad
49 ändrade filer med 366 tillägg och 0 borttagningar
  1. 10 0
      Help/envvar/CMAKE_MAXIMUM_RECURSION_DEPTH.rst
  2. 1 0
      Help/manual/cmake-env-variables.7.rst
  3. 2 0
      Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst
  4. 6 0
      Source/cmMakefile.cxx
  5. 22 0
      Tests/RunCMake/MaxRecursionDepth/RunCMakeTest.cmake
  6. 1 0
      Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-env-result.txt
  7. 34 0
      Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-env-stderr.txt
  8. 1 0
      Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-env-result.txt
  9. 5 0
      Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-env-stderr.txt
  10. 1 0
      Tests/RunCMake/MaxRecursionDepth/find_package-env-result.txt
  11. 1 0
      Tests/RunCMake/MaxRecursionDepth/find_package-env-script-result.txt
  12. 21 0
      Tests/RunCMake/MaxRecursionDepth/find_package-env-script-stderr.txt
  13. 21 0
      Tests/RunCMake/MaxRecursionDepth/find_package-env-stderr.txt
  14. 1 0
      Tests/RunCMake/MaxRecursionDepth/find_package-invalid-env-result.txt
  15. 1 0
      Tests/RunCMake/MaxRecursionDepth/find_package-invalid-env-script-result.txt
  16. 5 0
      Tests/RunCMake/MaxRecursionDepth/find_package-invalid-env-script-stderr.txt
  17. 5 0
      Tests/RunCMake/MaxRecursionDepth/find_package-invalid-env-stderr.txt
  18. 1 0
      Tests/RunCMake/MaxRecursionDepth/function-env-result.txt
  19. 1 0
      Tests/RunCMake/MaxRecursionDepth/function-env-script-result.txt
  20. 21 0
      Tests/RunCMake/MaxRecursionDepth/function-env-script-stderr.txt
  21. 21 0
      Tests/RunCMake/MaxRecursionDepth/function-env-stderr.txt
  22. 1 0
      Tests/RunCMake/MaxRecursionDepth/function-invalid-env-result.txt
  23. 1 0
      Tests/RunCMake/MaxRecursionDepth/function-invalid-env-script-result.txt
  24. 5 0
      Tests/RunCMake/MaxRecursionDepth/function-invalid-env-script-stderr.txt
  25. 5 0
      Tests/RunCMake/MaxRecursionDepth/function-invalid-env-stderr.txt
  26. 1 0
      Tests/RunCMake/MaxRecursionDepth/include-env-result.txt
  27. 1 0
      Tests/RunCMake/MaxRecursionDepth/include-env-script-result.txt
  28. 21 0
      Tests/RunCMake/MaxRecursionDepth/include-env-script-stderr.txt
  29. 21 0
      Tests/RunCMake/MaxRecursionDepth/include-env-stderr.txt
  30. 1 0
      Tests/RunCMake/MaxRecursionDepth/include-invalid-env-result.txt
  31. 1 0
      Tests/RunCMake/MaxRecursionDepth/include-invalid-env-script-result.txt
  32. 5 0
      Tests/RunCMake/MaxRecursionDepth/include-invalid-env-script-stderr.txt
  33. 5 0
      Tests/RunCMake/MaxRecursionDepth/include-invalid-env-stderr.txt
  34. 1 0
      Tests/RunCMake/MaxRecursionDepth/macro-env-result.txt
  35. 1 0
      Tests/RunCMake/MaxRecursionDepth/macro-env-script-result.txt
  36. 21 0
      Tests/RunCMake/MaxRecursionDepth/macro-env-script-stderr.txt
  37. 21 0
      Tests/RunCMake/MaxRecursionDepth/macro-env-stderr.txt
  38. 1 0
      Tests/RunCMake/MaxRecursionDepth/macro-invalid-env-result.txt
  39. 1 0
      Tests/RunCMake/MaxRecursionDepth/macro-invalid-env-script-result.txt
  40. 5 0
      Tests/RunCMake/MaxRecursionDepth/macro-invalid-env-script-stderr.txt
  41. 5 0
      Tests/RunCMake/MaxRecursionDepth/macro-invalid-env-stderr.txt
  42. 1 0
      Tests/RunCMake/MaxRecursionDepth/variable_watch-env-result.txt
  43. 1 0
      Tests/RunCMake/MaxRecursionDepth/variable_watch-env-script-result.txt
  44. 22 0
      Tests/RunCMake/MaxRecursionDepth/variable_watch-env-script-stderr.txt
  45. 22 0
      Tests/RunCMake/MaxRecursionDepth/variable_watch-env-stderr.txt
  46. 1 0
      Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-env-result.txt
  47. 1 0
      Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-env-script-result.txt
  48. 6 0
      Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-env-script-stderr.txt
  49. 6 0
      Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-env-stderr.txt

+ 10 - 0
Help/envvar/CMAKE_MAXIMUM_RECURSION_DEPTH.rst

@@ -0,0 +1,10 @@
+CMAKE_MAXIMUM_RECURSION_DEPTH
+-----------------------------
+
+.. versionadded:: 3.27
+
+.. include:: ENV_VAR.txt
+
+Maximum recursion depth for CMake scripts.  This environment variable is
+used if the :variable:`CMAKE_MAXIMUM_RECURSION_DEPTH` variable is not set.
+See that variable's documentation for details.

+ 1 - 0
Help/manual/cmake-env-variables.7.rst

@@ -20,6 +20,7 @@ Environment Variables that Change Behavior
 .. toctree::
    :maxdepth: 1
 
+   /envvar/CMAKE_MAXIMUM_RECURSION_DEPTH
    /envvar/CMAKE_PREFIX_PATH
    /envvar/SSL_CERT_DIR
    /envvar/SSL_CERT_FILE

+ 2 - 0
Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst

@@ -33,3 +33,5 @@ Calling any of the following commands increases the recursion depth:
   depth)
 * Reading or writing variables that are being watched by a
   :command:`variable_watch`
+
+See also the :envvar:`CMAKE_MAXIMUM_RECURSION_DEPTH` environment variable.

+ 6 - 0
Source/cmMakefile.cxx

@@ -2865,6 +2865,12 @@ size_t cmMakefile::GetRecursionDepthLimit() const
     if (cmStrToULong(depthStr.GetCStr(), &depthUL)) {
       depth = depthUL;
     }
+  } else if (cm::optional<std::string> depthEnv =
+               cmSystemTools::GetEnvVar("CMAKE_MAXIMUM_RECURSION_DEPTH")) {
+    unsigned long depthUL;
+    if (cmStrToULong(*depthEnv, &depthUL)) {
+      depth = depthUL;
+    }
   }
   return depth;
 }

+ 22 - 0
Tests/RunCMake/MaxRecursionDepth/RunCMakeTest.cmake

@@ -1,20 +1,42 @@
 include(RunCMake)
 include(RunCTest)
 
+# Isolate this test from the caller's environment.
+unset(ENV{CMAKE_MAXIMUM_RECURSION_DEPTH})
+
 function(run_cmake_recursive name)
   run_cmake_with_options(${name}-default "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name})
   run_cmake_command(${name}-default-script ${CMAKE_COMMAND} "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -P "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt")
 
+  set(ENV{CMAKE_MAXIMUM_RECURSION_DEPTH} 5) # overridden, not used
   run_cmake_with_options(${name}-var "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
   run_cmake_with_options(${name}-invalid-var "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=a)
   run_cmake_command(${name}-var-script ${CMAKE_COMMAND} "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=10 -P "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt")
   run_cmake_command(${name}-invalid-var-script ${CMAKE_COMMAND} "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=a -P "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt")
+
+  set(ENV{CMAKE_MAXIMUM_RECURSION_DEPTH} 10)
+  run_cmake_with_options(${name}-env "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name})
+  run_cmake_command(${name}-env-script ${CMAKE_COMMAND} "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -P "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt")
+
+  set(ENV{CMAKE_MAXIMUM_RECURSION_DEPTH} a)
+  run_cmake_with_options(${name}-invalid-env "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name})
+  run_cmake_command(${name}-invalid-env-script ${CMAKE_COMMAND} "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -P "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt")
+
+  unset(ENV{CMAKE_MAXIMUM_RECURSION_DEPTH})
 endfunction()
 
 function(run_ctest_recursive name)
   run_ctest(${name}-default "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name})
   run_ctest(${name}-var "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
   run_ctest(${name}-invalid-var "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=a)
+
+  set(ENV{CMAKE_MAXIMUM_RECURSION_DEPTH} 10)
+  run_ctest(${name}-env "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name})
+
+  set(ENV{CMAKE_MAXIMUM_RECURSION_DEPTH} a)
+  run_ctest(${name}-invalid-env "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name})
+
+  unset(ENV{CMAKE_MAXIMUM_RECURSION_DEPTH})
 endfunction()
 
 run_cmake_recursive(function)

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-env-result.txt

@@ -0,0 +1 @@
+(-1|255)

+ 34 - 0
Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-env-stderr.txt

@@ -0,0 +1,34 @@
+^2
+3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:1 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-env/test\.cmake:10 \(ctest_read_custom_files\)
+
+
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake$

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-env-result.txt

@@ -0,0 +1 @@
+(-1|255)

+ 5 - 0
Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-env-stderr.txt

@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:1 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/find_package-env-result.txt

@@ -0,0 +1 @@
+1

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/find_package-env-script-result.txt

@@ -0,0 +1 @@
+1

+ 21 - 0
Tests/RunCMake/MaxRecursionDepth/find_package-env-script-stderr.txt

@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/FindRecursivePackage\.cmake:1 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
+  .*/find_package\.cmake:2 \(find_package\)
+  .*/CMakeLists\.txt:5 \(include\)$

+ 21 - 0
Tests/RunCMake/MaxRecursionDepth/find_package-env-stderr.txt

@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at FindRecursivePackage\.cmake:1 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  FindRecursivePackage\.cmake:3 \(find_package\)
+  FindRecursivePackage\.cmake:3 \(find_package\)
+  FindRecursivePackage\.cmake:3 \(find_package\)
+  FindRecursivePackage\.cmake:3 \(find_package\)
+  FindRecursivePackage\.cmake:3 \(find_package\)
+  FindRecursivePackage\.cmake:3 \(find_package\)
+  FindRecursivePackage\.cmake:3 \(find_package\)
+  FindRecursivePackage\.cmake:3 \(find_package\)
+  find_package\.cmake:2 \(find_package\)
+  CMakeLists\.txt:5 \(include\)$

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/find_package-invalid-env-result.txt

@@ -0,0 +1 @@
+1

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/find_package-invalid-env-script-result.txt

@@ -0,0 +1 @@
+1

+ 5 - 0
Tests/RunCMake/MaxRecursionDepth/find_package-invalid-env-script-stderr.txt

@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/FindRecursivePackage\.cmake:1 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)

+ 5 - 0
Tests/RunCMake/MaxRecursionDepth/find_package-invalid-env-stderr.txt

@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at FindRecursivePackage\.cmake:1 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  FindRecursivePackage\.cmake:3 \(find_package\)

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/function-env-result.txt

@@ -0,0 +1 @@
+1

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/function-env-script-result.txt

@@ -0,0 +1 @@
+1

+ 21 - 0
Tests/RunCMake/MaxRecursionDepth/function-env-script-stderr.txt

@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/function\.cmake:2 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  .*/function\.cmake:4 \(recursive\)
+  .*/function\.cmake:4 \(recursive\)
+  .*/function\.cmake:4 \(recursive\)
+  .*/function\.cmake:4 \(recursive\)
+  .*/function\.cmake:4 \(recursive\)
+  .*/function\.cmake:4 \(recursive\)
+  .*/function\.cmake:4 \(recursive\)
+  .*/function\.cmake:4 \(recursive\)
+  .*/function\.cmake:7 \(recursive\)
+  .*/CMakeLists\.txt:5 \(include\)$

+ 21 - 0
Tests/RunCMake/MaxRecursionDepth/function-env-stderr.txt

@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at function\.cmake:2 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  function\.cmake:4 \(recursive\)
+  function\.cmake:4 \(recursive\)
+  function\.cmake:4 \(recursive\)
+  function\.cmake:4 \(recursive\)
+  function\.cmake:4 \(recursive\)
+  function\.cmake:4 \(recursive\)
+  function\.cmake:4 \(recursive\)
+  function\.cmake:4 \(recursive\)
+  function\.cmake:7 \(recursive\)
+  CMakeLists\.txt:5 \(include\)$

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/function-invalid-env-result.txt

@@ -0,0 +1 @@
+1

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/function-invalid-env-script-result.txt

@@ -0,0 +1 @@
+1

+ 5 - 0
Tests/RunCMake/MaxRecursionDepth/function-invalid-env-script-stderr.txt

@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/function\.cmake:2 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/function\.cmake:4 \(recursive\)

+ 5 - 0
Tests/RunCMake/MaxRecursionDepth/function-invalid-env-stderr.txt

@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at function\.cmake:2 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  function\.cmake:4 \(recursive\)

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/include-env-result.txt

@@ -0,0 +1 @@
+1

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/include-env-script-result.txt

@@ -0,0 +1 @@
+1

+ 21 - 0
Tests/RunCMake/MaxRecursionDepth/include-env-script-stderr.txt

@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/include_recursive\.cmake:1 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  .*/include_recursive\.cmake:3 \(include\)
+  .*/include_recursive\.cmake:3 \(include\)
+  .*/include_recursive\.cmake:3 \(include\)
+  .*/include_recursive\.cmake:3 \(include\)
+  .*/include_recursive\.cmake:3 \(include\)
+  .*/include_recursive\.cmake:3 \(include\)
+  .*/include_recursive\.cmake:3 \(include\)
+  .*/include_recursive\.cmake:3 \(include\)
+  .*/include\.cmake:2 \(include\)
+  .*/CMakeLists\.txt:5 \(include\)$

+ 21 - 0
Tests/RunCMake/MaxRecursionDepth/include-env-stderr.txt

@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at include_recursive\.cmake:1 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  include_recursive\.cmake:3 \(include\)
+  include_recursive\.cmake:3 \(include\)
+  include_recursive\.cmake:3 \(include\)
+  include_recursive\.cmake:3 \(include\)
+  include_recursive\.cmake:3 \(include\)
+  include_recursive\.cmake:3 \(include\)
+  include_recursive\.cmake:3 \(include\)
+  include_recursive\.cmake:3 \(include\)
+  include\.cmake:2 \(include\)
+  CMakeLists\.txt:5 \(include\)$

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/include-invalid-env-result.txt

@@ -0,0 +1 @@
+1

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/include-invalid-env-script-result.txt

@@ -0,0 +1 @@
+1

+ 5 - 0
Tests/RunCMake/MaxRecursionDepth/include-invalid-env-script-stderr.txt

@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/include_recursive\.cmake:1 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/include_recursive\.cmake:3 \(include\)

+ 5 - 0
Tests/RunCMake/MaxRecursionDepth/include-invalid-env-stderr.txt

@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at include_recursive\.cmake:1 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  include_recursive\.cmake:3 \(include\)

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/macro-env-result.txt

@@ -0,0 +1 @@
+1

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/macro-env-script-result.txt

@@ -0,0 +1 @@
+1

+ 21 - 0
Tests/RunCMake/MaxRecursionDepth/macro-env-script-stderr.txt

@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/macro\.cmake:2 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  .*/macro\.cmake:4 \(recursive\)
+  .*/macro\.cmake:4 \(recursive\)
+  .*/macro\.cmake:4 \(recursive\)
+  .*/macro\.cmake:4 \(recursive\)
+  .*/macro\.cmake:4 \(recursive\)
+  .*/macro\.cmake:4 \(recursive\)
+  .*/macro\.cmake:4 \(recursive\)
+  .*/macro\.cmake:4 \(recursive\)
+  .*/macro\.cmake:7 \(recursive\)
+  .*/CMakeLists\.txt:5 \(include\)$

+ 21 - 0
Tests/RunCMake/MaxRecursionDepth/macro-env-stderr.txt

@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at macro\.cmake:2 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  macro\.cmake:4 \(recursive\)
+  macro\.cmake:4 \(recursive\)
+  macro\.cmake:4 \(recursive\)
+  macro\.cmake:4 \(recursive\)
+  macro\.cmake:4 \(recursive\)
+  macro\.cmake:4 \(recursive\)
+  macro\.cmake:4 \(recursive\)
+  macro\.cmake:4 \(recursive\)
+  macro\.cmake:7 \(recursive\)
+  CMakeLists\.txt:5 \(include\)$

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/macro-invalid-env-result.txt

@@ -0,0 +1 @@
+1

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/macro-invalid-env-script-result.txt

@@ -0,0 +1 @@
+1

+ 5 - 0
Tests/RunCMake/MaxRecursionDepth/macro-invalid-env-script-stderr.txt

@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/macro\.cmake:2 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/macro\.cmake:4 \(recursive\)

+ 5 - 0
Tests/RunCMake/MaxRecursionDepth/macro-invalid-env-stderr.txt

@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at macro\.cmake:2 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  macro\.cmake:4 \(recursive\)

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/variable_watch-env-result.txt

@@ -0,0 +1 @@
+1

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/variable_watch-env-script-result.txt

@@ -0,0 +1 @@
+1

+ 22 - 0
Tests/RunCMake/MaxRecursionDepth/variable_watch-env-script-stderr.txt

@@ -0,0 +1,22 @@
+^4
+6
+8
+10
+CMake Error at .*/variable_watch\.cmake:[0-9]+ \(update_x\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  .*/variable_watch\.cmake:5 \(set\)
+  .*/variable_watch\.cmake:[0-9]+ \(update_x\)
+  .*/variable_watch\.cmake:5 \(set\)
+  .*/variable_watch\.cmake:[0-9]+ \(update_x\)
+  .*/variable_watch\.cmake:5 \(set\)
+  .*/variable_watch\.cmake:[0-9]+ \(update_x\)
+  .*/variable_watch\.cmake:5 \(set\)
+  .*/variable_watch\.cmake:[0-9]+ \(update_x\)
+  .*/variable_watch\.cmake:9 \(set\)
+  .*/CMakeLists\.txt:5 \(include\)
+
+
+CMake Error: Error in cmake code at
+Unknown:0:
+A command failed during the invocation of callback "update_x"\.$

+ 22 - 0
Tests/RunCMake/MaxRecursionDepth/variable_watch-env-stderr.txt

@@ -0,0 +1,22 @@
+^4
+6
+8
+10
+CMake Error at variable_watch\.cmake:[0-9]+ \(update_x\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  variable_watch\.cmake:5 \(set\)
+  variable_watch\.cmake:[0-9]+ \(update_x\)
+  variable_watch\.cmake:5 \(set\)
+  variable_watch\.cmake:[0-9]+ \(update_x\)
+  variable_watch\.cmake:5 \(set\)
+  variable_watch\.cmake:[0-9]+ \(update_x\)
+  variable_watch\.cmake:5 \(set\)
+  variable_watch\.cmake:[0-9]+ \(update_x\)
+  variable_watch\.cmake:9 \(set\)
+  CMakeLists\.txt:5 \(include\)
+
+
+CMake Error: Error in cmake code at
+Unknown:0:
+A command failed during the invocation of callback "update_x"\.$

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-env-result.txt

@@ -0,0 +1 @@
+1

+ 1 - 0
Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-env-script-result.txt

@@ -0,0 +1 @@
+1

+ 6 - 0
Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-env-script-stderr.txt

@@ -0,0 +1,6 @@
+[0-9]+
+CMake Error at .*/variable_watch\.cmake:[0-9]+ \(update_x\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/variable_watch\.cmake:5 \(set\)
+  .*/variable_watch\.cmake:[0-9]+ \(update_x\)

+ 6 - 0
Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-env-stderr.txt

@@ -0,0 +1,6 @@
+[0-9]+
+CMake Error at variable_watch\.cmake:[0-9]+ \(update_x\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  variable_watch\.cmake:5 \(set\)
+  variable_watch\.cmake:[0-9]+ \(update_x\)