summaryrefslogtreecommitdiffstats
path: root/Tests/FindPython/IronPython3
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-06-30 13:32:29 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-06-30 13:32:45 (GMT)
commit3efd70550816f3808a16e0dce24ce947442cafe9 (patch)
treeb1268e9bb4c3ad8d8257da6d2808f904eca20346 /Tests/FindPython/IronPython3
parentd04f9a84f0842f6957e75f1743beb29c3ae28be8 (diff)
parent97b3a2ac17b0c28b27ff0a238b3466f610483d02 (diff)
downloadCMake-3efd70550816f3808a16e0dce24ce947442cafe9.zip
CMake-3efd70550816f3808a16e0dce24ce947442cafe9.tar.gz
CMake-3efd70550816f3808a16e0dce24ce947442cafe9.tar.bz2
Merge topic 'FindPython-enhance-tests'
97b3a2ac17 FindPython: Add labels Python2 and/or Python3 on tests 9b45210b05 FindPython: Add tests for IronPython v3 Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8603
Diffstat (limited to 'Tests/FindPython/IronPython3')
-rw-r--r--Tests/FindPython/IronPython3/CMakeLists.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/Tests/FindPython/IronPython3/CMakeLists.txt b/Tests/FindPython/IronPython3/CMakeLists.txt
new file mode 100644
index 0000000..b09097a
--- /dev/null
+++ b/Tests/FindPython/IronPython3/CMakeLists.txt
@@ -0,0 +1,31 @@
+cmake_minimum_required(VERSION 3.5)
+
+project(TestIronPython3 LANGUAGES NONE)
+
+set (Python3_FIND_IMPLEMENTATIONS "IronPython")
+
+find_package(Python3 COMPONENTS Interpreter Compiler)
+if (NOT Python3_FOUND)
+ message (FATAL_ERROR "Failed to find Python 3")
+endif()
+
+if (NOT Python3_Interpreter_FOUND)
+ message (FATAL_ERROR "Failed to find Python 3 Interpreter")
+endif()
+if (NOT Python3_INTERPRETER_ID STREQUAL "IronPython")
+ message (FATAL_ERROR "Erroneous interpreter ID (${Python3_INTERPRETER_ID})")
+endif()
+
+if (NOT Python3_Compiler_FOUND)
+ message (FATAL_ERROR "Failed to find Python 3 Compiler")
+endif()
+if (NOT Python3_COMPILER_ID STREQUAL "IronPython")
+ message (FATAL_ERROR "Erroneous compiler ID (${Python3_COMPILER_ID})")
+endif()
+
+if(NOT TARGET Python3::Interpreter)
+ message(SEND_ERROR "Python3::Interpreter not found")
+endif()
+if(NOT TARGET Python3::Compiler)
+ message(SEND_ERROR "Python3::Compiler not found")
+endif()