-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Corrected segmentation fault in python when an invalid annotation is …
…being used in some function, add two new APIs to introspect a function signature.
- Loading branch information
Showing
7 changed files
with
348 additions
and
7 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
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
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
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
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,147 @@ | ||
# Check if this loader is enabled | ||
if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_PY) | ||
return() | ||
endif() | ||
|
||
# | ||
# Executable name and options | ||
# | ||
|
||
# Target name | ||
set(target metacall-python-fail-test) | ||
message(STATUS "Test ${target}") | ||
|
||
# | ||
# Compiler warnings | ||
# | ||
|
||
include(Warnings) | ||
|
||
# | ||
# Compiler security | ||
# | ||
|
||
include(SecurityFlags) | ||
|
||
# | ||
# Sources | ||
# | ||
|
||
set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}") | ||
set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") | ||
|
||
set(sources | ||
${source_path}/main.cpp | ||
${source_path}/metacall_python_fail_test.cpp | ||
) | ||
|
||
# Group source files | ||
set(header_group "Header Files (API)") | ||
set(source_group "Source Files") | ||
source_group_by_path(${include_path} "\\\\.h$|\\\\.hpp$" | ||
${header_group} ${headers}) | ||
source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" | ||
${source_group} ${sources}) | ||
|
||
# | ||
# Create executable | ||
# | ||
|
||
# Build executable | ||
add_executable(${target} | ||
${sources} | ||
) | ||
|
||
# Create namespaced alias | ||
add_executable(${META_PROJECT_NAME}::${target} ALIAS ${target}) | ||
|
||
# | ||
# Project options | ||
# | ||
|
||
set_target_properties(${target} | ||
PROPERTIES | ||
${DEFAULT_PROJECT_OPTIONS} | ||
FOLDER "${IDE_FOLDER}" | ||
) | ||
|
||
# | ||
# Include directories | ||
# | ||
|
||
target_include_directories(${target} | ||
PRIVATE | ||
${DEFAULT_INCLUDE_DIRECTORIES} | ||
${PROJECT_BINARY_DIR}/source/include | ||
) | ||
|
||
# | ||
# Libraries | ||
# | ||
|
||
target_link_libraries(${target} | ||
PRIVATE | ||
${DEFAULT_LIBRARIES} | ||
|
||
GTest | ||
|
||
${META_PROJECT_NAME}::metacall_distributable | ||
) | ||
|
||
# | ||
# Compile definitions | ||
# | ||
|
||
target_compile_definitions(${target} | ||
PRIVATE | ||
${DEFAULT_COMPILE_DEFINITIONS} | ||
) | ||
|
||
# | ||
# Compile options | ||
# | ||
|
||
target_compile_options(${target} | ||
PRIVATE | ||
${DEFAULT_COMPILE_OPTIONS} | ||
) | ||
|
||
# | ||
# Linker options | ||
# | ||
|
||
target_link_libraries(${target} | ||
PRIVATE | ||
${DEFAULT_LINKER_OPTIONS} | ||
) | ||
|
||
# | ||
# Define test | ||
# | ||
|
||
add_test(NAME ${target} | ||
COMMAND $<TARGET_FILE:${target}> | ||
) | ||
|
||
# | ||
# Define dependencies | ||
# | ||
|
||
add_dependencies(${target} | ||
py_loader | ||
) | ||
|
||
# | ||
# Define test properties | ||
# | ||
|
||
set_property(TEST ${target} | ||
PROPERTY LABELS ${target} | ||
) | ||
|
||
include(TestEnvironmentVariables) | ||
|
||
test_environment_variables(${target} | ||
"" | ||
${TESTS_ENVIRONMENT_VARIABLES} | ||
) |
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,28 @@ | ||
/* | ||
* MetaCall Library by Parra Studios | ||
* A library for providing a foreign function interface calls. | ||
* | ||
* Copyright (C) 2016 - 2021 Vicente Eduardo Ferrer Garcia <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
#include <gmock/gmock.h> | ||
|
||
int main(int argc, char * argv[]) | ||
{ | ||
::testing::InitGoogleMock(&argc, argv); | ||
|
||
return RUN_ALL_TESTS(); | ||
} |
Oops, something went wrong.