• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test that not specifying an extra stats file isn't broken.
2RUN: unset AFL_DRIVER_EXTRA_STATS_FILENAME
3RUN: AFLDriverTest
4
5; Test that specifying an invalid extra stats file causes a crash.
6RUN: ASAN_OPTIONS= AFL_DRIVER_EXTRA_STATS_FILENAME=%T not --crash AFLDriverTest
7
8; Test that specifying a corrupted stats file causes a crash.
9echo "peak_rss_mb :0" > %t
10ASAN_OPTIONS= AFL_DRIVER_EXTRA_STATS_FILENAME=%t not --crash AFLDriverTest
11
12; Test that specifying a valid nonexistent stats file works.
13RUN: rm -f %t
14RUN: AFL_DRIVER_EXTRA_STATS_FILENAME=%t AFLDriverTest
15RUN: [[ $(grep "peak_rss_mb\|slowest_unit_time_sec" %t | wc -l) -eq 2 ]]
16
17; Test that specifying a valid preexisting stats file works.
18RUN: printf "peak_rss_mb : 0\nslowest_unit_time_sec: 0\n" > %t
19RUN: AFL_DRIVER_EXTRA_STATS_FILENAME=%t AFLDriverTest
20; Check that both lines were printed.
21RUN: [[ $(grep "peak_rss_mb\|slowest_unit_time_sec" %t | wc -l) -eq 2 ]]
22
23; Test that peak_rss_mb and slowest_unit_time_in_secs are only updated when necessary.
24; Check that both lines have 9999 since there's no way we have exceeded that
25; amount of time or virtual memory.
26RUN: printf "peak_rss_mb : 9999\nslowest_unit_time_sec: 9999\n" > %t
27RUN: AFL_DRIVER_EXTRA_STATS_FILENAME=%t AFLDriverTest
28RUN: [[ $(grep "9999" %t | wc -l) -eq 2 ]]
29