mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-07-16 22:07:12 +02:00
bin
cmake
module
Base
Core
Entity
Library
Misc
Vendor
AES256
ASIO
B64
CPR
CURL
CivetWeb
ConcurrentQueue
Fmt
Hash
MDBC
MaxmindDB
bin
cmake
dev-bin
make-man-pages.pl
ppa-release.sh
regen-win32-test-projs.pl
release.sh
uncrustify-all.sh
valgrind-all.pl
doc
include
projects
src
t
AUTHORS
CMakeLists.txt
Changes.md
LICENSE
Makefile.am
NOTICE
README.dev.md
README.md
appveyor.yml
bootstrap
common.mk
configure.ac
PUGIXML
SQLite
SimpleIni
SimpleSocket
SleepyDiscord
TinyDir
WebSocketPP
Whirlpool
ZLib
CMakeLists.txt
CMakeLists.txt
Core.cpp
Core.hpp
Logger.cpp
Logger.hpp
Main.cpp
Register.cpp
SqBase.hpp
sdk
.gitignore
.gitmodules
CMakeLists.txt
LICENSE
README.md
54 lines
1.2 KiB
Perl
54 lines
1.2 KiB
Perl
#!/usr/bin/env perl
|
|
|
|
# Note to run this you will probably want to build with ./configure
|
|
# --disable-shared. You don't want to valgrind the libtool script.
|
|
#
|
|
# Also make sure you compile the tests first (`make check').
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
use File::Basename qw( basename );
|
|
use FindBin qw( $Bin );
|
|
use IPC::Run3;
|
|
|
|
my $top_dir = "$Bin/..";
|
|
|
|
my $output;
|
|
|
|
my @tests;
|
|
push @tests, glob "$top_dir/t/*_t";
|
|
push @tests, glob "$top_dir/t/*-t";
|
|
|
|
my @mmdblookup = (
|
|
"$top_dir/bin/mmdblookup",
|
|
'--file', "$top_dir/t/maxmind-db/test-data/MaxMind-DB-test-decoder.mmdb",
|
|
'--ip',
|
|
);
|
|
|
|
# We want IPv4 and IPv6 addresses - one of each that exists in the db and one
|
|
# that doesn't
|
|
my @ips = ( '1.1.1.1', '10.0.0.0', 'abcd::', '0900::' );
|
|
|
|
my @cmds = (
|
|
( map { [ @mmdblookup, $_ ] } @ips ),
|
|
( map { [$_] } @tests ),
|
|
);
|
|
|
|
for my $cmd (@cmds) {
|
|
my $output;
|
|
run3(
|
|
[ qw( valgrind -v --leak-check=full --show-leak-kinds=all -- ), @{$cmd} ],
|
|
\undef,
|
|
\$output,
|
|
\$output,
|
|
);
|
|
|
|
$output =~ s/^(?!=).*\n//mg;
|
|
|
|
my $marker = '-' x 60;
|
|
print $marker, "\n", ( join q{ }, basename( shift @{$cmd} ), @{$cmd} ),
|
|
"\n", $marker, "\n", $output,
|
|
"\n\n";
|
|
}
|