mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-15 10:21:06 +00:00
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:
@@ -1,26 +1,29 @@
|
||||
//! The tests for running resolc when expecting usage output.
|
||||
|
||||
use crate::tests::cli::utils;
|
||||
use crate::cli_utils::{
|
||||
assert_command_failure, assert_command_success, assert_equal_exit_codes, execute_resolc,
|
||||
execute_solc,
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn shows_usage_with_help() {
|
||||
let arguments = &["--help"];
|
||||
let resolc_result = utils::execute_resolc(arguments);
|
||||
utils::assert_command_success(&resolc_result, "Providing the `--help` option");
|
||||
let resolc_result = execute_resolc(arguments);
|
||||
assert_command_success(&resolc_result, "Providing the `--help` option");
|
||||
|
||||
assert!(resolc_result.stdout.contains("Usage: resolc"));
|
||||
|
||||
let solc_result = utils::execute_solc(arguments);
|
||||
utils::assert_equal_exit_codes(&solc_result, &resolc_result);
|
||||
let solc_result = execute_solc(arguments);
|
||||
assert_equal_exit_codes(&solc_result, &resolc_result);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fails_without_options() {
|
||||
let resolc_result = utils::execute_resolc(&[]);
|
||||
utils::assert_command_failure(&resolc_result, "Omitting options");
|
||||
let resolc_result = execute_resolc(&[]);
|
||||
assert_command_failure(&resolc_result, "Omitting options");
|
||||
|
||||
assert!(resolc_result.stderr.contains("Usage: resolc"));
|
||||
|
||||
let solc_result = utils::execute_solc(&[]);
|
||||
utils::assert_equal_exit_codes(&solc_result, &resolc_result);
|
||||
let solc_result = execute_solc(&[]);
|
||||
assert_equal_exit_codes(&solc_result, &resolc_result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user