Skip to content

Commit

Permalink
Use fstar makefiles to run test instead
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasAlaif committed Dec 27, 2024
1 parent b45dd4b commit a763fb2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/smt2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
with:
ocaml-compiler: 5

- name: Debugging with tmate
uses: mxschmitt/[email protected]
# - name: Debugging with tmate
# uses: mxschmitt/[email protected]

- name: Make smt2 files
run: ./make_smt2.sh
Expand Down
21 changes: 17 additions & 4 deletions fstar/run.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
FSTAR="$(realpath "$(dirname "$0")")/fstar/bin/fstar.exe"
Z3_VERSION=$(z3 --version | sed -E 's/.* ([0-9]+\.[0-9]+\.[0-9]+).*/\1/g')

export FSTAR_ROOT="$(realpath "$(dirname "$0")")/fstar"
# Instead of using "OTHERFLAGS", this is an ugly hack to force our flags to take
# priority since "HINTS_ENABLED" is last appended in "fstar/mk/test.mk".
export HINTS_ENABLED=" --z3version \"$Z3_VERSION\" --log_queries "
# FSTAR_EXE="$FSTAR_ROOT/bin/fstar.exe"

OUT="$(pwd)/$(dirname "$2")"
mkdir -p "$OUT"
cd "$OUT"

Z3_VERSION=$(z3 --version | sed -E 's/.* ([0-9]+\.[0-9]+\.[0-9]+).*/\1/g')
"$FSTAR" --z3version "$Z3_VERSION" --log_queries "$1"
cd "$(dirname "$1")"
make clean
make

while read -r file; do
[ -z "$file" ] && continue
tgt="$(basename "$file")"
tgt="$OUT/${tgt#./}"
mv "$file" "$tgt"
done <<< "$(find . -name "*.smt2" -type f)"
3 changes: 2 additions & 1 deletion fstar/tests.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
find "$(realpath "$(dirname "$0")")/fstar/tests" -name "*.fst" -type f
TESTS="$(realpath "$(dirname "$0")")/fstar/tests"
find "$TESTS" -name "Makefile" -type f

0 comments on commit a763fb2

Please sign in to comment.