From 5b017b017b1dfb6d15c70579246b2ffa9aaea763 Mon Sep 17 00:00:00 2001 From: QC Date: Fri, 29 Aug 2014 00:01:36 +0200 Subject: [PATCH] Add gcov option. --- configure.ac | 9 +++++++++ source/ssh-dialog.c | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 9e1a85f4..2d261341 100644 --- a/configure.ac +++ b/configure.ac @@ -24,6 +24,15 @@ AC_USE_SYSTEM_EXTENSIONS AC_CHECK_HEADERS([i3/ipc.h], [i3_header=yes; break;]) + +dnl --------------------------------------------------------------------- +dnl Enable source code coverage reporting for GCC +dnl --------------------------------------------------------------------- + +AC_ARG_ENABLE(gcov, + [ --enable-gcov Enable source code coverage testing using gcov], + [CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"]) + ## # Check dependencies ## diff --git a/source/ssh-dialog.c b/source/ssh-dialog.c index 133e62ae..4d107123 100644 --- a/source/ssh-dialog.c +++ b/source/ssh-dialog.c @@ -113,7 +113,7 @@ static void delete_ssh ( const char *cmd ) history_remove ( path, cmd ); g_free ( path ); } -static int sort_func ( const void *a, const void *b ) +static int ssh_sort_func ( const void *a, const void *b ) { const char *astr = *( const char * const * ) a; const char *bstr = *( const char * const * ) b; @@ -190,7 +190,7 @@ static char ** get_ssh ( unsigned int *length ) // TODO: check this is still fast enough. (takes 1ms on laptop.) if ( ( *length ) > num_favorites ) { - qsort ( &retv[num_favorites], ( *length ) - num_favorites, sizeof ( char* ), sort_func ); + qsort ( &retv[num_favorites], ( *length ) - num_favorites, sizeof ( char* ), ssh_sort_func ); } g_free ( path ); #ifdef TIMING