feat: run-and-kill script (#6188)

This commit is contained in:
pajlada
2025-05-04 15:11:26 +02:00
committed by GitHub
parent c7e1c2e812
commit 0cfe65410d
2 changed files with 41 additions and 0 deletions
+1
View File
@@ -32,6 +32,7 @@
- Dev: Removed authenticated PubSub implementation. (#6158)
- Dev: Save settings in `aboutToQuit`. (#6159)
- Dev: Bumped deprecation cutoff to Qt 6.4.3. (#6169)
- Dev: Added a `run-and-kill.sh` script to help debug crash-on-exit bugs. (#6188)
- Dev: Updated GoogleTest to v1.17.0. (#6180)
- Dev: Mini refactor of `TwitchAccount`. (#6182)
- Dev: Simplified string literals to be a re-export of Qt functions. (#6175)
+40
View File
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
set -e
# This is a script that runs then kills chatterino at random intervals
# You can modify the _min_ms and _rand_ms to change how often they're killed
_min_ms="1000"
_rand_ms="8000"
if [ -z "$1" ]; then
echo "usage: $0 <path_to_chatterino_bin_to_run> (e.g. $0 ./build-mold/bin/chatterino)"
exit
fi
bin_to_run="$1"
while true; do
sleep_time_ms=$(( RANDOM % _rand_ms + _min_ms ))
sleep_time="$(echo "${sleep_time_ms}/1000" | bc)"
$bin_to_run &
pid=$!
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ">>>>>>> SLEEPING FOR ${sleep_time}s"
(sleep "$sleep_time" && echo "" && echo "<<<<<<<<<<<<< TRY KILL" && kill -SIGINT "$pid") &
wait "$pid"
sleep 0.5
done