Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 96ce922

Browse files
authored
token-cli: Add directions for building and running tests (#3673)
1 parent b0d84fc commit 96ce922

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

token/cli/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
11
# SPL Token program command-line utility
22

33
A basic command-line for creating and using SPL Tokens. See https://spl.solana.com/token for more details
4+
5+
## Build
6+
7+
To build the CLI locally, simply run:
8+
9+
```sh
10+
cargo build
11+
```
12+
13+
## Testing
14+
15+
The tests require locally built programs for Token, Token-2022, and Associated
16+
Token Account. To build these, you can run:
17+
18+
```sh
19+
BUILD_DEPENDENT_PROGRAMS=1 cargo build
20+
```
21+
22+
This method uses the local `build.rs` file, which can be error-prone, so alternatively,
23+
you can build the programs by running the following commands from this directory:
24+
25+
```sh
26+
cargo build-sbf --manifest-path ../program/Cargo.toml
27+
cargo build-sbf --manifest-path ../program-2022/Cargo.toml
28+
cargo build-sbf --manifest-path ../../associated-token-account/program/Cargo.toml
29+
```
30+
31+
After that, you can run the tests as any other Rust project:
32+
33+
```sh
34+
cargo test
35+
```

0 commit comments

Comments
 (0)