diff --git a/test/fko-wrapper/Makefile b/test/fko-wrapper/Makefile index 7f25966f..5283737e 100644 --- a/test/fko-wrapper/Makefile +++ b/test/fko-wrapper/Makefile @@ -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 diff --git a/test/test-fwknop.pl b/test/test-fwknop.pl index 0576f04c..bfb97ecd 100755 --- a/test/test-fwknop.pl +++ b/test/test-fwknop.pl @@ -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/;