From 64c9eb6dd2223317324ba15f997a3fa218eb6479 Mon Sep 17 00:00:00 2001 From: maciektr Date: Wed, 4 Sep 2024 02:51:27 -0700 Subject: [PATCH] Test compilation diagnostics reporter (#1577) --- Cargo.lock | 62 ++++++++++++++-------------- Cargo.toml | 48 ++++++++++----------- scarb/src/compiler/compilers/test.rs | 19 +++++---- scarb/tests/build.rs | 6 +++ 4 files changed, 72 insertions(+), 63 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b9ee24099..713985499 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -568,7 +568,7 @@ dependencies = [ [[package]] name = "cairo-lang-casm" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-utils", "indoc", @@ -581,7 +581,7 @@ dependencies = [ [[package]] name = "cairo-lang-compiler" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "anyhow", "cairo-lang-defs", @@ -606,7 +606,7 @@ dependencies = [ [[package]] name = "cairo-lang-debug" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-utils", ] @@ -614,7 +614,7 @@ dependencies = [ [[package]] name = "cairo-lang-defs" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-debug", "cairo-lang-diagnostics", @@ -630,7 +630,7 @@ dependencies = [ [[package]] name = "cairo-lang-diagnostics" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -641,7 +641,7 @@ dependencies = [ [[package]] name = "cairo-lang-doc" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-defs", "cairo-lang-formatter", @@ -655,7 +655,7 @@ dependencies = [ [[package]] name = "cairo-lang-eq-solver" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-utils", "good_lp", @@ -664,7 +664,7 @@ dependencies = [ [[package]] name = "cairo-lang-filesystem" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-debug", "cairo-lang-utils", @@ -678,7 +678,7 @@ dependencies = [ [[package]] name = "cairo-lang-formatter" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "anyhow", "cairo-lang-diagnostics", @@ -698,7 +698,7 @@ dependencies = [ [[package]] name = "cairo-lang-language-server" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -734,7 +734,7 @@ dependencies = [ [[package]] name = "cairo-lang-lowering" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -798,7 +798,7 @@ checksum = "c49906d6b1c215e5814be7c5c65ecf2328898b335bee8c2409ec07cfb5530daf" [[package]] name = "cairo-lang-parser" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-diagnostics", "cairo-lang-filesystem", @@ -817,7 +817,7 @@ dependencies = [ [[package]] name = "cairo-lang-plugins" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-defs", "cairo-lang-diagnostics", @@ -835,7 +835,7 @@ dependencies = [ [[package]] name = "cairo-lang-proc-macros" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-debug", "quote", @@ -845,7 +845,7 @@ dependencies = [ [[package]] name = "cairo-lang-project" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-filesystem", "cairo-lang-utils", @@ -858,7 +858,7 @@ dependencies = [ [[package]] name = "cairo-lang-runner" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "ark-ff", "ark-secp256k1", @@ -888,7 +888,7 @@ dependencies = [ [[package]] name = "cairo-lang-semantic" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -913,7 +913,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "anyhow", "cairo-lang-utils", @@ -939,7 +939,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -954,7 +954,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-gas" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -969,7 +969,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-generator" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -992,7 +992,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "assert_matches", "cairo-lang-casm", @@ -1012,7 +1012,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-type-size" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-sierra", "cairo-lang-utils", @@ -1021,7 +1021,7 @@ dependencies = [ [[package]] name = "cairo-lang-starknet" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -1050,7 +1050,7 @@ dependencies = [ [[package]] name = "cairo-lang-starknet-classes" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-casm", "cairo-lang-sierra", @@ -1072,7 +1072,7 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -1087,7 +1087,7 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "genco", "xshell", @@ -1096,7 +1096,7 @@ dependencies = [ [[package]] name = "cairo-lang-test-plugin" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -1122,7 +1122,7 @@ dependencies = [ [[package]] name = "cairo-lang-test-runner" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -1144,7 +1144,7 @@ dependencies = [ [[package]] name = "cairo-lang-test-utils" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "cairo-lang-formatter", "cairo-lang-utils", @@ -1156,7 +1156,7 @@ dependencies = [ [[package]] name = "cairo-lang-utils" version = "2.8.0" -source = "git+https://github.com/starkware-libs/cairo?rev=c8407b2b6aa5bf61a6788228127c7735e4af6a4d#c8407b2b6aa5bf61a6788228127c7735e4af6a4d" +source = "git+https://github.com/starkware-libs/cairo?rev=d3628c337e20fdd3753b89c8dc59fefc2f406820#d3628c337e20fdd3753b89c8dc59fefc2f406820" dependencies = [ "env_logger", "hashbrown 0.14.5", diff --git a/Cargo.toml b/Cargo.toml index 4aee61a3c..4e4dd9011 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,30 +35,30 @@ anyhow = "1" assert_fs = "1" async-trait = "0.1" axum = { version = "0.6", features = ["http2"] } -cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-doc = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-sierra-type-size = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d" } -cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "c8407b2b6aa5bf61a6788228127c7735e4af6a4d", features = ["env_logger"] } +cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-doc = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-sierra-type-size = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820" } +cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "d3628c337e20fdd3753b89c8dc59fefc2f406820", features = ["env_logger"] } camino = { version = "1", features = ["serde1"] } cargo_metadata = ">=0.18" clap = { version = "4", features = ["derive", "env", "string"] } diff --git a/scarb/src/compiler/compilers/test.rs b/scarb/src/compiler/compilers/test.rs index a517a6104..5a930c441 100644 --- a/scarb/src/compiler/compilers/test.rs +++ b/scarb/src/compiler/compilers/test.rs @@ -26,18 +26,16 @@ impl Compiler for TestCompiler { let target_dir = unit.target_dir(ws); let test_crate_ids = collect_main_crate_ids(&unit, db); - let main_crate_ids = collect_all_crate_ids(&unit, db); + let all_crate_ids = collect_all_crate_ids(&unit, db); let starknet = unit.cairo_plugins.iter().any(|plugin| { plugin.package.id.name == PackageName::STARKNET && plugin.package.id.source_id == SourceId::for_std() }); - let diagnostics_reporter = - build_compiler_config(db, &unit, &main_crate_ids, ws).diagnostics_reporter; + let mut diagnostics_reporter = + build_compiler_config(db, &unit, &test_crate_ids, ws).diagnostics_reporter; - diagnostics_reporter - .with_crates(&main_crate_ids) - .ensure(db)?; + diagnostics_reporter.ensure(db)?; let test_compilation = { let _ = trace_span!("compile_test").enter(); @@ -50,8 +48,13 @@ impl Compiler for TestCompiler { .compiler_config .unstable_add_statements_code_locations_debug_info, }; - let allow_warnings = unit.compiler_config.allow_warnings; - compile_test_prepared_db(db, config, main_crate_ids, test_crate_ids, allow_warnings)? + compile_test_prepared_db( + db, + config, + all_crate_ids, + test_crate_ids, + diagnostics_reporter, + )? }; { diff --git a/scarb/tests/build.rs b/scarb/tests/build.rs index 0282b2198..9aa4c3498 100644 --- a/scarb/tests/build.rs +++ b/scarb/tests/build.rs @@ -958,6 +958,12 @@ fn does_not_show_warnings_from_deps() { .current_dir(&second) .assert() .success(); + Scarb::quick_snapbox() + .arg("build") + .arg("--test") + .current_dir(&second) + .assert() + .success(); } #[test]