[PATCH] test: run emacs inside tmux if screen is not available

2011-07-20 Thread Dmitry Kurochkin
On Wed, 20 Jul 2011 20:12:55 +0200, Thomas Jost  
wrote:
> On Wed, 20 Jul 2011 10:28:38 -0700, Jameson Graef Rollins  finestructure.net> wrote:
> Non-text part: multipart/signed
> > On Wed, 20 Jul 2011 17:37:35 +0400, Dmitry Kurochkin  > gmail.com> wrote:
> > > On Wed, 20 Jul 2011 14:36:36 +0200, Thomas Jost  > > schnouki.net> wrote:
> > > > Before this change, the test suite reported many failed tests on 
> > > > machines where
> > > > screen is not installed (which is the case of many *BSD systems). This 
> > > > patch
> > > > makes the test suite try to use tmux, another terminal multiplexer, if 
> > > > screen is
> > > > not available.
> > > 
> > > This is a nice improvement.  But I think we should make it even better :)
> > > There are more terminal emulators besides screen and tmux (dtach comes
> > > to mind).  We need a more general mechanism for trying them.  There
> > > should be a list of commands for running terminal emulators in the order
> > > of preference (I think that is dtach, tmux, screen), and we should try
> > > each one in a loop (this would also avoid repeating the long emacs
> > > command).
> > 
> > Hi, guys.  I suppose you can go down this route if you want, but I worry
> > that it just adds a lot of extra code to the test suite that will
> > ultimately make it less robust.  What's wrong with just depending on
> > screen for the tests?  I'm sure screen is available on every operating
> > system that we currently support.
> > 
> > It makes me wary that we would be starting a precedent for making a
> > bunch of conditionals for all of the possible alternative tools we use
> > in the test suite.  Maybe that's an overblown concern, though.
> > 
> > jamie.
> 
> You're right, just depending on screen would be enough (the package is
> just 864 kB on Arch Linux...), and supporting alternative tools
> would make the test suite more complicated and less robust. But the
> dependency on screen should be more *explicit*: if it's not available,
> the test suite should skip all the emacs tests and display a message
> about screen.
> 
> Apparently test-lib.sh includes some things about prerequisites. I'll
> try to use these to implement the explicit dependency on screen.
> 

Full ack.  The only reason I did not implement it in the original patch
is because there is an existing patch series [1] that adds proper
prerequisites for gdb, emacs and gpg.  So instead of reimplementing the
same thing, I decided to wait until that series is merged and add screen
prerequisite later.

Regards,
  Dmitry

[1] id:"1307016220-17509-1-git-send-email-pieter at praet.org"

> Regards,
> 
> -- 
> Thomas/Schnouki
Non-text part: application/pgp-signature


[PATCH] test: run emacs inside tmux if screen is not available

2011-07-20 Thread Thomas Jost
On Wed, 20 Jul 2011 10:28:38 -0700, Jameson Graef Rollins  wrote:
Non-text part: multipart/signed
> On Wed, 20 Jul 2011 17:37:35 +0400, Dmitry Kurochkin  gmail.com> wrote:
> > On Wed, 20 Jul 2011 14:36:36 +0200, Thomas Jost  
> > wrote:
> > > Before this change, the test suite reported many failed tests on machines 
> > > where
> > > screen is not installed (which is the case of many *BSD systems). This 
> > > patch
> > > makes the test suite try to use tmux, another terminal multiplexer, if 
> > > screen is
> > > not available.
> > 
> > This is a nice improvement.  But I think we should make it even better :)
> > There are more terminal emulators besides screen and tmux (dtach comes
> > to mind).  We need a more general mechanism for trying them.  There
> > should be a list of commands for running terminal emulators in the order
> > of preference (I think that is dtach, tmux, screen), and we should try
> > each one in a loop (this would also avoid repeating the long emacs
> > command).
> 
> Hi, guys.  I suppose you can go down this route if you want, but I worry
> that it just adds a lot of extra code to the test suite that will
> ultimately make it less robust.  What's wrong with just depending on
> screen for the tests?  I'm sure screen is available on every operating
> system that we currently support.
> 
> It makes me wary that we would be starting a precedent for making a
> bunch of conditionals for all of the possible alternative tools we use
> in the test suite.  Maybe that's an overblown concern, though.
> 
> jamie.

You're right, just depending on screen would be enough (the package is
just 864 kB on Arch Linux...), and supporting alternative tools
would make the test suite more complicated and less robust. But the
dependency on screen should be more *explicit*: if it's not available,
the test suite should skip all the emacs tests and display a message
about screen.

