Commit 867d9b3
committed
feat(contracts): add testutils Cargo feature flag (#203)
Introduce a testutils feature in contracts/Cargo.toml that gates
soroban-sdk test helpers behind an explicit feature flag, keeping them
out of the production WASM binary.
Changes:
- contracts/Cargo.toml: add [features] section with
testutils = ["soroban-sdk/testutils"]
- contracts/src/lib.rs: gate mod test with
#[cfg(any(test, feature = "testutils"))] so the test module is
only compiled when running tests or when the feature is explicitly
requested
- .github/workflows/contracts-ci.yml:
- run cargo test --features testutils so tests can use SDK mocks
- build release WASM with --no-default-features (no testutils)
- add verification step that asserts testutils symbols are absent
from the release binary
Closes #2031 parent a9d3c9e commit 867d9b3
3 files changed
Lines changed: 30 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
66 | 83 | | |
67 | 84 | | |
68 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
9 | 18 | | |
10 | 19 | | |
11 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
432 | | - | |
| 432 | + | |
433 | 433 | | |
0 commit comments