Skip to content

Commit

Permalink
idl: Avoid interference from rust tests during IDL generation (coral-…
Browse files Browse the repository at this point in the history
  • Loading branch information
losman0s authored Jun 27, 2024
1 parent 594169e commit 5f1f72c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ The minor version will be incremented upon a breaking change and the patch versi

### Fixes

- idl: Make safety comment checks fail silently when program path env is not set ([#3045](https://github.com/coral-xyz/anchor/pull/3045])).
- idl: Make safety comment checks fail silently when program path env is not set ([#3045](https://github.com/coral-xyz/anchor/pull/3045)).
- idl: Avoid interference from rust tests during IDL generation ([#3058](https://github.com/coral-xyz/anchor/pull/3058)).

### Breaking

Expand Down
4 changes: 3 additions & 1 deletion idl/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ fn build(program_path: &Path, resolution: bool, skip_lint: bool, no_docs: bool)
"--- IDL begin errors ---" => state = State::Errors(vec![]),
"--- IDL begin program ---" => state = State::Program(vec![]),
_ => {
if line.starts_with("test result: ok") {
if line.starts_with("test result: ok")
&& !line.starts_with("test result: ok. 0 passed; 0 failed; 0")
{
if let Some(idl) = idl.as_mut() {
idl.address = mem::take(&mut address);
idl.constants = mem::take(&mut constants);
Expand Down

0 comments on commit 5f1f72c

Please sign in to comment.