Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run stainless with admit VCs in the CI #111

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/bolts-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Test solvers availability
run: cvc5 --version && z3 --version && cvc4 --version
- name: Bolts Tests
run: ./run-tests.sh
run: ./run-tests.sh --admit-vcs
fail_if_pull_request_is_draft:
if: github.event.pull_request.draft == true
runs-on: [self-hosted, linux]
Expand Down
40 changes: 31 additions & 9 deletions run-one-test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env bash

ADMIT_VCS=false
if [[ "$1" = "--admit-vcs" ]]; then
ADMIT_VCS=true
shift # Remove the flag from the arguments
fi
STAINLESS="$1"

function run_tests {
Expand All @@ -23,27 +28,44 @@ function run_tests {
echo "$ cat ./verify.sh"
cat "./verify.sh"
echo ""
bash "./verify.sh"
bash "./verify.sh" "--admit-vcs=true"
status=$?
cd -
else
echo "Running '$STAINLESS --config-file=$conf $@' on bolts project: $project..."
echo "$ find $project -name '*.scala' -exec $STAINLESS --config-file=$conf $@ {} +"
find "$project" -name '*.scala' -exec $STAINLESS "--config-file=$conf" "$@" {} +
if [ "$ADMIT_VCS" = true ]; then
find "$project" -name '*.scala' -exec $STAINLESS "--config-file=$conf" "--admit-vcs=true" "$@" {} +
else
find "$project" -name '*.scala' -exec $STAINLESS "--config-file=$conf" "$@" {} +
fi
fi

status=$?

if [ $status -ne 0 ]
then
echo "'$STAINLESS $@' failed on bolts project: $project."
if [ $ADMIT_VCS = true ]; then
if [ $status -eq 0 ] || [ $status -eq 1 ]; then
echo "Stainless accepted project: $project."
exit 0
else
echo "Stainless rejected project: $project."
exit 1
fi
echo "------------------------------------------------------------------------------------------"
echo ""
exit 1
return $status
else
if [ $status -ne 0 ]
then
echo "'$STAINLESS $@' failed on bolts project: $project."
echo "------------------------------------------------------------------------------------------"
echo ""
exit 1
fi
echo "------------------------------------------------------------------------------------------"
echo ""
exit 0
fi

echo "------------------------------------------------------------------------------------------"
echo ""
}

run_tests "${@:2}"
12 changes: 11 additions & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/usr/bin/env bash

STAINLESS="stainless-dotty"
ADMIT_VCS=false
# First check whether the flag --admit-vcs is present
if [[ "$1" = "--admit-vcs" ]]; then
ADMIT_VCS=true
shift # Remove the flag from the arguments
fi
if [[ "$#" = 1 ]]; then
STAINLESS="$1"
fi
Expand All @@ -10,7 +16,11 @@ echo "**************************"
echo "Type Checking vcgen tests:"
echo $TC_TESTS
for project in $TC_TESTS; do
./run-one-test.sh "$STAINLESS" "$project"
if [ "$ADMIT_VCS" = true ]; then
./run-one-test.sh --admit-vcs "$STAINLESS" "$project"
else
./run-one-test.sh "$STAINLESS" "$project"
fi
status=$?
if [ $status -ne 0 ]; then
exit $status
Expand Down
Loading