Skip to content

Commit b491c24

Browse files
committed
tests: foundry: improve and fix test
`--no-commit` is now the default behavior and the flag has been removed. This also adds a new case to test with an `out` directory that is different than the default.
1 parent fcb9af3 commit b491c24

File tree

1 file changed

+32
-7
lines changed

1 file changed

+32
-7
lines changed

scripts/ci_test_foundry.sh

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#!/usr/bin/env bash
2-
32
### Test foundry integration
3+
set -Eeuxo pipefail
44

55

6-
cd /tmp || exit 255
6+
## test 1 - same folder
77

8+
cd /tmp || exit 255
89
mkdir forge_test
910
cd forge_test || exit 255
10-
forge init --no-commit
11+
forge init
1112

1213
crytic-compile .
1314
if [ $? -ne 0 ]
@@ -16,11 +17,35 @@ then
1617
exit 255
1718
fi
1819

19-
mkdir /tmp/forge_test/test_2
20-
rsync -a --exclude='test_2' ./ /tmp/forge_test/test_2/
21-
crytic-compile ./test_2
20+
21+
## test 2 - same folder, different out dir
22+
23+
cd /tmp || exit 255
24+
mkdir forge_test2
25+
cd forge_test2 || exit 255
26+
forge init
27+
28+
sed -i 's/^out\s*=.*$/out = "foobar"/' foundry.toml
29+
30+
crytic-compile .
2231
if [ $? -ne 0 ]
2332
then
2433
echo "foundry test 2 failed"
2534
exit 255
26-
fi
35+
fi
36+
37+
## test 3 - different folder
38+
39+
cd /tmp || exit 255
40+
mkdir forge_test3
41+
cd forge_test3 || exit 255
42+
forge init
43+
44+
cd /tmp || exit 255
45+
46+
crytic-compile ./forge_test3
47+
if [ $? -ne 0 ]
48+
then
49+
echo "foundry test 3 failed"
50+
exit 255
51+
fi

0 commit comments

Comments
 (0)