Skip to content

Commit

Permalink
test: add a deadlock_finder
Browse files Browse the repository at this point in the history
  • Loading branch information
drawbu committed May 3, 2024
1 parent b6b9e5f commit f05ef20
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/deadlock_finder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

if [ "$#" -ne 1 ] && [ "$#" -ne 2 ]; then
echo "Usage: $0 <limit> [program]"
exit 1
fi

limit=$1
program=$2
if [ -z "$program" ]; then
program="./panoramix"
fi

# ./panoramix <nb_villagers> <pot_size> <nb_fights> <nb_refills>
for ((vil = 1; vil <= limit; vil++)); do
for ((pot = 1; pot <= limit; pot++)); do
for ((fig = 1; fig <= limit; fig++)); do
for ((ref = 1; ref <= limit; ref++)); do
echo -n "Run number: $vil $pot $fig $ref "
echo -ne "\r"
$program "$vil" "$pot" "$fig" "$ref" > /dev/null
done
done
done
done

echo

0 comments on commit f05ef20

Please sign in to comment.