Apparently test-lib.sh includes some things about prerequisites. I'll
try to use these to implement the explicit dependency on screen.

Regards,

-- 
Thomas/Schnouki
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: 



[PATCH] test: run emacs inside tmux if screen is not available

2011-07-20 Thread Dmitry Kurochkin
Hi Thomas.

On Wed, 20 Jul 2011 14:36:36 +0200, Thomas Jost  
wrote:
> Before this change, the test suite reported many failed tests on machines 
> where
> screen is not installed (which is the case of many *BSD systems). This patch
> makes the test suite try to use tmux, another terminal multiplexer, if screen 
> is
> not available.

This is a nice improvement.  But I think we should make it even better :)
There are more terminal emulators besides screen and tmux (dtach comes
to mind).  We need a more general mechanism for trying them.  There
should be a list of commands for running terminal emulators in the order
of preference (I think that is dtach, tmux, screen), and we should try
each one in a loop (this would also avoid repeating the long emacs
command).

Regards,
  Dmitry

> ---
>  test/test-lib.sh |   13 +++--
>  1 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/test/test-lib.sh b/test/test-lib.sh
> index 0608e42..5851b3d 100755
> --- a/test/test-lib.sh
> +++ b/test/test-lib.sh
> @@ -860,12 +860,21 @@ EOF
>  test_emacs () {
>   if [ -z "$EMACS_SERVER" ]; then
>   EMACS_SERVER="notmuch-test-suite-$$"
> - # start a detached screen session with an emacs server
> + # start a detached screen or tmux session with an emacs server
>   screen -S "$EMACS_SERVER" -d -m "$TMP_DIRECTORY/run_emacs" \
>   --no-window-system \
>   --eval "(setq server-name \"$EMACS_SERVER\")" \
>   --eval '(server-start)' \
> - --eval "(orphan-watchdog $$)" || return
> + --eval "(orphan-watchdog $$)"
> + if [ "$?" != 0 ]
> + then
> + tmux -f /dev/null -L "$EMACS_SERVER" new-session -d 
> "$TMP_DIRECTORY/run_emacs \
> + --no-window-system \
> + --eval \"(setq server-name 
> \\\"$EMACS_SERVER\\\")\" \
> + --eval '(server-start)' \
> + --eval \"(orphan-watchdog $$)\"" || return
> + fi
> +
>   # wait until the emacs server is up
>   until test_emacs '()' 2>/dev/null; do
>   sleep 1
> -- 
> 1.7.6
> 


[PATCH] test: run emacs inside tmux if screen is not available

2011-07-20 Thread Thomas Jost
Before this change, the test suite reported many failed tests on machines where
screen is not installed (which is the case of many *BSD systems). This patch
makes the test suite try to use tmux, another terminal multiplexer, if screen is
not available.
---
 test/test-lib.sh |   13 +++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/test/test-lib.sh b/test/test-lib.sh
index 0608e42..5851b3d 100755
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -860,12 +860,21 @@ EOF
 test_emacs () {
if [ -z "$EMACS_SERVER" ]; then
EMACS_SERVER="notmuch-test-suite-$$"
-   # start a detached screen session with an emacs server
+   # start a detached screen or tmux session with an emacs server
screen -S "$EMACS_SERVER" -d -m "$TMP_DIRECTORY/run_emacs" \
--no-window-system \
--eval "(setq server-name \"$EMACS_SERVER\")" \
--eval '(server-start)' \
-   --eval "(orphan-watchdog $$)" || return
+   --eval "(orphan-watchdog $$)"
+   if [ "$?" != 0 ]
+   then
+   tmux -f /dev/null -L "$EMACS_SERVER" new-session -d 
"$TMP_DIRECTORY/run_emacs \
+   --no-window-system \
+   --eval \"(setq server-name 
\\\"$EMACS_SERVER\\\")\" \
+   --eval '(server-start)' \
+   --eval \"(orphan-watchdog $$)\"" || return
+   fi
+
# wait until the emacs server is up
until test_emacs '()' 2>/dev/null; do
sleep 1
-- 
1.7.6



[PATCH] test: run emacs inside tmux if screen is not available

2011-07-20 Thread Jameson Graef Rollins
On Wed, 20 Jul 2011 17:37:35 +0400, Dmitry Kurochkin  wrote:
> On Wed, 20 Jul 2011 14:36:36 +0200, Thomas Jost  
> wrote:
> > Before this change, the test suite reported many failed tests on machines 
> > where
> > screen is not installed (which is the case of many *BSD systems). This patch
> > makes the test suite try to use tmux, another terminal multiplexer, if 
> > screen is
> > not available.
> 
> This is a nice improvement.  But I think we should make it even better :)
> There are more terminal emulators besides screen and tmux (dtach comes
> to mind).  We need a more general mechanism for trying them.  There
> should be a list of commands for running terminal emulators in the order
> of preference (I think that is dtach, tmux, screen), and we should try
> each one in a loop (this would also avoid repeating the long emacs
> command).

Hi, guys.  I suppose you can go down this route if you want, but I worry
that it just adds a lot of extra code to the test suite that will
ultimately make it less robust.  What's wrong with just depending on
screen for the tests?  I'm sure screen is available on every operating
system that we currently support.

It makes me wary that we would be starting a precedent for making a
bunch of conditionals for all of the possible alternative tools we use
in the test suite.  Maybe that's an overblown concern, though.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



[PATCH] test: run emacs inside tmux if screen is not available

2011-07-20 Thread Thomas Jost
Before this change, the test suite reported many failed tests on machines where
screen is not installed (which is the case of many *BSD systems). This patch
makes the test suite try to use tmux, another terminal multiplexer, if screen is
not available.
---
 test/test-lib.sh |   13 +++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/test/test-lib.sh b/test/test-lib.sh
index 0608e42..5851b3d 100755
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -860,12 +860,21 @@ EOF
 test_emacs () {
if [ -z $EMACS_SERVER ]; then
EMACS_SERVER=notmuch-test-suite-$$
-   # start a detached screen session with an emacs server
+   # start a detached screen or tmux session with an emacs server
screen -S $EMACS_SERVER -d -m $TMP_DIRECTORY/run_emacs \
--no-window-system \
--eval (setq server-name \$EMACS_SERVER\) \
--eval '(server-start)' \
-   --eval (orphan-watchdog $$) || return
+   --eval (orphan-watchdog $$)
+   if [ $? != 0 ]
+   then
+   tmux -f /dev/null -L $EMACS_SERVER new-session -d 
$TMP_DIRECTORY/run_emacs \
+   --no-window-system \
+   --eval \(setq server-name 
\\\$EMACS_SERVER\\\)\ \
+   --eval '(server-start)' \
+   --eval \(orphan-watchdog $$)\ || return
+   fi
+
# wait until the emacs server is up
until test_emacs '()' 2/dev/null; do
sleep 1
-- 
1.7.6

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] test: run emacs inside tmux if screen is not available

2011-07-20 Thread Dmitry Kurochkin
Hi Thomas.

On Wed, 20 Jul 2011 14:36:36 +0200, Thomas Jost schno...@schnouki.net wrote:
 Before this change, the test suite reported many failed tests on machines 
 where
 screen is not installed (which is the case of many *BSD systems). This patch
 makes the test suite try to use tmux, another terminal multiplexer, if screen 
 is
 not available.

This is a nice improvement.  But I think we should make it even better :)
There are more terminal emulators besides screen and tmux (dtach comes
to mind).  We need a more general mechanism for trying them.  There
should be a list of commands for running terminal emulators in the order
of preference (I think that is dtach, tmux, screen), and we should try
each one in a loop (this would also avoid repeating the long emacs
command).

