Skip to content

Commit

Permalink
Merge pull request #30 from rems-project/mdd/check-all-script
Browse files Browse the repository at this point in the history
Add a script `check-all.sh` to check all examples in `example-archive`, recategorize a couple of failing examples
  • Loading branch information
septract authored Jun 17, 2024
2 parents 7da4848 + 74f88de commit 3bc62e8
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 1 deletion.
43 changes: 43 additions & 0 deletions src/example-archive/check-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env bash

if [ -n "$1" ]
then
echo "check-all.sh: using CN=$1 in $PWD"
CN="$1"
else
CN=cn
fi

subdirs=(
"c-testsuite"
"dafny-tutorial"
"java_program_verification_challenges"
"negative-examples"
"open-sut"
"Rust"
"SAW"
"simple-examples"
)
FAILURE=0

for subdir in "${subdirs[@]}"; do
cd "$subdir" || continue

../check.sh $CN

if [ $? != 0 ]
then
FAILURE=1
fi

cd ..
done

if [ $FAILURE -eq 0 ];
then
printf "\n\033[32mTest suite passes:\033[0m all CN tests in the example archive produced expected return codes\n"
exit 0
else
printf "\n\033[31mTest suite fails:\033[0m one or more CN tests in the example archive produced an unexpected return code\n"
exit 1
fi
2 changes: 1 addition & 1 deletion src/example-archive/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if [ -n "$1" ]
then
echo "using CN=$1 in $PWD"
echo "check.sh: using CN=$1 in $PWD"
CN="$1"
else
CN=cn
Expand Down

0 comments on commit 3bc62e8

Please sign in to comment.