Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add vg script to help testing with valgrind

  • Loading branch information...
commit 8d655ac71b7320d89a90f74fe2d9e62a19094639 1 parent b6c3c38
@sorc1 sorc1 authored
Showing with 12 additions and 1 deletion.
  1. +5 −1 GNUmakefile
  2. +7 −0 vg
View
6 GNUmakefile
@@ -13,6 +13,7 @@ SHARED_OBJ := $(SOURCE:$(SOURCE_DIR)/%.c=$(OUTPUT_DIR)/%.So)
PROG_SRC := $(wildcard *.c)
PROGRAMS := $(PROG_SRC:%.c=$(OUTPUT_DIR)/%)
+VG := $(OUTPUT_DIR)/vg
LIB := dict
STATIC_LIB_NAME := lib$(LIB).a
@@ -39,7 +40,7 @@ INSTALL_SHLIB = $(SHARED_LIB_NAME).$(INSTALL_LIBVER)
INSTALL_USER ?= 0
INSTALL_GROUP ?= 0
-all: $(OUTPUT_DIR) $(STATIC_LIB) $(SHARED_LIB) $(PROGRAMS)
+all: $(OUTPUT_DIR) $(STATIC_LIB) $(SHARED_LIB) $(PROGRAMS) $(VG)
$(OUTPUT_DIR):
[ -d $(OUTPUT_DIR) ] || mkdir -m 755 $(OUTPUT_DIR)
@@ -68,6 +69,9 @@ $(OUTPUT_DIR)/unit_tests: unit_tests.c $(STATIC_LIB) GNUmakefile
$(OUTPUT_DIR)/%: %.c $(STATIC_LIB) GNUmakefile
$(CC) $(CFLAGS) -o $(@) $(<) $(STATIC_LIB) $(LDFLAGS)
+$(VG): vg
+ cp vg $(VG)
+
.PHONY: clean
clean:
if test -d $(OUTPUT_DIR); then rm -r $(OUTPUT_DIR); fi
View
7 vg
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+valgrind --tool=memcheck --trace-children=yes \
+ --track-fds=yes --num-callers=32 \
+ --memcheck:leak-check=yes --memcheck:leak-resolution=high \
+ --show-reachable=yes \
+ "$@" 2>&1 | tee vg.log
Please sign in to comment.
Something went wrong with that request. Please try again.