Regards,
  Dmitry

 ---
  test/test-lib.sh |   13 +++--
  1 files changed, 11 insertions(+), 2 deletions(-)
 
 diff --git a/test/test-lib.sh b/test/test-lib.sh
 index 0608e42..5851b3d 100755
 --- a/test/test-lib.sh
 +++ b/test/test-lib.sh
 @@ -860,12 +860,21 @@ EOF
  test_emacs () {
   if [ -z $EMACS_SERVER ]; then
   EMACS_SERVER=notmuch-test-suite-$$
 - # start a detached screen session with an emacs server
 + # start a detached screen or tmux session with an emacs server
   screen -S $EMACS_SERVER -d -m $TMP_DIRECTORY/run_emacs \
   --no-window-system \
   --eval (setq server-name \$EMACS_SERVER\) \
   --eval '(server-start)' \
 - --eval (orphan-watchdog $$) || return
 + --eval (orphan-watchdog $$)
 + if [ $? != 0 ]
 + then
 + tmux -f /dev/null -L $EMACS_SERVER new-session -d 
 $TMP_DIRECTORY/run_emacs \
 + --no-window-system \
 + --eval \(setq server-name 
 \\\$EMACS_SERVER\\\)\ \
 + --eval '(server-start)' \
 + --eval \(orphan-watchdog $$)\ || return
 + fi
 +
   # wait until the emacs server is up
   until test_emacs '()' 2/dev/null; do
   sleep 1
 -- 
 1.7.6
 
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] test: run emacs inside tmux if screen is not available

