Skip to content

Commit a3814d8

Browse files
output to a file and grep result
1 parent a5b22b9 commit a3814d8

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.github/workflows/medusa.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
config: Popsicle.yaml
101101
contract: PopsicleBroken
102102
outcome: failure
103-
expected: 'totalBalanceAfterTransferIsPreserved(address,uint256):\s*failed'
103+
expected: '"PopsicleBroken.totalBalanceAfterTransferIsPreserved(address,uint256)" resulted in an assertion failure after the following call sequence'
104104
- name: PopsicleFixed
105105
workdir: program-analysis/echidna/example/
106106
files: PopsicleFixed.sol
@@ -163,10 +163,22 @@ jobs:
163163
go build -o medusa -v .
164164
go install -v .
165165
sudo cp medusa /usr/bin
166-
pip install crytic-compile
166+
pip install crytic-compile solc-select
167167
168-
- name: Run Medusa for Internal ERC20 tests
168+
- name: Run Medusa
169169
continue-on-error: true
170170
working-directory: ${{ matrix.workdir }}
171171
run: |
172-
medusa fuzz --compilation-target ${{ matrix.files }} --target-contracts ${{ matrix.contract }}
172+
solc-select install ${{ matrix.solc-version || '0.8.0' }}
173+
solc-select use ${{ matrix.solc-version || '0.8.0' }}
174+
medusa fuzz --compilation-target ${{ matrix.files }} --target-contracts ${{ matrix.contract }} > ${{ matrix.files }}.out
175+
176+
- name: Verify that the output is correct
177+
run: |
178+
if grep -q "${{ matrix.expected }}" "${{ matrix.files }}.out"; then
179+
echo "Output matches"
180+
else
181+
echo "Output mismatch. Expected something matching '${{ matrix.expected }}'. Got the following:"
182+
cat "${{ matrix.files }}.out"
183+
exit 1
184+
fi

0 commit comments

Comments
 (0)