-
Notifications
You must be signed in to change notification settings - Fork 749
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for generating coverage reports
This change adds autoconf/automake support for building all of mosh with gcov, and generates an lcov html report. This allows seeing which parts ofthe source tree have good test coverage, and which can be shored up. Eventually, it would be good to hook this up to Github Actions to be generated automatically.
- Loading branch information
Showing
19 changed files
with
601 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,13 @@ | |
|
||
AC_PREREQ([2.61]) | ||
AC_INIT([mosh], [1.3.2], [[email protected]]) | ||
AM_INIT_AUTOMAKE([foreign std-options -Wall -Werror]) | ||
AM_INIT_AUTOMAKE([foreign std-options -Wall -Werror -Wno-portability]) | ||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | ||
AC_CONFIG_SRCDIR([src/frontend/mosh-client.cc]) | ||
AC_CONFIG_MACRO_DIR([m4]) | ||
AC_CONFIG_HEADERS([src/include/config.h]) | ||
AC_LANG([C++]) | ||
AX_CODE_COVERAGE | ||
|
||
# Checks for programs. | ||
AC_PROG_CC([cc gcc clang]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# =========================================================================== | ||
# https://www.gnu.org/software/autoconf-archive/ax_ac_append_to_file.html | ||
# =========================================================================== | ||
# | ||
# SYNOPSIS | ||
# | ||
# AX_AC_APPEND_TO_FILE([FILE],[DATA]) | ||
# | ||
# DESCRIPTION | ||
# | ||
# Appends the specified data to the specified Autoconf is run. If you want | ||
# to append to a file when configure is run use AX_APPEND_TO_FILE instead. | ||
# | ||
# LICENSE | ||
# | ||
# Copyright (c) 2009 Allan Caffee <[email protected]> | ||
# | ||
# Copying and distribution of this file, with or without modification, are | ||
# permitted in any medium without royalty provided the copyright notice | ||
# and this notice are preserved. This file is offered as-is, without any | ||
# warranty. | ||
|
||
#serial 10 | ||
|
||
AC_DEFUN([AX_AC_APPEND_TO_FILE],[ | ||
AC_REQUIRE([AX_FILE_ESCAPES]) | ||
m4_esyscmd( | ||
AX_FILE_ESCAPES | ||
[ | ||
printf "%s" "$2" >> "$1" | ||
]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# =========================================================================== | ||
# https://www.gnu.org/software/autoconf-archive/ax_ac_print_to_file.html | ||
# =========================================================================== | ||
# | ||
# SYNOPSIS | ||
# | ||
# AX_AC_PRINT_TO_FILE([FILE],[DATA]) | ||
# | ||
# DESCRIPTION | ||
# | ||
# Writes the specified data to the specified file when Autoconf is run. If | ||
# you want to print to a file when configure is run use AX_PRINT_TO_FILE | ||
# instead. | ||
# | ||
# LICENSE | ||
# | ||
# Copyright (c) 2009 Allan Caffee <[email protected]> | ||
# | ||
# Copying and distribution of this file, with or without modification, are | ||
# permitted in any medium without royalty provided the copyright notice | ||
# and this notice are preserved. This file is offered as-is, without any | ||
# warranty. | ||
|
||
#serial 10 | ||
|
||
AC_DEFUN([AX_AC_PRINT_TO_FILE],[ | ||
m4_esyscmd( | ||
AC_REQUIRE([AX_FILE_ESCAPES]) | ||
[ | ||
printf "%s" "$2" > "$1" | ||
]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# =========================================================================== | ||
# https://www.gnu.org/software/autoconf-archive/ax_add_am_macro_static.html | ||
# =========================================================================== | ||
# | ||
# SYNOPSIS | ||
# | ||
# AX_ADD_AM_MACRO_STATIC([RULE]) | ||
# | ||
# DESCRIPTION | ||
# | ||
# Adds the specified rule to $AMINCLUDE. | ||
# | ||
# LICENSE | ||
# | ||
# Copyright (c) 2009 Tom Howard <[email protected]> | ||
# Copyright (c) 2009 Allan Caffee <[email protected]> | ||
# | ||
# Copying and distribution of this file, with or without modification, are | ||
# permitted in any medium without royalty provided the copyright notice | ||
# and this notice are preserved. This file is offered as-is, without any | ||
# warranty. | ||
|
||
#serial 8 | ||
|
||
AC_DEFUN([AX_ADD_AM_MACRO_STATIC],[ | ||
AC_REQUIRE([AX_AM_MACROS_STATIC]) | ||
AX_AC_APPEND_TO_FILE(AMINCLUDE_STATIC,[$1]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# =========================================================================== | ||
# https://www.gnu.org/software/autoconf-archive/ax_am_macros_static.html | ||
# =========================================================================== | ||
# | ||
# SYNOPSIS | ||
# | ||
# AX_AM_MACROS_STATIC | ||
# | ||
# DESCRIPTION | ||
# | ||
# Adds support for macros that create Automake rules. You must manually | ||
# add the following line | ||
# | ||
# include $(top_srcdir)/aminclude_static.am | ||
# | ||
# to your Makefile.am files. | ||
# | ||
# LICENSE | ||
# | ||
# Copyright (c) 2009 Tom Howard <[email protected]> | ||
# Copyright (c) 2009 Allan Caffee <[email protected]> | ||
# | ||
# Copying and distribution of this file, with or without modification, are | ||
# permitted in any medium without royalty provided the copyright notice | ||
# and this notice are preserved. This file is offered as-is, without any | ||
# warranty. | ||
|
||
#serial 11 | ||
|
||
AC_DEFUN([AMINCLUDE_STATIC],[aminclude_static.am]) | ||
|
||
AC_DEFUN([AX_AM_MACROS_STATIC], | ||
[ | ||
AX_AC_PRINT_TO_FILE(AMINCLUDE_STATIC,[ | ||
# ]AMINCLUDE_STATIC[ generated automatically by Autoconf | ||
# from AX_AM_MACROS_STATIC on ]m4_esyscmd([LC_ALL=C date])[ | ||
]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# =========================================================================== | ||
# https://www.gnu.org/software/autoconf-archive/ax_check_gnu_make.html | ||
# =========================================================================== | ||
# | ||
# SYNOPSIS | ||
# | ||
# AX_CHECK_GNU_MAKE([run-if-true],[run-if-false]) | ||
# | ||
# DESCRIPTION | ||
# | ||
# This macro searches for a GNU version of make. If a match is found: | ||
# | ||
# * The makefile variable `ifGNUmake' is set to the empty string, otherwise | ||
# it is set to "#". This is useful for including a special features in a | ||
# Makefile, which cannot be handled by other versions of make. | ||
# * The makefile variable `ifnGNUmake' is set to #, otherwise | ||
# it is set to the empty string. This is useful for including a special | ||
# features in a Makefile, which can be handled | ||
# by other versions of make or to specify else like clause. | ||
# * The variable `_cv_gnu_make_command` is set to the command to invoke | ||
# GNU make if it exists, the empty string otherwise. | ||
# * The variable `ax_cv_gnu_make_command` is set to the command to invoke | ||
# GNU make by copying `_cv_gnu_make_command`, otherwise it is unset. | ||
# * If GNU Make is found, its version is extracted from the output of | ||
# `make --version` as the last field of a record of space-separated | ||
# columns and saved into the variable `ax_check_gnu_make_version`. | ||
# * Additionally if GNU Make is found, run shell code run-if-true | ||
# else run shell code run-if-false. | ||
# | ||
# Here is an example of its use: | ||
# | ||
# Makefile.in might contain: | ||
# | ||
# # A failsafe way of putting a dependency rule into a makefile | ||
# $(DEPEND): | ||
# $(CC) -MM $(srcdir)/*.c > $(DEPEND) | ||
# | ||
# @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND))) | ||
# @ifGNUmake@ include $(DEPEND) | ||
# @ifGNUmake@ else | ||
# fallback code | ||
# @ifGNUmake@ endif | ||
# | ||
# Then configure.in would normally contain: | ||
# | ||
# AX_CHECK_GNU_MAKE() | ||
# AC_OUTPUT(Makefile) | ||
# | ||
# Then perhaps to cause gnu make to override any other make, we could do | ||
# something like this (note that GNU make always looks for GNUmakefile | ||
# first): | ||
# | ||
# if ! test x$_cv_gnu_make_command = x ; then | ||
# mv Makefile GNUmakefile | ||
# echo .DEFAULT: > Makefile ; | ||
# echo \ $_cv_gnu_make_command \$@ >> Makefile; | ||
# fi | ||
# | ||
# Then, if any (well almost any) other make is called, and GNU make also | ||
# exists, then the other make wraps the GNU make. | ||
# | ||
# LICENSE | ||
# | ||
# Copyright (c) 2008 John Darrington <[email protected]> | ||
# Copyright (c) 2015 Enrico M. Crisostomo <[email protected]> | ||
# | ||
# Copying and distribution of this file, with or without modification, are | ||
# permitted in any medium without royalty provided the copyright notice | ||
# and this notice are preserved. This file is offered as-is, without any | ||
# warranty. | ||
|
||
#serial 12 | ||
|
||
AC_DEFUN([AX_CHECK_GNU_MAKE],dnl | ||
[AC_PROG_AWK | ||
AC_CACHE_CHECK([for GNU make],[_cv_gnu_make_command],[dnl | ||
_cv_gnu_make_command="" ; | ||
dnl Search all the common names for GNU make | ||
for a in "$MAKE" make gmake gnumake ; do | ||
if test -z "$a" ; then continue ; fi ; | ||
if "$a" --version 2> /dev/null | grep GNU 2>&1 > /dev/null ; then | ||
_cv_gnu_make_command=$a ; | ||
AX_CHECK_GNU_MAKE_HEADLINE=$("$a" --version 2> /dev/null | grep "GNU Make") | ||
ax_check_gnu_make_version=$(echo ${AX_CHECK_GNU_MAKE_HEADLINE} | ${AWK} -F " " '{ print $(NF); }') | ||
break ; | ||
fi | ||
done ;]) | ||
dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise | ||
AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifGNUmake], ["#"])], [AS_VAR_SET([ifGNUmake], [""])]) | ||
AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifnGNUmake], [""])], [AS_VAR_SET([ifnGNUmake], ["#"])]) | ||
AS_VAR_IF([_cv_gnu_make_command], [""], [AS_UNSET(ax_cv_gnu_make_command)], [AS_VAR_SET([ax_cv_gnu_make_command], [${_cv_gnu_make_command}])]) | ||
AS_VAR_IF([_cv_gnu_make_command], [""],[$2],[$1]) | ||
AC_SUBST([ifGNUmake]) | ||
AC_SUBST([ifnGNUmake]) | ||
]) |
Oops, something went wrong.