Fix 'make check-coverage' for VPATH builds.

This commit is contained in:
Gunnar Beutner 2013-04-19 13:51:33 +02:00
parent 22823c966b
commit 09d97c551e
3 changed files with 38 additions and 1 deletions

View File

@ -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

View File

@ -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

36
test/base-match.cpp Normal file
View File

@ -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()