Forge compiles all test contracts when specified to only use one contract. #2066
Closed
2 tasks done
Labels
C-forge
Command: forge
Cmd-forge-build
Command: forge build
Cmd-forge-test
Command: forge test
T-bug
Type: bug
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (935c113 2022-06-22T00:14:50.974796Z)
What command(s) is the bug in?
forge test --match-contract <CONTRACT_NAME>
Operating System
macOS (Apple Silicon)
Describe the bug
I'm not sure if this is intended behavior or not but would be nice if when using
forge test --match-contract <CONTRACT_NAME>
the only test contract that is compiled is the contract mentioned and all the necessary imports.This is how the situation unfolded for me:
I made a change in a function in contract
A.sol
and I have two test contractsBTest.sol
andCTest.sol
both with tests using that function, I'm aware that tests in contractCTest.sol
will fail to compile so I wanted to only test contractBTest.sol
. Because forge compiles all contracts at the same time I'm unable to testBTest.sol
without fixingCTest.sol
.The text was updated successfully, but these errors were encountered: