improve coverage

pull/89/merge
David Schweikert 8 years ago
parent 4e0b2277a3
commit 24ce982e5b

@ -10,7 +10,7 @@ fi
autoreconf -i
./configure --enable-ipv4 --enable-ipv6 --prefix=/opt/fping
make CFLAGS="-g -fprofile-arcs -ftest-coverage"
make CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
## setcap currently doesn't work anymore on travis-ci
#sudo setcap cap_net_raw+ep src/fping
## setcap debugging:

@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use Test::Command tests => 12;
use Test::Command tests => 18;
# -n show targets by name (-d is equivalent)
# -O n set the type of service (tos) flag on the ICMP packets
@ -11,6 +11,22 @@ use Test::Command tests => 12;
# fping -n -> test-14-internet-hosts
# fping -d -n
{
my $cmd = Test::Command->new(cmd => "fping -d -n 127.0.0.1");
$cmd->exit_is_num(1);
$cmd->stdout_is_eq("");
$cmd->stderr_is_eq("fping: use either one of -d or -n\n");
}
# fping -n -d
{
my $cmd = Test::Command->new(cmd => "fping -n -d 127.0.0.1");
$cmd->exit_is_num(1);
$cmd->stdout_is_eq("");
$cmd->stderr_is_eq("fping: use either one of -d or -n\n");
}
# fping -o
{
my $cmd = Test::Command->new(cmd => "fping -t100 -p 100 -o -c 5 8.8.8.7");

@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use Test::Command tests => 18;
use Test::Command tests => 21;
use Test::More;
# -R random bytes
@ -95,4 +95,12 @@ SKIP: {
$cmd->stderr_is_eq("");
}
# fping -S
{
my $cmd = Test::Command->new(cmd => "fping -S bla");
$cmd->exit_is_num(1);
$cmd->stdout_is_eq("");
$cmd->stderr_is_eq("fping: can't parse source address: bla\n");
}
# fping -t tested in test-4-options-a-b.pl

@ -613,8 +613,8 @@ int main(int argc, char** argv)
break;
}
#endif
usage(1);
break;
fprintf(stderr, "%s: can't parse source address: %s\n", prog, optparse_state.optarg);
exit(1);
case 'I':
#ifdef SO_BINDTODEVICE

Loading…
Cancel
Save