idl: Avoid interference from rust tests during IDL generation (#3058)

This commit is contained in:
man0s 2024-06-27 18:03:40 +08:00 committed by GitHub
parent 594169efd0
commit 5f1f72c511
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -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);