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:
#!/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
# 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");
#!/usr/bin/perl -w
-use Test::Command tests => 18;
+use Test::Command tests => 21;
use Test::More;
# -R random bytes
$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
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