From 1e391bda7e0ccf136a0c6b2d776c8f8a284cc30d Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sat, 27 Apr 2019 11:58:29 -0400 Subject: [PATCH] CMake: document intention to run more tests on modules - Loading the module will check Python modules for syntax, and C++ modules for symbols. This would be a good idea, except for where it calls exec() and does things to the running system. Most modules are harmless with an empty config, but you never know (e.g. a process module). --- CMakeModules/CalamaresAddModuleSubdirectory.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeModules/CalamaresAddModuleSubdirectory.cmake b/CMakeModules/CalamaresAddModuleSubdirectory.cmake index 2e0a80723..7c0159ac0 100644 --- a/CMakeModules/CalamaresAddModuleSubdirectory.cmake +++ b/CMakeModules/CalamaresAddModuleSubdirectory.cmake @@ -148,4 +148,16 @@ function( calamares_add_module_subdirectory ) math( EXPR _count "${_count} + 1" ) endforeach() endif() + + # Check that the module can be loaded. Since this calls exec(), the module + # may try to do things to the running system. Needs work to make that a + # safe thing to do. + # + # if ( BUILD_TESTING ) + # add_test( + # NAME load-${SUBDIRECTORY} + # COMMAND loadmodule ${SUBDIRECTORY} + # WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + # ) + # endif() endfunction()