Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

astroid: add seed corpus of .py files for fuzz_parse target #12563

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions projects/astroid/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,14 @@ pip3 install .
for fuzzer in $(find $SRC -name 'fuzz_*.py'); do
compile_python_fuzzer $fuzzer
done

# Build a fuzz_parse seed corpus consisting of all the .py files from the astroid repo
CORPUS_DIR="$WORK/corpus"
mkdir -p "$CORPUS_DIR"

FILES=$(find "$SRC/astroid" -type f -iname "*.py")
for file in $FILES; do
cp "$file" "$CORPUS_DIR/$(md5sum "$file" | cut -f 1 -d ' ').py"
done

zip -r "$OUT/fuzz_parse_seed_corpus.zip" "$CORPUS_DIR"/*