Skip to content

Commit

Permalink
build common library for binary and tests...
Browse files Browse the repository at this point in the history
Implemented valgrind for testing
  • Loading branch information
andy5995 committed May 31, 2021
1 parent 101201c commit c9f924c
Show file tree
Hide file tree
Showing 18 changed files with 1,260 additions and 633 deletions.
24 changes: 22 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ matrix:
- ubuntu-toolchain-r-test
packages:
- g++-9
env: MATRIX_EVAL="CC=gcc-9 && CXX=g++-9"
- valgrind
env:
- MATRIX_EVAL="CC=gcc-9 && CXX=g++-9"
- USE_VALGRIND="true"
- os: linux
dist: bionic
compiler: gcc
Expand All @@ -55,6 +58,19 @@ matrix:
packages:
- g++-10
env: MATRIX_EVAL="CC=gcc-10 && CXX=g++-10"
- os: linux
dist: bionic
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-11
- valgrind
env:
- MATRIX_EVAL="CC=gcc-11 && CXX=g++-11"
- USE_VALGRIND="true"

# clang
- os: linux
Expand Down Expand Up @@ -99,12 +115,16 @@ before_install:
sudo apt-get install -y $CC;
fi;
fi
- if [ -n "${USE_VALGRIND}" ]; then
CONFIGURE_OPTS="--enable-valgrind";
fi
- export CONFIGURE_OPTS

script:
- if [ -n "$COVERITY_SCAN_TOKEN" ]; then
exit 0;
fi
- ./configure
- ./configure ${CONFIGURE_OPTS}
- if [ -z "$CHECK" ]; then
make check;
else
Expand Down
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
modemu2k ChangeLog

2021-05-30

* Implemented valgrind using the autoconf macro for use with 'make
check'

2020-06-21

* 'm2k-minicom.sh' script renamed to 'm2k-minicom'
Expand Down
47 changes: 46 additions & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/build-aux/m4/ax_append_flag.m4 \
$(top_srcdir)/build-aux/m4/ax_cflags_warn_all.m4 \
$(top_srcdir)/build-aux/m4/ax_check_compile_flag.m4 \
$(top_srcdir)/build-aux/m4/ax_check_enable_debug.m4 \
$(top_srcdir)/build-aux/m4/ax_is_release.m4 \
$(top_srcdir)/build-aux/m4/ax_require_defined.m4 \
$(top_srcdir)/build-aux/m4/ax_valgrind_check.m4 \
$(top_srcdir)/build-aux/m4/gettext.m4 \
$(top_srcdir)/build-aux/m4/iconv.m4 \
$(top_srcdir)/build-aux/m4/intlmacosx.m4 \
Expand Down Expand Up @@ -181,6 +183,10 @@ am__recursive_targets = \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir distdir-am dist dist-all distcheck
am__extra_recursive_targets = check-valgrind-recursive \
check-valgrind-memcheck-recursive \
check-valgrind-helgrind-recursive check-valgrind-drd-recursive \
check-valgrind-sgcheck-recursive
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)config.in
# Read a list of newline-separated strings from the standard input,
Expand Down Expand Up @@ -273,7 +279,12 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@
ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@
ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@
ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@
EXEEXT = @EXEEXT@
EXTRA_CFLAGS = @EXTRA_CFLAGS@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
Expand Down Expand Up @@ -318,6 +329,8 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
USE_NLS = @USE_NLS@
VALGRIND = @VALGRIND@
VALGRIND_ENABLED = @VALGRIND_ENABLED@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
Expand Down Expand Up @@ -372,6 +385,8 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
valgrind_enabled_tools = @valgrind_enabled_tools@
valgrind_tools = @valgrind_tools@
SUBDIRS = src man tests scripts po
packextrasdir = @docdir@
EXTRA_DIST = \
Expand Down Expand Up @@ -478,6 +493,11 @@ $(am__recursive_targets):
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
check-valgrind-local:
check-valgrind-memcheck-local:
check-valgrind-helgrind-local:
check-valgrind-drd-local:
check-valgrind-sgcheck-local:

ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
Expand Down Expand Up @@ -780,6 +800,26 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
check-valgrind: check-valgrind-recursive

check-valgrind-am: check-valgrind-local

check-valgrind-drd: check-valgrind-drd-recursive

check-valgrind-drd-am: check-valgrind-drd-local

check-valgrind-helgrind: check-valgrind-helgrind-recursive

check-valgrind-helgrind-am: check-valgrind-helgrind-local

check-valgrind-memcheck: check-valgrind-memcheck-recursive

check-valgrind-memcheck-am: check-valgrind-memcheck-local

check-valgrind-sgcheck: check-valgrind-sgcheck-recursive

check-valgrind-sgcheck-am: check-valgrind-sgcheck-local

clean: clean-recursive

clean-am: clean-generic mostlyclean-am
Expand Down Expand Up @@ -852,7 +892,12 @@ uninstall-am: uninstall-packextrasDATA
.MAKE: $(am__recursive_targets) install-am install-strip

.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
am--refresh check check-am check-valgrind-am \
check-valgrind-drd-am check-valgrind-drd-local \
check-valgrind-helgrind-am check-valgrind-helgrind-local \
check-valgrind-local check-valgrind-memcheck-am \
check-valgrind-memcheck-local check-valgrind-sgcheck-am \
check-valgrind-sgcheck-local clean clean-cscope clean-generic \
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
distcheck distclean distclean-generic distclean-tags \
Expand Down
19 changes: 19 additions & 0 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,23 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])

# AM_EXTRA_RECURSIVE_TARGETS -*- Autoconf -*-

# Copyright (C) 2012-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# AM_EXTRA_RECURSIVE_TARGETS
# --------------------------
# Define the list of user recursive targets. This macro exists only to
# be traced by Automake, which will ensure that a proper definition of
# user-defined recursive targets (and associated rules) is propagated
# into all the generated Makefiles.
# TODO: We should really reject non-literal arguments here...
AC_DEFUN([AM_EXTRA_RECURSIVE_TARGETS], [])

# Do all the work for Automake. -*- Autoconf -*-

# Copyright (C) 1996-2018 Free Software Foundation, Inc.
Expand Down Expand Up @@ -951,9 +968,11 @@ AC_SUBST([am__untar])

m4_include([build-aux/m4/ax_append_flag.m4])
m4_include([build-aux/m4/ax_cflags_warn_all.m4])
m4_include([build-aux/m4/ax_check_compile_flag.m4])
m4_include([build-aux/m4/ax_check_enable_debug.m4])
m4_include([build-aux/m4/ax_is_release.m4])
m4_include([build-aux/m4/ax_require_defined.m4])
m4_include([build-aux/m4/ax_valgrind_check.m4])
m4_include([build-aux/m4/gettext.m4])
m4_include([build-aux/m4/iconv.m4])
m4_include([build-aux/m4/intlmacosx.m4])
Expand Down

0 comments on commit c9f924c

Please sign in to comment.