-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔧 Add tox env for fuzz testcase run (#263)
To reproduce failing test cases reported by Google's OSS-Fuzz runs
- Loading branch information
1 parent
5059095
commit d1852a5
Showing
5 changed files
with
53 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"""Build fuzzers idempotently in a given folder.""" | ||
import argparse | ||
from pathlib import Path | ||
import subprocess | ||
|
||
|
||
def main(): | ||
"""Build fuzzers idempotently in a given folder.""" | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("folder") | ||
args = parser.parse_args() | ||
folder = Path(args.folder) | ||
if not folder.exists(): | ||
print(f"Cloning google/oss-fuzz into: {folder}") | ||
folder.mkdir(parents=True) | ||
subprocess.check_call( | ||
[ | ||
"git", | ||
"clone", | ||
"--single-branch", | ||
"https://github.com/google/oss-fuzz", | ||
str(folder), | ||
] | ||
) | ||
else: | ||
print(f"Using google/oss-fuzz in: {folder}") | ||
if not (folder / "build").exists(): | ||
print(f"Building fuzzers in: {folder / 'build'}") | ||
subprocess.check_call( | ||
This comment has been minimized.
Sorry, something went wrong. |
||
[ | ||
"python", | ||
str(folder / "infra" / "helper.py"), | ||
"build_fuzzers", | ||
"markdown-it-py", | ||
] | ||
) | ||
else: | ||
print(f"Using existing fuzzers in: {folder / 'build'}") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
File renamed without changes.
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
fyi this will launch a docker container for building the fuzzers