Skip to content

Commit 0e9c6bd

Browse files
authored
Use cargo test directly (#98)
* Use cargo test directly * Add changeset * Add test-sbf feature
1 parent 64aa0f9 commit 0e9c6bd

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.changeset/wet-lions-taste.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-solana-program": patch
3+
---
4+
5+
Use cargo test directly on Rust client script

template/clients/rust/scripts/client/test-rust.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ import { cliArguments, workingDirectory } from '../utils.mjs';
77
const testArgs = cliArguments();
88

99
const hasSolfmt = await which('solfmt', { nothrow: true });
10+
const sbfOutDir = path.join(workingDirectory, 'target', 'deploy');
1011

1112
// Run the tests.
1213
cd(path.join(workingDirectory, 'clients', 'rust'));
1314
if (hasSolfmt) {
14-
await $`cargo test-sbf ${testArgs} 2>&1 | solfmt`;
15+
await $`SBF_OUT_DIR=${sbfOutDir} cargo test --features "test-sbf" ${testArgs} 2>&1 | solfmt`;
1516
} else {
16-
await $`cargo test-sbf ${testArgs}`;
17+
await $`SBF_OUT_DIR=${sbfOutDir} cargo test --features "test-sbf" ${testArgs}`;
1718
}

0 commit comments

Comments
 (0)