[test suite] add ASAN mode to fko-wrapper

This commit is contained in:
Michael Rash 2015-07-14 21:26:44 -04:00
parent fd07a95880
commit 43f38551c9
2 changed files with 10 additions and 1 deletions

View File

@ -3,6 +3,10 @@ all : fko_wrapper.c fko_basic.c
cc -Wall -g -I../../lib fko_wrapper.c -o fko_wrapper -L../../lib/.libs -lfko
cc -Wall -g -I../../lib fko_basic.c -o fko_basic -L../../lib/.libs -lfko
asan : fko_wrapper.c fko_basic.c
cc -Wall -fsanitize=address -fno-omit-frame-pointer -g -I../../lib fko_wrapper.c -o fko_wrapper -L../../lib/.libs -lfko
cc -Wall -fsanitize=address -fno-omit-frame-pointer -g -I../../lib fko_basic.c -o fko_basic -L../../lib/.libs -lfko
fuzzing: fko_wrapper.c
cc -Wall -g -DFUZZING_INTERFACES -I../../lib fko_wrapper.c -o fko_wrapper -L../../lib/.libs -lfko

View File

@ -214,6 +214,7 @@ my $valgrind_disable_suppressions = 0;
my $valgrind_disable_child_silent = 0;
my $valgrind_suppressions_file = cwd() . '/valgrind_suppressions';
our $valgrind_str = '';
my $asan_mode = 0;
my %cached_fw_policy = ();
my $cpan_valgrind_mod = 'Test::Valgrind';
my %prev_valgrind_cov = ();
@ -1567,6 +1568,8 @@ sub fko_wrapper_exec() {
my $make_arg = $test_hr->{'wrapper_compile'};
$make_arg = 'asan' if $asan_mode;
if ($test_hr->{'wrapper_binary'} =~ m|/fko_wrapper$|) {
if ($enable_fuzzing_interfaces_tests) {
$make_arg = 'fuzzing';
@ -6946,8 +6949,10 @@ sub init() {
$genhtml_path = &find_command('genhtml') unless $genhtml_path;
### see if we're compiled with ASAN support
unless (&file_find_regex([qr/enable\-asan\-support/],
if (&file_find_regex([qr/enable\-asan\-support/],
$MATCH_ALL, $NO_APPEND_RESULTS, $config_log)) {
$asan_mode = 1;
} else {
&write_test_file("[-] Can't find --enable-asan-support in $config_log\n",
$curr_test_file);
push @tests_to_exclude, qr/ASAN/;