mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
prepare_report.py: Add --report-file option
This commit is contained in:
parent
7bebcb7871
commit
96fd9051ed
@ -927,8 +927,8 @@ jobs:
|
|||||||
at: build
|
at: build
|
||||||
- run: mkdir test-cases/
|
- run: mkdir test-cases/
|
||||||
- run: cd test-cases && ../scripts/isolate_tests.py ../test/
|
- run: cd test-cases && ../scripts/isolate_tests.py ../test/
|
||||||
- run: cd test-cases && ../scripts/bytecodecompare/prepare_report.py ../build/solc/solc --interface standard-json && mv -v report.txt ../bytecode-report-ubuntu-json.txt
|
- run: cd test-cases && ../scripts/bytecodecompare/prepare_report.py ../build/solc/solc --interface standard-json --report-file ../bytecode-report-ubuntu-json.txt
|
||||||
- run: cd test-cases && ../scripts/bytecodecompare/prepare_report.py ../build/solc/solc --interface cli && mv -v report.txt ../bytecode-report-ubuntu-cli.txt
|
- run: cd test-cases && ../scripts/bytecodecompare/prepare_report.py ../build/solc/solc --interface cli --report-file ../bytecode-report-ubuntu-cli.txt
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: bytecode-report-ubuntu-json.txt
|
path: bytecode-report-ubuntu-json.txt
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
@ -950,8 +950,8 @@ jobs:
|
|||||||
at: .
|
at: .
|
||||||
- run: mkdir test-cases/
|
- run: mkdir test-cases/
|
||||||
- run: cd test-cases && ../scripts/isolate_tests.py ../test/
|
- run: cd test-cases && ../scripts/isolate_tests.py ../test/
|
||||||
- run: cd test-cases && ../scripts/bytecodecompare/prepare_report.py ../build/solc/solc --interface standard-json && mv -v report.txt ../bytecode-report-osx-json.txt
|
- run: cd test-cases && ../scripts/bytecodecompare/prepare_report.py ../build/solc/solc --interface standard-json --report-file ../bytecode-report-osx-json.txt
|
||||||
- run: cd test-cases && ../scripts/bytecodecompare/prepare_report.py ../build/solc/solc --interface cli && mv -v report.txt ../bytecode-report-osx-cli.txt
|
- run: cd test-cases && ../scripts/bytecodecompare/prepare_report.py ../build/solc/solc --interface cli --report-file ../bytecode-report-osx-cli.txt
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: bytecode-report-osx-json.txt
|
path: bytecode-report-osx-json.txt
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
@ -975,8 +975,8 @@ jobs:
|
|||||||
at: build
|
at: build
|
||||||
- run: mkdir test-cases\
|
- run: mkdir test-cases\
|
||||||
- run: cd test-cases\ && python ..\scripts\isolate_tests.py ..\test\
|
- run: cd test-cases\ && python ..\scripts\isolate_tests.py ..\test\
|
||||||
- run: cd test-cases\ && python ..\scripts\bytecodecompare\prepare_report.py ..\build\solc\Release\solc.exe --interface standard-json && move report.txt ..\bytecode-report-windows-json.txt
|
- run: cd test-cases\ && python ..\scripts\bytecodecompare\prepare_report.py ..\build\solc\Release\solc.exe --interface standard-json --report-file ..\bytecode-report-windows-json.txt
|
||||||
- run: cd test-cases\ && python ..\scripts\bytecodecompare\prepare_report.py ..\build\solc\Release\solc.exe --interface cli && move report.txt ..\bytecode-report-windows-cli.txt
|
- run: cd test-cases\ && python ..\scripts\bytecodecompare\prepare_report.py ..\build\solc\Release\solc.exe --interface cli --report-file ..\bytecode-report-windows-cli.txt
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: bytecode-report-windows-json.txt
|
path: bytecode-report-windows-json.txt
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
|
@ -276,11 +276,12 @@ def generate_report(
|
|||||||
compiler_path: Path,
|
compiler_path: Path,
|
||||||
interface: CompilerInterface,
|
interface: CompilerInterface,
|
||||||
smt_use: SMTUse,
|
smt_use: SMTUse,
|
||||||
force_no_optimize_yul: bool
|
force_no_optimize_yul: bool,
|
||||||
|
report_file_path: Path,
|
||||||
):
|
):
|
||||||
metadata_option_supported = detect_metadata_cli_option_support(compiler_path)
|
metadata_option_supported = detect_metadata_cli_option_support(compiler_path)
|
||||||
|
|
||||||
with open('report.txt', mode='w', encoding='utf8', newline='\n') as report_file:
|
with open(report_file_path, mode='w', encoding='utf8', newline='\n') as report_file:
|
||||||
for optimize in [False, True]:
|
for optimize in [False, True]:
|
||||||
with TemporaryDirectory(prefix='prepare_report-') as tmp_dir:
|
with TemporaryDirectory(prefix='prepare_report-') as tmp_dir:
|
||||||
for source_file_name in sorted(source_file_names):
|
for source_file_name in sorted(source_file_names):
|
||||||
@ -343,6 +344,7 @@ def commandline_parser() -> ArgumentParser:
|
|||||||
action='store_true',
|
action='store_true',
|
||||||
help="Explicitly disable Yul optimizer in CLI runs without optimization to work around a bug in solc 0.6.0 and 0.6.1."
|
help="Explicitly disable Yul optimizer in CLI runs without optimization to work around a bug in solc 0.6.0 and 0.6.1."
|
||||||
)
|
)
|
||||||
|
parser.add_argument('--report-file', dest='report_file', default='report.txt', help="The file to write the report to.")
|
||||||
return parser;
|
return parser;
|
||||||
|
|
||||||
|
|
||||||
@ -354,4 +356,5 @@ if __name__ == "__main__":
|
|||||||
CompilerInterface(options.interface),
|
CompilerInterface(options.interface),
|
||||||
SMTUse(options.smt_use),
|
SMTUse(options.smt_use),
|
||||||
options.force_no_optimize_yul,
|
options.force_no_optimize_yul,
|
||||||
|
Path(options.report_file),
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user