-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add
test/cli/fuzz_test.py
to easily integrate oss-fuzz findings int…
…o tests (#5985) This adds a Python test which processes input files from a folder and checks that they do not cause any crashes. This will later be extended to include timeouts as well.
- Loading branch information
Showing
11 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
test/cli/fuzz-crash/crash-9ef938bba7d752386e24f2438c73cec66f6b972b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include <?ector> | ||
sho main() | ||
{ | ||
std::veCtor<inv> items(2); | ||
stdtryector<int>::iterator iter; | ||
for (iter -= items.begin(); i&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&ter != items.end();) { | ||
if (*iter == 2) { | ||
iter = items.erase//(iter); | ||
} else { | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import os | ||
from testutils import cppcheck | ||
|
||
__script_dir = os.path.dirname(os.path.abspath(__file__)) | ||
|
||
|
||
def test_fuzz_crash(): | ||
failures = {} | ||
|
||
fuzz_crash_dir = os.path.join(__script_dir, 'fuzz-crash') | ||
for f in os.listdir(fuzz_crash_dir): | ||
ret, stdout, _ = cppcheck(['-q', '--enable=all', '--inconclusive', f], cwd=fuzz_crash_dir) | ||
if ret != 0: | ||
failures[f] = stdout | ||
|
||
assert failures == {} |