Skip to content

Commit 8e12a46

Browse files
committed
Added a more verbose reporting option for valgrind. Added a global teardown method for the unit tests to call ds3_cleanup()
1 parent e7fb124 commit 8e12a46

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

test/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ CFLAGS+= -DBOOST_TEST_DYN_LINK -lboost_unit_test_framework
2626
all: test
2727

2828
mem: test
29-
$(LIB_PATH) valgrind --leak-check=full --track-origins=yes ./test
29+
$(LIB_PATH) valgrind --leak-check=full --track-origins=yes --show-leak-kinds=all ./test
3030

3131
debug: test
3232
$(LIB_PATH) $(GDB) ./test

test/test.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@
77
#include "test.h"
88
#include <boost/test/unit_test.hpp>
99

10+
struct TestCleanup {
11+
TestCleanup() {
12+
printf("global setup\n");
13+
}
14+
~TestCleanup() {
15+
printf("global teardown\n");
16+
ds3_cleanup();
17+
}
18+
};
19+
20+
BOOST_GLOBAL_FIXTURE( TestCleanup );
21+
1022
ds3_client* get_client() {
1123

1224
ds3_client* client;

0 commit comments

Comments
 (0)