aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/status/test-statusctl.sh
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/modules/status/test-statusctl.sh')
-rwxr-xr-xdesktop/modules/status/test-statusctl.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/desktop/modules/status/test-statusctl.sh b/desktop/modules/status/test-statusctl.sh
index 38da27c..afe56d4 100755
--- a/desktop/modules/status/test-statusctl.sh
+++ b/desktop/modules/status/test-statusctl.sh
@@ -133,5 +133,21 @@ kill "$watcher4" 2>/dev/null
wait "$watcher4" 2>/dev/null
check "game ending redraws" "1" "$(grep -c '"class": *"deactivated"' "$out4")"
+# The first write of a session creates the file, and Qt's atomic write does
+# that by linking an unnamed temp file into place: the only event naming the
+# mode file is IN_CREATE, no close_write and no moved_to. A hard link from
+# another name reproduces exactly that event.
+rm -f "$tmp/status.gaming" "$tmp/status.presentation"
+out5="$tmp/watch5.out"
+"$ctl" presentation watch > "$out5" 2>/dev/null &
+watcher5=$!
+sleep 0.3
+printf '1\n' > "$tmp/unnamed"
+ln "$tmp/unnamed" "$tmp/status.gaming"
+sleep 0.5
+kill "$watcher5" 2>/dev/null
+wait "$watcher5" 2>/dev/null
+check "first write, created by link, redraws" "1" "$(grep -c '"class": *"gaming"' "$out5")"
+
printf '\n%d passed, %d failed\n' "$pass" "$fail"
[[ "$fail" -eq 0 ]]