Skip to content

Commit

Permalink
Fix some test-cases stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jgcrosta committed Aug 5, 2024
1 parent 4b5de7c commit ee485a6
Show file tree
Hide file tree
Showing 36 changed files with 107 additions and 170 deletions.
2 changes: 1 addition & 1 deletion docs/docs/detectors/12-soroban-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Using an old version of Soroban can be dangerous, as it may have bugs or securit

```toml
[dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[dev-dependencies]
soroban-sdk = { version = "=20.0.0", features = ["testutils"] }
Expand Down
16 changes: 8 additions & 8 deletions templates/test-case/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
edition = "2021"
name = "incrementor"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["cdylib"]

[dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[dev-dependencies]
soroban-sdk = { version = "=20.0.0", features = ["testutils"] }
Expand All @@ -16,15 +16,15 @@ soroban-sdk = { version = "=20.0.0", features = ["testutils"] }
testutils = ["soroban-sdk/testutils"]

[profile.release]
opt-level = "z"
overflow-checks = true
codegen-units = 1
debug = 0
strip = "symbols"
debug-assertions = false
panic = "abort"
codegen-units = 1
lto = true
opt-level = "z"
overflow-checks = true
panic = "abort"
strip = "symbols"

[profile.release-with-logs]
inherits = "release"
debug-assertions = true
inherits = "release"
2 changes: 1 addition & 1 deletion test-cases/assert-violation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["assert-violation-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion test-cases/avoid-core-mem-forget/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["avoid-core-mem-forget-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion test-cases/avoid-panic-error/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["avoid-panic-error-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion test-cases/avoid-unsafe-block/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["avoid-unsafe-block-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion test-cases/dos-unbounded-operation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["dos-unbounded-operation-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
3 changes: 1 addition & 2 deletions test-cases/dos-unexpected-revert-with-vector/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["dos-unexpected-revert-with-vector-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand All @@ -19,4 +19,3 @@ strip = "symbols"
[profile.release-with-logs]
debug-assertions = true
inherits = "release"

2 changes: 1 addition & 1 deletion test-cases/incorrect-exponentiation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["incorrect-exponentiation-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "20.3.2" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion test-cases/insufficiently-random-values/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["insufficiently-random-values-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion test-cases/integer-overflow-or-underflow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["integer-overflow-or-underflow-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=21.3.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion test-cases/iterators-over-indexing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["iterators-over-indexing-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
21 changes: 21 additions & 0 deletions test-cases/overflow-check/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[workspace]
exclude = [".cargo", "target"]
members = ["overflow-check-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
debug = 0
debug-assertions = false
lto = true
opt-level = "z"
overflow-checks = true
panic = "abort"
strip = "symbols"

[profile.release-with-logs]
debug-assertions = true
inherits = "release"
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,10 @@ version = "0.1.0"
crate-type = ["cdylib"]

[dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { workspace = true }

[dev-dependencies]
soroban-sdk = { version = "=20.0.0", features = ["testutils"] }
soroban-sdk = { workspace = true, features = ["testutils"] }

[features]
testutils = ["soroban-sdk/testutils"]

[profile.release]
codegen-units = 1
debug = 0
debug-assertions = false
lto = true
opt-level = "z"
overflow-checks = true
panic = "abort"
strip = "symbols"

[profile.release-with-logs]
debug-assertions = true
inherits = "release"
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,10 @@ version = "0.1.0"
crate-type = ["cdylib"]

[dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { workspace = true }

[dev-dependencies]
soroban-sdk = { version = "=20.0.0", features = ["testutils"] }
soroban-sdk = { workspace = true, features = ["testutils"] }

[features]
testutils = ["soroban-sdk/testutils"]

[profile.release]
codegen-units = 1
debug = 0
debug-assertions = false
lto = true
opt-level = "z"
overflow-checks = false
panic = "abort"
strip = "symbols"

[profile.release-with-logs]
debug-assertions = true
inherits = "release"
2 changes: 1 addition & 1 deletion test-cases/set-contract-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["set-contract-storage-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion test-cases/soroban-version/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["soroban-version-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion test-cases/unprotected-mapping-operation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["unprotected-mapping-operation-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["unprotected-update-current-contract-wasm-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,10 @@ version = "0.1.0"
crate-type = ["cdylib"]

[dependencies]
soroban-sdk = "=20.0.0"
soroban-sdk = { workspace = true }

[dev-dependencies]
soroban-sdk = { version = "=20.0.0", features = ["testutils"] }
soroban-sdk = { workspace = true, features = ["testutils"] }

[features]
testutils = ["soroban-sdk/testutils"]

[profile.release]
codegen-units = 1
debug = 0
debug-assertions = false
lto = true
opt-level = "z"
overflow-checks = true
panic = "abort"
strip = "symbols"

[profile.release-with-logs]
debug-assertions = true
inherits = "release"
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,10 @@ version = "0.1.0"
crate-type = ["cdylib"]

[dependencies]
soroban-sdk = "=20.0.0"
soroban-sdk = { workspace = true }

[dev-dependencies]
soroban-sdk = { version = "=20.0.0", features = ["testutils"] }
soroban-sdk = { workspace = true, features = ["testutils"] }

[features]
testutils = ["soroban-sdk/testutils"]

[profile.release]
codegen-units = 1
debug = 0
debug-assertions = false
lto = true
opt-level = "z"
overflow-checks = true
panic = "abort"
strip = "symbols"

[profile.release-with-logs]
debug-assertions = true
inherits = "release"
3 changes: 1 addition & 2 deletions test-cases/unrestricted-transfer-from/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["unrestricted-transfer-from-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand All @@ -19,4 +19,3 @@ strip = "symbols"
[profile.release-with-logs]
debug-assertions = true
inherits = "release"

2 changes: 1 addition & 1 deletion test-cases/unsafe-expect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["unsafe-expect-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion test-cases/unsafe-map-get/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["unsafe-map-get-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion test-cases/unsafe-unwrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["unsafe-unwrap-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion test-cases/unused-return-enum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["unused-return-enum-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=20.0.0" }
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
Expand Down
21 changes: 21 additions & 0 deletions test-cases/vec-could-be-mapping/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[workspace]
exclude = [".cargo", "target"]
members = ["vec-could-be-mapping-*/*"]
resolver = "2"

[workspace.dependencies]
soroban-sdk = { version = "=21.4.0" }

[profile.release]
codegen-units = 1
debug = 0
debug-assertions = false
lto = true
opt-level = "z"
overflow-checks = true
panic = "abort"
strip = "symbols"

[profile.release-with-logs]
debug-assertions = true
inherits = "release"
Loading

0 comments on commit ee485a6

Please sign in to comment.