From a7f9455d86f13e90558e37adb0cf3553b1c3e933 Mon Sep 17 00:00:00 2001 From: Allan LeSage Date: Tue, 27 Mar 2012 17:17:43 -0500 Subject: Removed gcovr dependency, moved coverage targets to own makefile, cleaning up *.gcno. --- Makefile.am | 36 +----------------------------------- Makefile.am.coverage | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 4 +++- m4/gcov.m4 | 23 +++++++++++++---------- 4 files changed, 65 insertions(+), 46 deletions(-) create mode 100644 Makefile.am.coverage diff --git a/Makefile.am b/Makefile.am index fee212b..224ec45 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,38 +36,4 @@ dist-hook: echo Failed to generate AUTHORS: not a branch >&2; \ fi - -# Coverage targets - -.PHONY: clean-gcda -clean-gcda: - @echo Removing old coverage results - -find -name '*.gcda' -print | xargs -r rm - -.PHONY: coverage-html generate-coverage-html clean-coverage-html -coverage-html: clean-gcda - -$(MAKE) $(AM_MAKEFLAGS) -k check - $(MAKE) $(AM_MAKEFLAGS) generate-coverage-html - -generate-coverage-html: - @echo Collecting coverage data - $(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool - LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info - -clean-coverage-html: clean-gcda - -$(LCOV) --directory $(top_builddir) -z - -rm -rf coverage.info coveragereport - -.PHONY: coverage-xml generate-coverage-xml clean-coverage-xml -coverage-xml: clean-gcda - -$(MAKE) $(AM_MAKEFLAGS) -k check - $(MAKE) $(AM_MAKEFLAGS) generate-coverage-xml - -generate-coverage-xml: - @echo Generating coverage XML report - $(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml - -clean-coverage-xml: clean-gcda - -rm -rf $(top_builddir)/coverage.xml - -clean-local: clean-coverage-html clean-coverage-xml +include $(top_srcdir)/Makefile.am.coverage diff --git a/Makefile.am.coverage b/Makefile.am.coverage new file mode 100644 index 0000000..fb97747 --- /dev/null +++ b/Makefile.am.coverage @@ -0,0 +1,48 @@ + +# Coverage targets + +.PHONY: clean-gcno clean-gcda \ + coverage-html generate-coverage-html clean-coverage-html \ + coverage-gcovr generate-coverage-gcovr clean-coverage-gcovr + +clean-local: clean-gcno clean-coverage-html clean-coverage-gcovr + +if HAVE_GCOV + +clean-gcno: + @echo Removing old coverage instrumentation + -find -name '*.gcno' -print | xargs -r rm + +clean-gcda: + @echo Removing old coverage results + -find -name '*.gcda' -print | xargs -r rm + +coverage-html: clean-gcda + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) generate-coverage-html + +generate-coverage-html: + @echo Collecting coverage data + $(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool + LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info + +clean-coverage-html: clean-gcda + -$(LCOV) --directory $(top_builddir) -z + -rm -rf coverage.info coveragereport + +if HAVE_GCOVR + +coverage-gcovr: clean-gcda + -$(MAKE) $(AM_MAKEFLAGS) -k check + $(MAKE) $(AM_MAKEFLAGS) generate-coverage-gcovr + +generate-coverage-gcovr: + @echo Generating coverage GCOVR report + $(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml + +clean-coverage-gcovr: clean-gcda + -rm -rf $(top_builddir)/coverage.xml + +endif # HAVE_GCOVR + +endif # HAVE_GCOV diff --git a/configure.ac b/configure.ac index 6377b9a..ac19fb7 100644 --- a/configure.ac +++ b/configure.ac @@ -145,8 +145,10 @@ GLIB_GSETTINGS m4_include([m4/gcov.m4]) AC_TDD_GCOV +AM_CONDITIONAL([HAVE_GCOV], [test "x$ac_cv_check_gcov" = xyes]) +AM_CONDITIONAL([HAVE_LCOV], [test "x$ac_cv_check_lcov" = xyes]) +AM_CONDITIONAL([HAVE_GCOVR], [test "x$ac_cv_check_gcovr" = xyes]) AC_SUBST(COVERAGE_CFLAGS) -AC_SUBST(COVERAGE_CXXFLAGS) AC_SUBST(COVERAGE_LDFLAGS) ########################### diff --git a/m4/gcov.m4 b/m4/gcov.m4 index 1169573..3163584 100644 --- a/m4/gcov.m4 +++ b/m4/gcov.m4 @@ -5,11 +5,10 @@ # * gcovr # # Sets ac_cv_check_gcov to yes if tooling is present -# and reports the executables to the variables LCOV, GCOVR and GENHTML. +# and reports the executables to the variables LCOV, GCOVR and GENHTML. AC_DEFUN([AC_TDD_GCOV], -[AC_CACHE_CHECK([whether code coverage tools are available], ac_cv_check_gcov, [ -AC_ARG_ENABLE(gcov, + AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov], [enable coverage testing with gcov]), [use_gcov=$enableval], [use_gcov=no]) @@ -34,7 +33,6 @@ AC_ARG_ENABLE(gcov, lcov_version_list="1.6 1.7 1.8 1.9" AC_CHECK_PROG(LCOV, lcov, lcov) AC_CHECK_PROG(GENHTML, genhtml, genhtml) - AC_CHECK_PROG(GCOVR, gcovr, gcovr) if test "$LCOV"; then AC_CACHE_CHECK([for lcov version], glib_cv_lcov_version, [ @@ -63,10 +61,8 @@ AC_ARG_ENABLE(gcov, AC_MSG_ERROR([Could not find genhtml from the lcov package]) fi - if test -z "$GCOVR"; then - AC_MSG_ERROR([Could not find gcovr; easy_install (or pip) gcovr]) - fi - + ac_cv_check_gcov=yes + ac_cv_check_lcov=yes # Remove all optimization flags from CFLAGS changequote({,}) @@ -78,6 +74,13 @@ AC_ARG_ENABLE(gcov, COVERAGE_CXXFLAGS="-O0 -fprofile-arcs -ftest-coverage" COVERAGE_LDFLAGS="-lgcov" -fi -])]) # AC_TDD_GCOV + # Check availability of gcovr + AC_CHECK_PROG(GCOVR, gcovr, gcovr) + if test -z "$GCOVR"; then + ac_cv_check_gcovr=no + else + ac_cv_check_gcovr=yes + fi +fi +]) # AC_TDD_GCOV -- cgit v1.2.3 From 6bf7c1c7c70915e44f8068ff62e8feffd9a3c279 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 29 Mar 2012 17:36:38 -0700 Subject: clicking the systems settings window shouldn't close the 'Locations' dialog. --- src/datetime-prefs.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/datetime-prefs.c b/src/datetime-prefs.c index fbb8ea1..0e2e99c 100644 --- a/src/datetime-prefs.c +++ b/src/datetime-prefs.c @@ -576,22 +576,15 @@ setup_time_spinners (IndicatorDatetimePanel * self, GtkWidget * time, GtkWidget update_spinners (self); } -static void -hide_locations (IndicatorDatetimePanel * self) -{ - if (self->priv->loc_dlg != NULL) - gtk_widget_destroy (self->priv->loc_dlg); -} - static void show_locations (IndicatorDatetimePanel * self) { if (self->priv->loc_dlg == NULL) { self->priv->loc_dlg = datetime_setup_locations_dialog (self->priv->tzmap); GtkWidget * dlg = gtk_widget_get_toplevel (GTK_WIDGET (self)); + gtk_window_set_type_hint (GTK_WINDOW(self->priv->loc_dlg), GDK_WINDOW_TYPE_HINT_DIALOG); gtk_window_set_transient_for (GTK_WINDOW (self->priv->loc_dlg), GTK_WINDOW (dlg)); g_signal_connect (self->priv->loc_dlg, "destroy", G_CALLBACK (gtk_widget_destroyed), &self->priv->loc_dlg); - g_signal_connect_swapped (dlg, "focus-in-event", G_CALLBACK (hide_locations), self); gtk_widget_show_all (self->priv->loc_dlg); } else { -- cgit v1.2.3 From d89b4e7c18f83eb37e9605d677f7f8d0e3500d3c Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 2 Apr 2012 10:51:06 -0500 Subject: fix timezone sorting issue reported by seb128 and diagnosed by desrt --- src/datetime-service.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/datetime-service.c b/src/datetime-service.c index fb95928..57f6f52 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -108,7 +108,7 @@ struct comp_instance { }; /** - * A temp struct used by update_location_menu_items() for pruning duplicates. + * A temp struct used by update_location_menu_items() for pruning duplicates and sorting. */ struct TimeLocation { @@ -124,14 +124,16 @@ time_location_free (struct TimeLocation * loc) g_free (loc); } static struct TimeLocation* -time_location_new (const char * zone, const char * name) +time_location_new (const char * zone, const char * name, const time_t now) { struct TimeLocation * loc = g_new (struct TimeLocation, 1); GTimeZone * tz = g_time_zone_new (zone); - loc->offset = g_time_zone_get_offset (tz, 0); + gint interval = g_time_zone_find_interval (tz, G_TIME_TYPE_UNIVERSAL, now); + loc->offset = g_time_zone_get_offset (tz, interval); loc->zone = g_strdup (zone); loc->name = g_strdup (name); g_time_zone_unref (tz); + g_debug ("%s zone '%s' name '%s' offset is %d", G_STRLOC, zone, name, (int)loc->offset); return loc; } static int @@ -146,9 +148,9 @@ time_location_compare (const struct TimeLocation * a, const struct TimeLocation return ret; } static GSList* -locations_add (GSList * locations, const char * zone, const char * name) +locations_add (GSList * locations, const char * zone, const char * name, time_t now) { - struct TimeLocation * loc = time_location_new (zone, name); + struct TimeLocation * loc = time_location_new (zone, name, now); if (g_slist_find_custom (locations, loc, (GCompareFunc)time_location_compare) == NULL) { g_debug ("%s Adding zone '%s', name '%s'", G_STRLOC, zone, name); @@ -182,18 +184,19 @@ update_location_menu_items (void) ***/ GSList * locations = NULL; + const time_t now = time(NULL); /* maybe add geo_timezone */ if (geo_timezone != NULL) { gchar * name = get_current_zone_name (geo_timezone); - locations = locations_add (locations, geo_timezone, name); + locations = locations_add (locations, geo_timezone, name, now); g_free (name); } /* maybe add current_timezone */ if (current_timezone != NULL) { gchar * name = get_current_zone_name (current_timezone); - locations = locations_add (locations, current_timezone, name); + locations = locations_add (locations, current_timezone, name, now); g_free (name); } @@ -207,7 +210,7 @@ update_location_menu_items (void) gchar * zone; gchar * name; split_settings_location (user_locations[i], &zone, &name); - locations = locations_add (locations, zone, name); + locations = locations_add (locations, zone, name, now); g_free (name); g_free (zone); } -- cgit v1.2.3 From 5a12bc3c3f41d17934c0773c2214ac6097a9154f Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 4 Apr 2012 16:06:51 -0500 Subject: 0.3.94 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 4bd3f6c..508fc9a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_INIT([indicator-datetime], - [0.3.93], + [0.3.94], [http://bugs.launchpad.net/indicator-datetime], [indicator-datetime], [http://launchpad.net/indicator-datetime]) -- cgit v1.2.3 From dd5e09950a514831fe7e9620bf32c9cab4e0be26 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 4 Apr 2012 16:53:30 -0500 Subject: releasing version 0.3.94-0ubuntu1~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2e8de1b..e3e56c5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -indicator-datetime (0.3.94-0ubuntu1~ppa1) UNRELEASED; urgency=low +indicator-datetime (0.3.94-0ubuntu1~ppa1) precise; urgency=low * New upstream release. * Fix location timezone sorting issue. @@ -6,7 +6,7 @@ indicator-datetime (0.3.94-0ubuntu1~ppa1) UNRELEASED; urgency=low Locations dialog. (LP: #947315) * Add gcov targets to autotools build for code-coverage reporting. - -- Charles Kerr Wed, 04 Apr 2012 16:23:11 -0500 + -- Charles Kerr Wed, 04 Apr 2012 16:53:20 -0500 indicator-datetime (0.3.93-0ubuntu1) precise; urgency=low -- cgit v1.2.3