diff --git a/ffi/examples/visit-expression/CMakeLists.txt b/ffi/examples/visit-expression/CMakeLists.txt index c9d24eb48..a30439593 100644 --- a/ffi/examples/visit-expression/CMakeLists.txt +++ b/ffi/examples/visit-expression/CMakeLists.txt @@ -10,8 +10,27 @@ target_compile_options(visit_expression PUBLIC) target_compile_options(visit_expression PRIVATE -Wall -Wextra -Wpedantic -Werror -Wno-strict-prototypes) +# Get info on the OS and platform +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(MACOSX TRUE) +endif() +if(UNIX AND NOT APPLE) + set(LINUX TRUE) +endif() + # Add the kernel expresion -> engine expression test include(CTest) set(ExprTestRunner "../../../tests/test_expression_visitor/run_test.sh") set(ExprExpectedPath "../../../tests/test_expression_visitor/expected.txt") add_test(NAME test_expression_visitor COMMAND ${ExprTestRunner} ${ExprExpectedPath}) + +if(LINUX) + add_test(NAME test_expression_visitor_leaks COMMAND valgrind + --error-exitcode=1 + --tool=memcheck + --leak-check=full + --errors-for-leak-kinds=definite + --show-leak-kinds=definite ./visit_expression) +elseif(MACOSX) + add_test(NAME test_expression_visitor_leaks COMMAND leaks --atExit -- ./visit_expression) +endif() diff --git a/ffi/src/test_ffi.rs b/ffi/src/test_ffi.rs index 440990a02..8aee68a57 100644 --- a/ffi/src/test_ffi.rs +++ b/ffi/src/test_ffi.rs @@ -26,7 +26,7 @@ pub unsafe extern "C" fn get_testing_kernel_expression() -> Handle Handle Handle None, } } - pub fn array(array_type: ArrayType) -> Self { - DataType::Array(Box::new(array_type)) - } } impl Display for DataType {