You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2023/07/20 09:37:21 UTC
[incubator-opendal] branch main updated: test(bindings/c): Implement valgrind check in test and ci (#2653)
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
The following commit(s) were added to refs/heads/main by this push:
new b2a4156c8 test(bindings/c): Implement valgrind check in test and ci (#2653)
b2a4156c8 is described below
commit b2a4156c8b1b09e311c7e70df6d028866bc07852
Author: wildbartty <wi...@users.noreply.github.com>
AuthorDate: Thu Jul 20 19:37:16 2023 +1000
test(bindings/c): Implement valgrind check in test and ci (#2653)
* Add valgrind to cbindings test
* Fix valgrind exit code
---
.github/workflows/bindings_c.yml | 2 +-
bindings/c/Makefile | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/bindings_c.yml b/.github/workflows/bindings_c.yml
index 17b430cbb..faf616ba8 100644
--- a/.github/workflows/bindings_c.yml
+++ b/.github/workflows/bindings_c.yml
@@ -45,7 +45,7 @@ jobs:
- uses: actions/checkout@v3
- name: Install gtest manually
run: |
- sudo apt-get install libgtest-dev
+ sudo apt-get install libgtest-dev valgrind
cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make
diff --git a/bindings/c/Makefile b/bindings/c/Makefile
index 85cb33306..6bc06bb0b 100644
--- a/bindings/c/Makefile
+++ b/bindings/c/Makefile
@@ -25,6 +25,8 @@ LDFLAGS=-L$(RPATH) -Wl,-rpath,$(RPATH)
LIBS=-lopendal_c -lgtest -lpthread
+VALGRIND=valgrind --error-exitcode=1 --leak-check=full --
+
.PHONY: all
all: build test examples
@@ -42,8 +44,8 @@ build:
test:
$(CXX) tests/bdd.cpp -o $(OBJ_DIR)/bdd $(CXXFLAGS) $(LDFLAGS) $(LIBS)
$(CXX) tests/list.cpp -o $(OBJ_DIR)/list $(CXXFLAGS) $(LDFLAGS) $(LIBS)
- $(OBJ_DIR)/bdd
- $(OBJ_DIR)/list
+ $(VALGRIND) $(OBJ_DIR)/bdd
+ $(VALGRIND) $(OBJ_DIR)/list
.PHONY: doc
doc: