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 486a92c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/deadlock_finder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/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

echo "About to run $(($limit * $limit * $limit * $limit)) times"

# ./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 486a92c

Please sign in to comment.