-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add file handle leak test Add test to check for leaked file handles when installing a module without properly formatted zip data Signed-off-by: The MathWorks, Inc. <jdicleme@mathworks.com> * Fix -Werror=missing-field-initializers warning Signed-off-by: The MathWorks, Inc. <jdicleme@mathworks.com> * Update OpenFileHandleTest.cpp Signed-off-by: The MathWorks, Inc. <jdicleme@mathworks.com>
- Loading branch information
1 parent
51ad86a
commit 954936f
Showing
5 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
framework/test/bundles/libTestModuleWithEmbeddedZip/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
# This cmake module builds a very specific test module; one with embedded zip data | ||
# that contains NO directories within the zip. This test module is used | ||
# for test cases involving malformed/invalid bundles. | ||
project(TestModuleWithEmbeddedZip) | ||
|
||
set(resource_files | ||
test.xml | ||
) | ||
|
||
set(_srcs foo.cpp) | ||
|
||
add_library(${PROJECT_NAME} ${_srcs}) | ||
|
||
if(CMAKE_CROSSCOMPILING) | ||
# Cross-compiled builds need to use the imported host version of usResourceCompiler | ||
include(${IMPORT_EXECUTABLES}) | ||
set(resource_compiler native-${US_RCC_EXECUTABLE_TARGET}) | ||
else() | ||
set(resource_compiler ${US_RCC_EXECUTABLE}) | ||
if(TARGET ${US_RCC_EXECUTABLE_TARGET}) | ||
set(resource_compiler ${US_RCC_EXECUTABLE_TARGET}) | ||
elseif(NOT resource_compiler) | ||
message(FATAL_ERROR "The CppMicroServices resource compiler was not found. Check the US_RCC_EXECUTABLE CMake variable.") | ||
endif() | ||
endif() | ||
|
||
add_custom_command( | ||
TARGET ${PROJECT_NAME} | ||
POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E tar "cf" "${CMAKE_CURRENT_BINARY_DIR}/data.zip" --format=zip -- ${resource_files} | ||
COMMAND ${resource_compiler} -V -b $<TARGET_FILE:${PROJECT_NAME}> -z ${CMAKE_CURRENT_BINARY_DIR}/data.zip | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
DEPENDS ${resource_compiler} | ||
COMMENT "Embedding zip file into ${PROJECT_NAME}" | ||
VERBATIM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
class foo final { | ||
~foo() = default; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<foo id="bar">hi</foo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters