Re: [PATCH] tests: don't use assert/abort on MSVC as they are interactive.

2010-09-29 Thread Peter Rosin
Hi Ralf,

Den 2010-09-29 21:01 skrev Ralf Wildenhues:
> * Peter Rosin wrote on Wed, Sep 29, 2010 at 10:06:00AM CEST:
>> Ok to push this one?
> 
> I don't mind it, but I'll note that the patch will cause testsuite
> failures when no wrapper is actually used.  This can happen
> 
> - with --disable-shared passed toplevel, or on static-only systems,
> - on systems where a wrapper is not needed even in shared mode
> 
> At least for lalib-syntax it will thus cause failure for the wrong
> reason (the current XFAIL hides that I guess).

I think you are wrong here.

lalib-syntax only looks at the 1st argument so the fact that I
have added a 2nd argument should not matter in practice.  We don't
call it without arguments so its "argc < 2" check is just cosmetics.

> For demo-relink that is irrelevant, as demo/main.c ignores its
> arguments, tests/depdemo/main.c however also uses them.

The only prior argument to depdemo/main.c that I could find was -alt,
which is explicitly tested for in main(), so if an extra --lt- option
"bleeds in", it should be ignored and not cause any harm.  I might
have missed something though.

So, I actually don't think the patch will affect the testsuite results.

> (This need for internal knowledge about when wrappers are used, is why
> I disliked the arguments to them; or am I misremembering and we have
> changed the wrappers to be used in more cases for some reason?)

Agreed, it is hard(ish) to determine if it is safe to add the --lt-
argument and if unrelated changes are needed it is easy to regress.

> Hmm, --lt-no-interactive instead of --lt-no-popup, for consistency with
> check-(non)interactive?

--lt-no-interactive is fine by me, but why not --lt-non-interactive?

I'll think some more about the general issue.  What I really would
like is a bash shopt to set the error mode from the shell when
running testsuites.  Then we could really forget this issue.  Either
that or some way to make MSYS not force the "default" error mode so
hard.  I have tried to start MSYS with an inherited error mode, but
I couldn't make it stick.  I guess I need to start digging in the
sources of those projects, and see if I can see what would be the
best/easiest solution.

Cheers,
Peter



Re: [PATCH] tests: don't use assert/abort on MSVC as they are interactive.

2010-09-29 Thread Ralf Wildenhues
Hi Peter,

* Peter Rosin wrote on Wed, Sep 29, 2010 at 10:06:00AM CEST:
> Ok to push this one?

I don't mind it, but I'll note that the patch will cause testsuite
failures when no wrapper is actually used.  This can happen

- with --disable-shared passed toplevel, or on static-only systems,
- on systems where a wrapper is not needed even in shared mode

At least for lalib-syntax it will thus cause failure for the wrong
reason (the current XFAIL hides that I guess).

For demo-relink that is irrelevant, as demo/main.c ignores its
arguments, tests/depdemo/main.c however also uses them.

(This need for internal knowledge about when wrappers are used, is why
I disliked the arguments to them; or am I misremembering and we have
changed the wrappers to be used in more cases for some reason?)

Hmm, --lt-no-interactive instead of --lt-no-popup, for consistency with
check-(non)interactive?

Thanks,
Ralf

> Subject: [PATCH] tests: make more tests non-interactive on MSYS.
> 
> * libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src):
> Recognize --lt-no-popup and set the w32 error mode so that
> Windows do not popup dialogs if the option is seen.
> * libltdl/config/ltmain.m4sh (func_parse_lt_options): Recognize
> --lt-no-popup and strip it out (with no side effect, there is
> no API for adjusting the w32 error mode from within a shell).
> * tests/demo-relink.test, tests/depdemo-relink.test: Use the
> above option to make the test non-interactive on MSYS.
> tests/lalib-syntax.at: Use the above option to make the test
> non-interactive on MSYS/MSVC (the MSVC version of assert/abort
> pops up an error dialog).
> * docs/libtool.texi (Wrapper executables): Document the new
> option of the wrapper.



Re: [PATCH] tests: don't use assert/abort on MSVC as they are interactive.

2010-09-29 Thread Peter Rosin
Den 2010-09-29 17:00 skrev Charles Wilson:
> On 9/29/2010 10:15 AM, Peter Rosin wrote:
>> Den 2010-09-29 15:47 skrev Charles Wilson:
>>> Will this patch cause any issues if people try to use libtool + MSYS on
>>> a Win9x system?
>>
>> I don't foresee any problems, because SetErrorMode is really old.  You
>> were worrying about the entry point not being there, right?
> 
> Right.  Sadly, MSDN no longer even references things that old; from
> reading it, you'd think that *nothing* existed prior to w2k, and *every*
> current entry point was brand new with that version.
> 
> SetErrorMode:
> Minimum Supported Client: Windows 2000 Professional

Yes, that's a complete drag.

> So it's no longer even possible to discover exactly HOW old an API is,
> if it predates w2k.  At least, not via MSDN.

Well, there are pages like this:
http://www.sybase.be/detail?id=47705

Anyway, SetErrorMode is win9x-safe.

Cheers,
Peter



Re: [PATCH] tests: don't use assert/abort on MSVC as they are interactive.

2010-09-29 Thread Charles Wilson
On 9/29/2010 10:15 AM, Peter Rosin wrote:
> Den 2010-09-29 15:47 skrev Charles Wilson:
>> Will this patch cause any issues if people try to use libtool + MSYS on
>> a Win9x system?
> 
> I don't foresee any problems, because SetErrorMode is really old.  You
> were worrying about the entry point not being there, right?

Right.  Sadly, MSDN no longer even references things that old; from
reading it, you'd think that *nothing* existed prior to w2k, and *every*
current entry point was brand new with that version.

SetErrorMode:
Minimum Supported Client: Windows 2000 Professional

So it's no longer even possible to discover exactly HOW old an API is,
if it predates w2k.  At least, not via MSDN.

--
Chuck





Re: [PATCH] tests: don't use assert/abort on MSVC as they are interactive.

2010-09-29 Thread Peter Rosin
Den 2010-09-29 15:47 skrev Charles Wilson:
> On 9/29/2010 4:06 AM, Peter Rosin wrote:
>> Cygwin is always running with this error mode (I think), MSYS is not.
> 
> Cygwin no longer supports Win9x, MSYS does.
> 
> Will this patch cause any issues if people try to use libtool + MSYS on
> a Win9x system?

I don't foresee any problems, because SetErrorMode is really old.  You
were worrying about the entry point not being there, right?

Cheers,
Peter



Re: [PATCH] tests: don't use assert/abort on MSVC as they are interactive.

2010-09-29 Thread Charles Wilson
On 9/29/2010 4:06 AM, Peter Rosin wrote:
> Cygwin is always running with this error mode (I think), MSYS is not.

Cygwin no longer supports Win9x, MSYS does.

Will this patch cause any issues if people try to use libtool + MSYS on
a Win9x system?

--
Chuck






Re: [PATCH] tests: don't use assert/abort on MSVC as they are interactive.

2010-09-29 Thread Peter Rosin
Den 2010-09-28 22:09 skrev Ralf Wildenhues:
> Hello Peter,
> 
> * Peter Rosin wrote on Tue, Sep 28, 2010 at 08:08:13PM CEST:
>> Ok to push?
> 
> Avoiding assert doesn't seem like a scalable solution: lots of packages
> use assert for testing.  assert is ANSI C.  We use assert in slist.at.
> Is there a way to avoid popups?
> 
> Hmm, or, if there is no way, then I guess you're saying popups are ok if
> it only happens for unexpected failures.  Then I don't have a good
> argument against the patch any more.

I started out by setting the w32 error mode directly in the executable in
the test, and that revealed that I was wrong in what error mode flag
this was connected to (I thought SEM_FAILCRITICALERRORS, but it really is
SEM_NOGPFAULTERRORBOX).  That revelation made me reimplement an idea I
had a while back that I didn't get to work because of that misconception.

So, here's a patch with a different take on the problem that makes the old
testsuite non-interactive on MSYS, and that fixes this non-interactiveness
too. The two remaining interactive tests (link-order2.at and static.at)
unfortunately runs installed binaries so this scheme is not working there.

I didn't want to unconditionally fiddle the error mode when running through
the wrapper, as that would royally screw users depending on the error
dialog to be there.

Cygwin is always running with this error mode (I think), MSYS is not.

Ok to push this one?

Cheers,
Peter

>From fa648e86ec81defc48e035ca952635e2dc42cc51 Mon Sep 17 00:00:00 2001
From: Peter Rosin 
Date: Wed, 29 Sep 2010 09:59:18 +0200
Subject: [PATCH] tests: make more tests non-interactive on MSYS.

* libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src):
Recognize --lt-no-popup and set the w32 error mode so that
Windows do not popup dialogs if the option is seen.
* libltdl/config/ltmain.m4sh (func_parse_lt_options): Recognize
--lt-no-popup and strip it out (with no side effect, there is
no API for adjusting the w32 error mode from within a shell).
* tests/demo-relink.test, tests/depdemo-relink.test: Use the
above option to make the test non-interactive on MSYS.
tests/lalib-syntax.at: Use the above option to make the test
non-interactive on MSYS/MSVC (the MSVC version of assert/abort
pops up an error dialog).
* docs/libtool.texi (Wrapper executables): Document the new
option of the wrapper.

Signed-off-by: Peter Rosin 
---
 ChangeLog  |   17 +
 doc/libtool.texi   |7 +++
 libltdl/config/ltmain.m4sh |   16 ++--
 tests/demo-relink.test |2 +-
 tests/depdemo-relink.test  |2 +-
 tests/lalib-syntax.at  |2 +-
 6 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a7aa489..3967d0a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2010-09-29  Peter Rosin  
+
+   tests: make more tests non-interactive on MSYS.
+   * libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src):
+   Recognize --lt-no-popup and set the w32 error mode so that
+   Windows do not popup dialogs if the option is seen.
+   * libltdl/config/ltmain.m4sh (func_parse_lt_options): Recognize
+   --lt-no-popup and strip it out (with no side effect, there is
+   no API for adjusting the w32 error mode from within a shell).
+   * tests/demo-relink.test, tests/depdemo-relink.test: Use the
+   above option to make the test non-interactive on MSYS.
+   tests/lalib-syntax.at: Use the above option to make the test
+   non-interactive on MSYS/MSVC (the MSVC version of assert/abort
+   pops up an error dialog).
+   * docs/libtool.texi (Wrapper executables): Document the new
+   option of the wrapper.
+
 2010-09-27  Peter Rosin  
 
tests: check if sys_lib_search_path_spec works on MSVC.
diff --git a/doc/libtool.texi b/doc/libtool.texi
index cd5a181..a9f6c5a 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -904,6 +904,13 @@ These command line options include:
 Causes the wrapper to print a copy of the wrapper @emph{script}
 to @code{stdout}, and exit.
 
+...@item --lt-no-popup
+This option makes the wrapper attempt to set things up so that the
+program does not issue any error dialogs, and instead report errors with
+an exit status as is the normal way.  This is particularly useful in
+testsuites on w32, as w32 has a tendency to pop up error dialogs for
+certain errors potentially making the testsuite non-interactive.
+
 @item --lt-debug
 Causes the wrapper to print diagnostic information to @code{stdout},
 before launching the program executable.
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 0418007..cacf68f 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -3111,8 +3111,8 @@ _LTECHO_EOF'
 # (application programs are unlikely to have options which match
 # this pattern).
 #
-# There are only two supported options: --lt-debug and
-# --lt-dump-script. There is, deliberately, no --lt-help.
+# There are onl