Implement resolc end-to-end compilation benchmarks (#406)

# Description

Closes [#403](https://github.com/paritytech/revive/issues/403)

Adds compilation time benchmarks for resolc end-to-end.

The benchmarks can be run from the root via:

```sh
make bench-resolc
```

HTML reports will be generated under `target/criterion`, and a summary
of the results at
[crates/resolc/BENCHMARKS_M4PRO.md](https://github.com/paritytech/revive/blob/lj/compilation-benchmarks/crates/resolc/BENCHMARKS_M4PRO.md)
(currently from running on a Mac M4 Pro).
This commit is contained in:
LJ
2025-11-19 12:16:07 +01:00
committed by GitHub
parent e78f3cc419
commit ad61b6e3c9
24 changed files with 668 additions and 193 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
use crate::tests::cli::utils::{assert_command_success, execute_resolc, DEPENDENCY_CONTRACT_PATH};
use crate::cli_utils::{assert_command_success, execute_resolc, SOLIDITY_DEPENDENCY_CONTRACT_PATH};
/// Test deploy time linking a contract with unresolved factory dependencies.
#[test]
@@ -6,7 +6,7 @@ fn deploy_time_linking_works() {
let temp_dir = tempfile::TempDir::new().unwrap();
let output_directory = temp_dir.path().to_path_buf();
let source_path = temp_dir.path().to_path_buf().join("dependency.sol");
std::fs::copy(DEPENDENCY_CONTRACT_PATH, &source_path).unwrap();
std::fs::copy(SOLIDITY_DEPENDENCY_CONTRACT_PATH, &source_path).unwrap();
assert_command_success(
&execute_resolc(&[
@@ -58,7 +58,7 @@ fn deploy_time_linking_works() {
#[test]
fn emits_unlinked_binary_warning() {
let output = execute_resolc(&[DEPENDENCY_CONTRACT_PATH, "--bin"]);
let output = execute_resolc(&[SOLIDITY_DEPENDENCY_CONTRACT_PATH, "--bin"]);
assert_command_success(&output, "Missing libraries should compile fine");
assert!(output.stderr.contains("is unlinked"));
}