From: alex Date: Sun, 4 Oct 2020 08:48:55 +0000 (-0700) Subject: build/automake upgrade X-Git-Tag: v1.0.0~5 X-Git-Url: http://git.infiniteadaptability.org/?a=commitdiff_plain;h=f1677c30158dddde2b8cfc105a40e6fd63b1854f;p=workouts build/automake upgrade added integrated valgrind/memcheck functionality to automake fixed logic in configure.ac for enabling/disabled memcheck fixed const qualifier warning in server.c removed to do's from README.md --- diff --git a/Dockerfile b/Dockerfile index c2563cd..a131cd2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,9 +30,6 @@ COPY --from=core /workouts-${VERSION}/ /build/ RUN ./configure RUN make check -WORKDIR /build/test/unit -RUN make memcheck - FROM node:latest as integration-tester ARG VERSION diff --git a/README.md b/README.md index 5432d12..bb83090 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,2 @@ ### Workout Management Tool -Tool for managing and keeping track of workouts. - -### To Do: -- [ ] workouts rm [!name] [!date] -- [ ] update date of recent workout from cli - - [ ] rm then add -- [ ] make attributes customizable - - [ ] modify workout.js -- [ ] add delete functionality -- [ ] add attribute add functionality to gui -- [ ] workouts rm attr [!name] -- [ ] rename workouts functionality - -### Later -- [ ] add --format option to ls commands -- [ ] bash completion \ No newline at end of file +Tool for managing and keeping track of workouts. \ No newline at end of file diff --git a/configure.ac b/configure.ac index 08b83fa..d09f69c 100644 --- a/configure.ac +++ b/configure.ac @@ -53,8 +53,8 @@ fi AM_CONDITIONAL([ENABLE_GUI],[test x$enable_gui = xyes]) dnl disable memcheck if valgrind not found -if test "x$enable_memcheck" != "xyes"; then - if test -n "$HAVE_VALGRIND"; then +if test "x$enable_memcheck" != "xno"; then + if test -z "$VALGRIND"; then enable_memcheck=no fi fi diff --git a/server/server.c b/server/server.c index eba2b4f..ec03bfc 100644 --- a/server/server.c +++ b/server/server.c @@ -175,7 +175,7 @@ int body(char *buf, int buf_len, char **body_p) { void passthru(int sock, char *p,int len) { char buffer[4096]; char *argv[10] = {NULL}; - const char filename[] = "workouts"; + char filename[] = "workouts"; char *home = getenv("HOME"); strcpy(buffer,"HOME="); diff --git a/test/unit/Makefile.am b/test/unit/Makefile.am index 9786277..53bfe83 100644 --- a/test/unit/Makefile.am +++ b/test/unit/Makefile.am @@ -13,6 +13,11 @@ EXTRA_DIST = \ check_PROGRAMS = attr.tests recent.tests workout.tests TESTS = $(check_PROGRAMS) +if ENABLE_MEMCHECK +LOG_COMPILER = $(VALGRIND) +AM_LOG_FLAGS = --leak-check=full -v +endif + common_SOURCES = test_utils.c TEST_SRC_DIR = $(top_srcdir)/src @@ -21,16 +26,21 @@ common_SOURCES += $(TEST_SRC_DIR)/default.c $(TEST_SRC_DIR)/opt.c common_SOURCES += $(TEST_SRC_DIR)/data/setup.c common_SOURCES += $(TEST_SRC_DIR)/opt/homedir.c $(TEST_SRC_DIR)/opt/rows.c $(TEST_SRC_DIR)/opt/verbose.c -attr_tests_SOURCES = attr.tests.c $(TEST_SRC_DIR)/data/attr.c $(common_SOURCES) -recent_tests_SOURCES = recent.tests.c $(TEST_SRC_DIR)/data/recent.c $(TEST_SRC_DIR)/data/workout.c $(TEST_SRC_DIR)/data/attr.c $(common_SOURCES) -workout_tests_SOURCES = workout.tests.c $(TEST_SRC_DIR)/data/workout.c $(TEST_SRC_DIR)/data/attr.c $(TEST_SRC_DIR)/data/recent.c $(common_SOURCES) +attr_tests_SOURCES = \ + $(common_SOURCES) \ + attr.tests.c \ + $(TEST_SRC_DIR)/data/attr.c -if ENABLE_MEMCHECK -memcheck: - -valgrind --leak-check=full ./attr.tests - -valgrind --leak-check=full ./recent.tests - -valgrind --leak-check=full ./workout.tests -else -memcheck: - @echo "memcheck not enabled" -endif \ No newline at end of file +recent_tests_SOURCES = \ + $(common_SOURCES) \ + recent.tests.c \ + $(TEST_SRC_DIR)/data/recent.c \ + $(TEST_SRC_DIR)/data/workout.c \ + $(TEST_SRC_DIR)/data/attr.c + +workout_tests_SOURCES = \ + $(common_SOURCES) \ + workout.tests.c \ + $(TEST_SRC_DIR)/data/workout.c \ + $(TEST_SRC_DIR)/data/attr.c \ + $(TEST_SRC_DIR)/data/recent.c \ No newline at end of file