[icinga-checkins] icinga.org: icinga2/master: Fix 'make check-coverage' for VPATH builds.

git at icinga.org git at icinga.org
Fri Apr 19 14:47:59 CEST 2013


Module: icinga2
Branch: master
Commit: 09d97c551e2a4c5370f5d47ca32b2c02e4017ff2
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=09d97c551e2a4c5370f5d47ca32b2c02e4017ff2

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Fri Apr 19 13:51:33 2013 +0200

Fix 'make check-coverage' for VPATH builds.

---

 Makefile.am         |    2 +-
 test/Makefile.am    |    1 +
 test/base-match.cpp |   36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index bbb11c2..4e80c72 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,7 +68,7 @@ check-coverage: all
 	lcov -d . -z
 	make check
 	lcov -d . -c -o icinga2.info
-	lcov -e icinga2.info -o icinga2-filtered.info `pwd`\*
+	lcov -e icinga2.info -o icinga2-filtered.info "`readlink -f $(top_srcdir)`/*"
 	mkdir -p docs/lcov
 	genhtml -o docs/lcov icinga2-filtered.info
 
diff --git a/test/Makefile.am b/test/Makefile.am
index 3199fca..4aa1963 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -12,6 +12,7 @@ icinga2_test_SOURCES = \
 	base-convert.cpp \
 	base-dictionary.cpp \
 	base-fifo.cpp \
+	base-match.cpp \
 	base-object.cpp \
 	base-shellescape.cpp \
 	base-timer.cpp
diff --git a/test/base-match.cpp b/test/base-match.cpp
new file mode 100644
index 0000000..84ae92e
--- /dev/null
+++ b/test/base-match.cpp
@@ -0,0 +1,36 @@
+/******************************************************************************
+ * Icinga 2                                                                   *
+ * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/)        *
+ *                                                                            *
+ * This program is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU General Public License                *
+ * as published by the Free Software Foundation; either version 2             *
+ * of the License, or (at your option) any later version.                     *
+ *                                                                            *
+ * This program is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
+ * GNU General Public License for more details.                               *
+ *                                                                            *
+ * You should have received a copy of the GNU General Public License          *
+ * along with this program; if not, write to the Free Software Foundation     *
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
+ ******************************************************************************/
+
+#include "base/utility.h"
+#include <boost/test/unit_test.hpp>
+
+using namespace icinga;
+
+BOOST_AUTO_TEST_SUITE(base_match)
+
+BOOST_AUTO_TEST_CASE(tolong)
+{
+	BOOST_CHECK(Utility::Match("*", "hello"));
+	BOOST_CHECK(!Utility::Match("world", "hello"));
+	BOOST_CHECK(!Utility::Match("hee*", "hello"));
+	BOOST_CHECK(Utility::Match("he??o", "hello"));
+	BOOST_CHECK(Utility::Match("he?", "hel"));
+}
+
+BOOST_AUTO_TEST_SUITE_END()





More information about the icinga-checkins mailing list