From 28dd63884ba6baefdb291a431beeb1b09ab4e092 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 28 Jul 2022 17:22:14 -0400 Subject: [PATCH] COMP: Re-introduce extension descriptions CMake tests This commit partially reverts 38f53510c (BUG: Remove failing extensions manager tests) re-introducing the following tests inadvertently removed: * cmake_slicer_extension_description_spec_defaults_test * cmake_slicer_extension_metadata_set_defaults_test * cmake_slicer_extract_extension_description_test * cmake_slicer_generate_extension_description_test --- CMakeLists.txt | 1 + Extensions/CMake/Testing/CMakeLists.txt | 32 ++++++++++++++ .../extension_description_with_depends.s4ext | 44 +++++++++++++++++++ ...xtension_description_without_depends.s4ext | 44 +++++++++++++++++++ 4 files changed, 121 insertions(+) create mode 100644 Extensions/CMake/Testing/CMakeLists.txt create mode 100644 Extensions/CMake/Testing/extension_description_with_depends.s4ext create mode 100644 Extensions/CMake/Testing/extension_description_without_depends.s4ext diff --git a/CMakeLists.txt b/CMakeLists.txt index dfcdb2d502d..ce666addd4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -816,6 +816,7 @@ if(BUILD_TESTING) COPYONLY) add_subdirectory(CMake/Testing) + add_subdirectory(Extensions/CMake/Testing) if(Slicer_BUILD_CLI_SUPPORT) set(SEM_LAUNCH_COMMAND ${Slicer_LAUNCH_COMMAND}) diff --git a/Extensions/CMake/Testing/CMakeLists.txt b/Extensions/CMake/Testing/CMakeLists.txt new file mode 100644 index 00000000000..8ccf2e7c6f6 --- /dev/null +++ b/Extensions/CMake/Testing/CMakeLists.txt @@ -0,0 +1,32 @@ + +# +# Helper macro +# +macro(add_cmakescript_test testname script) + add_test(cmake_${testname} ${CMAKE_COMMAND} + -DTEST_${testname}:BOOL=ON + -P ${CMAKE_SOURCE_DIR}/${script}) + set_tests_properties(cmake_${testname} PROPERTIES + LABELS CMake + PASS_REGULAR_EXPRESSION "SUCCESS") +endmacro() + +# +# Add 'CMake script' Tests +# + +add_cmakescript_test( + slicer_extension_description_spec_defaults_test + Extensions/CMake/SlicerExtensionDescriptionSpec.cmake) + +add_cmakescript_test( + slicer_extension_metadata_set_defaults_test + Extensions/CMake/SlicerExtensionDescriptionSpec.cmake) + +add_cmakescript_test( + slicer_extract_extension_description_test + Extensions/CMake/SlicerFunctionExtractExtensionDescription.cmake) + +add_cmakescript_test( + slicer_generate_extension_description_test + Extensions/CMake/SlicerFunctionGenerateExtensionDescription.cmake) diff --git a/Extensions/CMake/Testing/extension_description_with_depends.s4ext b/Extensions/CMake/Testing/extension_description_with_depends.s4ext new file mode 100644 index 00000000000..4dbb1f1350d --- /dev/null +++ b/Extensions/CMake/Testing/extension_description_with_depends.s4ext @@ -0,0 +1,44 @@ +# +# First token of each non-comment line is the keyword and the rest of the line +# (including spaces) is the value. +# - the value can be blank +# + +# This is source code manager +scm git +scmurl https://github.com/jcfr/SlicerToKiwiExporter.git +scmrevision 9d7341e978df954a2c875240290833d7528ef29c + +# list dependencies +# - These should be names of other modules that have .s4ext files +# - The dependencies will be built first +depends Foo Bar + +# Inner build directory (default is ".") +build_subdirectory inner/inner-inner-build + +# homepage +homepage https://www.slicer.org/w/index.php/Documentation/Nightly/Extensions/SlicerToKiwiExporter + +# Firstname1 Lastname1 ([SubOrg1, ]Org1), Firstname2 Lastname2 ([SubOrg2, ]Org2) +# For example: Jane Roe (Superware), John Doe (Lab1, Nowhere), Joe Bloggs (Noware) +contributors Jean-Christophe Fillion-Robin (Kitware), Pat Marion (Kitware), Steve Pieper (Isomics), Atsushi Yamada (Shiga University of Medical Science) + +# Match category in the xml description of the module (where it shows up in Modules menu) +category Exporter + +# url to icon (png, size 128x128 pixels) +iconurl https://www.slicer.org/w/images/6/64/SlicerToKiwiExporterLogo.png + +# Give people an idea what to expect from this code +# - Is it just a test or something you stand behind? +status Development + +# One line stating what the module does +description The SlicerToKiwiExporter module provides Slicer user with any easy way to export models into a KiwiViewer scene file. + +# Space separated list of urls +screenshoturls https://www.slicer.org/w/images/9/9e/SlicerToKiwiExporter_Kiwiviewer_8.PNG https://www.slicer.org/w/images/a/ab/SlicerToKiwiExporter_Kiwiviewer_9.PNG https://www.slicer.org/w/images/9/9a/SlicerToKiwiExporter_SaveDialog_Select-file-format_1.png + +# 0 or 1: Define if the extension should be enabled after its installation. +enabled 0 diff --git a/Extensions/CMake/Testing/extension_description_without_depends.s4ext b/Extensions/CMake/Testing/extension_description_without_depends.s4ext new file mode 100644 index 00000000000..2c21828d27e --- /dev/null +++ b/Extensions/CMake/Testing/extension_description_without_depends.s4ext @@ -0,0 +1,44 @@ +# +# First token of each non-comment line is the keyword and the rest of the line +# (including spaces) is the value. +# - the value can be blank +# + +# This is source code manager +scm git +scmurl https://github.com/jcfr/SlicerToKiwiExporter.git +scmrevision 9d7341e978df954a2c875240290833d7528ef29c + +# list dependencies +# - These should be names of other modules that have .s4ext files +# - The dependencies will be built first +depends NA + +# Inner build directory (default is ".") +build_subdirectory . + +# homepage +homepage https://www.slicer.org/w/index.php/Documentation/Nightly/Extensions/SlicerToKiwiExporter + +# Firstname1 Lastname1 ([SubOrg1, ]Org1), Firstname2 Lastname2 ([SubOrg2, ]Org2) +# For example: Jane Roe (Superware), John Doe (Lab1, Nowhere), Joe Bloggs (Noware) +contributors Jean-Christophe Fillion-Robin (Kitware), Pat Marion (Kitware), Steve Pieper (Isomics), Atsushi Yamada (Shiga University of Medical Science) + +# Match category in the xml description of the module (where it shows up in Modules menu) +category Exporter + +# url to icon (png, size 128x128 pixels) +iconurl https://www.slicer.org/w/images/6/64/SlicerToKiwiExporterLogo.png + +# Give people an idea what to expect from this code +# - Is it just a test or something you stand behind? +status Development + +# One line stating what the module does +description The SlicerToKiwiExporter module provides Slicer user with any easy way to export models into a KiwiViewer scene file. + +# Space separated list of urls +screenshoturls https://www.slicer.org/w/images/9/9e/SlicerToKiwiExporter_Kiwiviewer_8.PNG https://www.slicer.org/w/images/a/ab/SlicerToKiwiExporter_Kiwiviewer_9.PNG https://www.slicer.org/w/images/9/9a/SlicerToKiwiExporter_SaveDialog_Select-file-format_1.png + +# 0 or 1: Define if the extension should be enabled after its installation. +enabled 1