From ec6dd77053b2c88a7a341ac67184fb605a4fa837 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Thu, 10 Aug 2023 09:30:19 -0400
Subject: Tests: Remove redundant condition in RunCMake.GeneratorPlatform test

---
 .../RunCMake/GeneratorPlatform/RunCMakeTest.cmake  | 44 +++++++++++-----------
 1 file changed, 21 insertions(+), 23 deletions(-)

diff --git a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
index 233eb0a..9718ca9 100644
--- a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
@@ -83,29 +83,27 @@ if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio (1[4567])( 20[0-9][0-9])?$")
     message(FATAL_ERROR "Could not find any Windows SDKs to drive test cases.")
   endif()
 
-  if(kits)
-    foreach(expect_version IN LISTS kits)
-      set(RunCMake_GENERATOR_PLATFORM "version=${expect_version}")
-      set(RunCMake_TEST_VARIANT_DESCRIPTION "-${expect_version}")
-      run_cmake_with_options(VersionExists -DCMAKE_SYSTEM_VERSION=10.0)
-      unset(RunCMake_GENERATOR_PLATFORM)
-    endforeach()
-    foreach(expect_version IN LISTS kits)
-      set(RunCMake_TEST_VARIANT_DESCRIPTION "-CMP0149-OLD-${expect_version}")
-      run_cmake_with_options(VersionExists -DCMAKE_SYSTEM_VERSION=${expect_version} -DCMAKE_POLICY_DEFAULT_CMP0149=OLD)
-    endforeach()
-    if(kits MATCHES "(^|;)([0-9.]+)$")
-      set(expect_version "${CMAKE_MATCH_2}")
-      foreach(test_version IN LISTS kits)
-        set(RunCMake_TEST_VARIANT_DESCRIPTION "-CMP0149-NEW-${test_version}")
-        run_cmake_with_options(VersionExists -DCMAKE_SYSTEM_VERSION=${test_version} -DCMAKE_POLICY_DEFAULT_CMP0149=NEW)
-      endforeach()
-    endif()
-    foreach(expect_version IN LISTS kits)
-      set(RunCMake_TEST_VARIANT_DESCRIPTION "-WindowsSDKVersion-${expect_version}")
-      set(ENV{WindowsSDKVersion} "${expect_version}\\")
-      run_cmake_with_options(VersionExists -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_POLICY_DEFAULT_CMP0149=NEW)
-      unset(ENV{WindowsSDKVersion})
+  foreach(expect_version IN LISTS kits)
+    set(RunCMake_GENERATOR_PLATFORM "version=${expect_version}")
+    set(RunCMake_TEST_VARIANT_DESCRIPTION "-${expect_version}")
+    run_cmake_with_options(VersionExists -DCMAKE_SYSTEM_VERSION=10.0)
+    unset(RunCMake_GENERATOR_PLATFORM)
+  endforeach()
+  foreach(expect_version IN LISTS kits)
+    set(RunCMake_TEST_VARIANT_DESCRIPTION "-CMP0149-OLD-${expect_version}")
+    run_cmake_with_options(VersionExists -DCMAKE_SYSTEM_VERSION=${expect_version} -DCMAKE_POLICY_DEFAULT_CMP0149=OLD)
+  endforeach()
+  if(kits MATCHES "(^|;)([0-9.]+)$")
+    set(expect_version "${CMAKE_MATCH_2}")
+    foreach(test_version IN LISTS kits)
+      set(RunCMake_TEST_VARIANT_DESCRIPTION "-CMP0149-NEW-${test_version}")
+      run_cmake_with_options(VersionExists -DCMAKE_SYSTEM_VERSION=${test_version} -DCMAKE_POLICY_DEFAULT_CMP0149=NEW)
     endforeach()
   endif()
+  foreach(expect_version IN LISTS kits)
+    set(RunCMake_TEST_VARIANT_DESCRIPTION "-WindowsSDKVersion-${expect_version}")
+    set(ENV{WindowsSDKVersion} "${expect_version}\\")
+    run_cmake_with_options(VersionExists -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_POLICY_DEFAULT_CMP0149=NEW)
+    unset(ENV{WindowsSDKVersion})
+  endforeach()
 endif()
-- 
cgit v0.12