diff --git a/tests/test-inotify-debuginotify.out b/tests/test-inotify-debuginotify.out
deleted file mode 100644
--- a/tests/test-inotify-debuginotify.out
+++ /dev/null
@@ -1,14 +0,0 @@
-% inserve
-% empty
-directories being watched:
-  /
-  .hg/
-% only a
-directories being watched:
-  /
-  .hg/
-  a/
-% empty again
-directories being watched:
-  /
-  .hg/
diff --git a/tests/test-inotify-debuginotify b/tests/test-inotify-debuginotify.t
old mode 100755
new mode 100644
rename from tests/test-inotify-debuginotify
rename to tests/test-inotify-debuginotify.t
--- a/tests/test-inotify-debuginotify
+++ b/tests/test-inotify-debuginotify.t
@@ -1,32 +1,41 @@
-#!/bin/sh
 
-"$TESTDIR/hghave" inotify || exit 80
+  $ "$TESTDIR/hghave" inotify || exit 80
+  $ hg init
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "inotify=" >> $HGRCPATH
 
-hg init
+inserve
 
-echo "[extensions]" >> $HGRCPATH
-echo "inotify=" >> $HGRCPATH
+  $ hg inserve -d --pid-file=hg.pid
+  $ cat hg.pid >> "$DAEMON_PIDS"
 
-echo % inserve
-hg inserve -d --pid-file=hg.pid
-cat hg.pid >> "$DAEMON_PIDS"
+let the daemon finish its stuff
 
-# let the daemon finish its stuff
-sleep 1
+  $ sleep 1
+
+empty
 
-echo % empty
-hg debuginotify
+  $ hg debuginotify
+  directories being watched:
+    /
+    .hg/
+  $ mkdir a
+  $ sleep 1
 
-mkdir a
-sleep 1
+only 'a
 
-echo % only 'a'
-hg debuginotify
+  $ hg debuginotify
+  directories being watched:
+    /
+    .hg/
+    a/
+  $ rmdir a
+  $ sleep 1
 
-rmdir a
-sleep 1
+empty again
 
-echo % empty again
-hg debuginotify
-
-kill `cat hg.pid`
+  $ hg debuginotify
+  directories being watched:
+    /
+    .hg/
+  $ kill `cat hg.pid`