"Fossies" - the Fresh Open Source Software Archive

Member "dpkg-1.19.7/t/cppcheck.t" (19 Apr 2019, 1219 Bytes) of package /linux/misc/dpkg_1.19.7.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/usr/bin/perl
    2 #
    3 # This program is free software; you can redistribute it and/or modify
    4 # it under the terms of the GNU General Public License as published by
    5 # the Free Software Foundation; either version 2 of the License, or
    6 # (at your option) any later version.
    7 #
    8 # This program is distributed in the hope that it will be useful,
    9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   11 # GNU General Public License for more details.
   12 #
   13 # You should have received a copy of the GNU General Public License
   14 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
   15 
   16 use strict;
   17 use warnings;
   18 
   19 use Test::More;
   20 use Test::Dpkg qw(:needs);
   21 
   22 test_needs_author();
   23 test_needs_command('cppcheck');
   24 test_needs_srcdir_switch();
   25 
   26 plan tests => 1;
   27 
   28 my @cppcheck_opts = (qw(
   29   -q --force --error-exitcode=2
   30   --suppressions-list=t/cppcheck/cppcheck.supp
   31 ), (
   32   '--enable=warning,performance,portability,style',
   33   '--template=\'{file}:{line}: {severity} ({id}): {message}\''
   34 ));
   35 my $tags = qx(cppcheck @cppcheck_opts . 2>&1);
   36 
   37 # Fixup the output:
   38 chomp $tags;
   39 
   40 my $ok = length $tags == 0;
   41 
   42 ok($ok, 'cppcheck');
   43 if (not $ok) {
   44     diag($tags);
   45 }