Skip to content

Commit

Permalink
Downstream cairo-test option to print used resources for tests (cairo…
Browse files Browse the repository at this point in the history
…#5266)

commit-id:3c5ee860
  • Loading branch information
maciektr committed Mar 22, 2024
1 parent 69c52b1 commit 65ac80d
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 51 deletions.
58 changes: 29 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 22 additions & 22 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,28 @@ assert_fs = "1"
async-trait = "0.1"
axum = { version = "0.6", features = ["http2"] }
cairo-felt = "0.9.1"
cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-sierra-type-size = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe" }
cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "53db45434c501e56ac84f1b27fac311183f14dbe", features = ["env_logger"] }
cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-sierra-type-size = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1" }
cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1", features = ["env_logger"] }
camino = { version = "1", features = ["serde1"] }
cargo_metadata = ">=0.18"
clap = { version = "4", features = ["derive", "env", "string"] }
Expand Down
5 changes: 5 additions & 0 deletions extensions/scarb-cairo-test/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ struct Args {
/// Run only ignored tests.
#[arg(long, default_value_t = false)]
ignored: bool,

/// Whether to print resource usage after each test.
#[arg(long, default_value_t = false)]
print_resource_usage: bool,
}

fn main() -> Result<()> {
Expand Down Expand Up @@ -70,6 +74,7 @@ fn main() -> Result<()> {
ignored: args.ignored,
run_profiler: RunProfilerConfig::None,
gas_enabled: is_gas_enabled(&metadata, &package.id, target),
print_resource_usage: args.print_resource_usage,
};
let runner = CompiledTestRunner::new(test_compilation, config);
runner.run(None)?;
Expand Down
Loading

0 comments on commit 65ac80d

Please sign in to comment.