Skip to content

Commit

Permalink
Add verus
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasAlaif committed Dec 29, 2024
1 parent ff891aa commit 2e04489
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "fstar/fstar"]
path = fstar/fstar
url = https://github.com/FStarLang/FStar.git
[submodule "verus/verus"]
path = verus/verus
url = https://github.com/verus-lang/verus.git
2 changes: 1 addition & 1 deletion make_smt2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

VERIFIERS="$@"
if [ -z "$VERIFIERS" ]; then
VERIFIERS="fstar dafny silicon carbon"
VERIFIERS="verus fstar dafny silicon carbon"
fi

git submodule update --init --recursive &> /dev/null
Expand Down
7 changes: 7 additions & 0 deletions verus/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cd "$(dirname "$0")/verus/source"

if [ ! -f ./target-verus/release/verus ]; then
source ../tools/activate
./tools/get-z3.sh
vargo build --release
fi
6 changes: 6 additions & 0 deletions verus/run-single.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
OUT="$(pwd)/${2%.*}"

mkdir -p "$(dirname "$OUT")"

cd "$(dirname "$0")/verus/source"
./target-verus/release/verus --log-dir "$OUT" --log smt --rlimit "$3" $1
14 changes: 14 additions & 0 deletions verus/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
OP=($2)
OUT="$(pwd)/$(echo "${OP[0]%.*}" | sed 's/ /_/g')/${OP[1]}"
mkdir -p "$(dirname "$OUT")"

cd "$(dirname "$0")/verus/source"
export VERUS_EXTRA_ARGS="--log-dir $OUT --log smt --rlimit $3"
export VARGO_IN_NEXTEST=true
TEST=($1)
FILE=${TEST[0]#$(pwd)/rust_verify_test/tests/}
vargo test --package rust_verify_test --test ${FILE%.*} -- ${TEST[1]} --exact &> /dev/null || exit 1
if [ -f "$OUT/root.smt2" ]; then
mv "$OUT/root.smt2" "$OUT.smt2"
rmdir "$OUT" || true
fi
1 change: 1 addition & 0 deletions verus/tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
grep -oEr "#\[test\] (\w+)" "$(realpath "$(dirname "$0")")/verus/source/rust_verify_test/tests" | sed -E "s|^(.*):#\[test\] ([a-zA-Z_0-9-]+)|\1 \2|g"
1 change: 1 addition & 0 deletions verus/verus
Submodule verus added at dad711

0 comments on commit 2e04489

Please sign in to comment.