2011-07-20 Thread Thomas Jost
On Wed, 20 Jul 2011 10:28:38 -0700, Jameson Graef Rollins 
jroll...@finestructure.net wrote:
Non-text part: multipart/signed
 On Wed, 20 Jul 2011 17:37:35 +0400, Dmitry Kurochkin 
 dmitry.kuroch...@gmail.com wrote:
  On Wed, 20 Jul 2011 14:36:36 +0200, Thomas Jost schno...@schnouki.net 
  wrote:
   Before this change, the test suite reported many failed tests on machines 
   where
   screen is not installed (which is the case of many *BSD systems). This 
   patch
   makes the test suite try to use tmux, another terminal multiplexer, if 
   screen is
   not available.
  
  This is a nice improvement.  But I think we should make it even better :)
  There are more terminal emulators besides screen and tmux (dtach comes
  to mind).  We need a more general mechanism for trying them.  There
  should be a list of commands for running terminal emulators in the order
  of preference (I think that is dtach, tmux, screen), and we should try
  each one in a loop (this would also avoid repeating the long emacs
  command).
 
 Hi, guys.  I suppose you can go down this route if you want, but I worry
 that it just adds a lot of extra code to the test suite that will
 ultimately make it less robust.  What's wrong with just depending on
 screen for the tests?  I'm sure screen is available on every operating
 system that we currently support.
 
 It makes me wary that we would be starting a precedent for making a
 bunch of conditionals for all of the possible alternative tools we use
 in the test suite.  Maybe that's an overblown concern, though.
 
 jamie.

You're right, just depending on screen would be enough (the package is
just 864 kB on Arch Linux...), and supporting alternative tools
would make the test suite more complicated and less robust. But the
dependency on screen should be more *explicit*: if it's not available,
the test suite should skip all the emacs tests and display a message
about screen.

Apparently test-lib.sh includes some things about prerequisites. I'll
try to use these to implement the explicit dependency on screen.

Regards,

-- 
Thomas/Schnouki


pgpVj7WlrZLJN.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] test: run emacs inside tmux if screen is not available

2011-07-20 Thread Dmitry Kurochkin
On Wed, 20 Jul 2011 20:12:55 +0200, Thomas Jost schno...@schnouki.net wrote:
 On Wed, 20 Jul 2011 10:28:38 -0700, Jameson Graef Rollins 
 jroll...@finestructure.net wrote:
 Non-text part: multipart/signed
  On Wed, 20 Jul 2011 17:37:35 +0400, Dmitry Kurochkin 
  dmitry.kuroch...@gmail.com wrote:
   On Wed, 20 Jul 2011 14:36:36 +0200, Thomas Jost schno...@schnouki.net 
   wrote:
Before this change, the test suite reported many failed tests on 
machines where
screen is not installed (which is the case of many *BSD systems). This 
patch
makes the test suite try to use tmux, another terminal multiplexer, if 
screen is
not available.
   
   This is a nice improvement.  But I think we should make it even better :)
   There are more terminal emulators besides screen and tmux (dtach comes
   to mind).  We need a more general mechanism for trying them.  There
   should be a list of commands for running terminal emulators in the order
   of preference (I think that is dtach, tmux, screen), and we should try
   each one in a loop (this would also avoid repeating the long emacs
   command).
  
  Hi, guys.  I suppose you can go down this route if you want, but I worry
  that it just adds a lot of extra code to the test suite that will
  ultimately make it less robust.  What's wrong with just depending on
  screen for the tests?  I'm sure screen is available on every operating
  system that we currently support.
  
  It makes me wary that we would be starting a precedent for making a
  bunch of conditionals for all of the possible alternative tools we use
  in the test suite.  Maybe that's an overblown concern, though.
  
  jamie.
 
 You're right, just depending on screen would be enough (the package is
 just 864 kB on Arch Linux...), and supporting alternative tools
 would make the test suite more complicated and less robust. But the
 dependency on screen should be more *explicit*: if it's not available,
 the test suite should skip all the emacs tests and display a message
 about screen.
 
 Apparently test-lib.sh includes some things about prerequisites. I'll
 try to use these to implement the explicit dependency on screen.
 

Full ack.  The only reason I did not implement it in the original patch
is because there is an existing patch series [1] that adds proper
prerequisites for gdb, emacs and gpg.  So instead of reimplementing the
same thing, I decided to wait until that series is merged and add screen
prerequisite later.

Regards,
  Dmitry

[1] id:1307016220-17509-1-git-send-email-pie...@praet.org

 Regards,
 
 -- 
 Thomas/Schnouki
Non-text part: application/pgp-signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch