[GitHub] [celix] pnoltes commented on a diff in pull request #473: Add basic error injector mechanism.

2023-01-31 Thread via GitHub


pnoltes commented on code in PR #473:
URL: https://github.com/apache/celix/pull/473#discussion_r1091981639


##
libs/error_injector/celix_properties/CMakeLists.txt:
##
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+add_library(properties_ei STATIC src/celix_properties_ei.cc)

Review Comment:
   Is there a reason why properties_ei and malloc_ei cannot be part of the 
error_injector library?
   
   I understand that the current error_injector (interface) library provides 
the mechanisme to create error injection for functions, but I think we if we 
use error injection a single linkage setup is a bit user friendly. 
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



[GitHub] [celix] pnoltes commented on a diff in pull request #473: Add basic error injector mechanism.

2023-01-31 Thread via GitHub


pnoltes commented on code in PR #473:
URL: https://github.com/apache/celix/pull/473#discussion_r1091977202


##
libs/error_injector/README.md:
##
@@ -0,0 +1,81 @@
+---
+title: Error Injector
+---
+
+
+
+# Celix Error Injector

Review Comment:
   :+1: for updating the documentation.
   
   Maybe a list can be added for which functions error injection is already 
prepared (`malloc` and `celix_properties_create`)?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



[GitHub] [celix] pnoltes commented on a diff in pull request #473: Add basic error injector mechanism.

2023-01-23 Thread via GitHub


pnoltes commented on code in PR #473:
URL: https://github.com/apache/celix/pull/473#discussion_r1084393570


##
misc/error_injector/CMakeLists.txt:
##
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+add_library(error_injector INTERFACE error_injector.h)

Review Comment:
   nitpick: IMO this library can be subdir of the libs directory and also has 
as name `Celix::error_injector` 



##
misc/error_injector/error_injector.h:
##
@@ -0,0 +1,84 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+ */
+
+#ifndef CELIX_ERROR_INJECTOR_H
+#define CELIX_ERROR_INJECTOR_H

Review Comment:
   nitpick: please rename to celix_error_injector.h and move it to a include 
dir.



##
misc/error_injector/celix_properties/CMakeLists.txt:
##
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+add_library(celix_properties_ei STATIC celix_properties_ei.cpp)

Review Comment:
   nitpick: In Celix most resent C++ sources files use the `cc` extension



##
bundles/pubsub/pubsub_protocol/pubsub_protocol_lib/gtest/CMakeLists.txt:
##
@@ -17,10 +17,16 @@
 
 add_executable(celix_pswp_common_tests src/PS_WP_common_tests.cc)
 target_include_directories(celix_pswp_common_tests PRIVATE 
${CMAKE_CURRENT_SOURCE_DIR}/../src)
-target_link_libraries(celix_pswp_common_tests PRIVATE 
celix_pubsub_protocol_lib GTest::gtest Celix::pubsub_spi GTest::gtest_main 
${CMAKE_DL_LIBS})
-if (NOT ENABLE_ADDRESS_SANITIZER)
-target_compile_definitions(celix_pswp_common_tests PRIVATE 
ENABLE_MALLOC_RETURN_NULL_TESTS)
-endif ()
+target_link_libraries(celix_pswp_common_tests PRIVATE 
celix_pubsub_protocol_lib GTest::gtest Celix::pubsub_spi GTest::gtest_main)
 
 add_test(NAME celix_pswp_common_tests COMMAND celix_pswp_common_tests)
-setup_target_for_coverage(celix_pswp_common_tests SCAN_DIR ..)
\ No newline at end of file
+setup_target_for_coverage(celix_pswp_common_tests SCAN_DIR ..)
+
+if (LINKER_WRAP_SUPPORTED)

Review Comment:
   Nice. Yeah so only if wrap is supported this is used and this includes the 
coverage build.



##
bundles/pubsub/pubsub_protocol/pubsub_protocol_lib/gtest/src/PS_WP_common_ei_tests.cc:
##
@@ -0,0 +1,233 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you 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 applicabl